diff --git a/samples/report/firasans-bold.otf b/samples/report/firasans-bold.otf new file mode 100644 index 0000000..78cc462 Binary files /dev/null and b/samples/report/firasans-bold.otf differ diff --git a/samples/report/firasans-italic.otf b/samples/report/firasans-italic.otf new file mode 100644 index 0000000..92c3472 Binary files /dev/null and b/samples/report/firasans-italic.otf differ diff --git a/samples/report/firasans-light.otf b/samples/report/firasans-light.otf new file mode 100644 index 0000000..609d864 Binary files /dev/null and b/samples/report/firasans-light.otf differ diff --git a/samples/report/firasans-lightitalic.otf b/samples/report/firasans-lightitalic.otf new file mode 100644 index 0000000..735f9d3 Binary files /dev/null and b/samples/report/firasans-lightitalic.otf differ diff --git a/samples/report/firasans-regular.otf b/samples/report/firasans-regular.otf new file mode 100644 index 0000000..8d20d72 Binary files /dev/null and b/samples/report/firasans-regular.otf differ diff --git a/samples/report/heading.svg b/samples/report/heading.svg new file mode 100644 index 0000000..7e6bbb7 --- /dev/null +++ b/samples/report/heading.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/report/index.html b/samples/report/index.html new file mode 100644 index 0000000..dd6815f --- /dev/null +++ b/samples/report/index.html @@ -0,0 +1,258 @@ + + + + + Report + + + + +
+

Report example

+
+ WeasyPrint + 26 rue Emile Decorps + 69100 Villeurbanne France +
+
+ contact@courtbouillon.org + https://courtbouillon.org +
+
+ +
+

Table of contents

+

Part one

+ + +

Part two

+ +
+ +
+

Big title on left page, with text on columns

+ +

This is a little subtitle, here to explain what we are talking about

+ +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam volutpat faucibus vestibulum. + Mauris varius orci quam. Nam dui mauris, dictum at elementum at, mollis pulvinar est. + Nunc lobortis pharetra erat, id rutrum lorem malesuada in. +

+

+ Phasellus id nisl nec arcu tempor ultricies non id tortor. Mauris ex nibh, viverra vitae nisi eget, placerat pharetra est. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id maximus diam. Cras molestie nisl vitae iaculis convallis. + Vivamus molestie vitae nisl sed interdum. Nunc aliquam massa rhoncus finibus convallis. + Vivamus sed vulputate risus. Nunc dignissim magna velit, quis lobortis ex volutpat eget. + Proin dictum mauris condimentum consequat faucibus. +

+

+ Duis maximus mauris ac purus eleifend, sit amet blandit nulla lacinia. + Maecenas massa dolor, suscipit at erat eget, maximus dignissim dolor. Praesent consectetur maximus libero, eu facilisis ligula finibus et. + Cras rhoncus eros sit amet lorem auctor, a efficitur leo tincidunt. Sed viverra interdum odio, eget pulvinar tortor blandit lacinia. + Praesent consequat congue commodo. Phasellus eu massa feugiat, imperdiet nisi a, sagittis ipsum. +

+

+ Suspendisse et gravida nunc. Quisque at felis nisl. Nam eget efficitur nunc. + Vivamus fermentum imperdiet massa, porttitor elementum mauris faucibus scelerisque. + Pellentesque ut metus tortor. Fusce vulputate ex at turpis consectetur, in vestibulum odio placerat. + Suspendisse tempor sapien rutrum, cursus sem a, tincidunt odio. Sed in consequat augue. + Proin finibus felis neque, ac hendrerit lorem consequat nec. +

+

+ Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce quam mi, dapibus et augue sit amet, porttitor volutpat orci. + Vestibulum ac ligula at justo placerat pulvinar vel non velit. Duis vel iaculis nibh, non tristique lectus. + Phasellus vel ex bibendum, accumsan tellus a, commodo nisi. +

+

+ Mauris tincidunt dolor ligula, et egestas lectus rutrum consectetur. Donec ac ex mollis, vestibulum libero in, convallis risus. +

+
+
+ +
+

This is another big title, on a page full of work presentation

+ +

We present you some of WeasyPrint's features.

+ +
+

Table of contents

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mi ante, tincidunt quis vehicula + sed, vehicula sed augue. Cras eget ante turpis. +

+
+ +
+

Heading titles and page counters

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mi ante, tincidunt quis vehicula + sed, vehicula sed augue. Cras eget ante turpis. +

+
+ +
+

Multi-column text

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mi ante, tincidunt quis vehicula + sed, vehicula sed augue. Cras eget ante turpis. +

+
+ + + +
+

Different page types

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mi ante, tincidunt quis vehicula + sed, vehicula sed augue. Cras eget ante turpis. +

+
+
+ +
+

Big title on the first right page

+ +
+

Offer #1

+

€135

+ +
+ +
+

Offer #2

+

€175

+ +
+ +
+

Offer #3

+

€200

+ +
+
+ +
+

This is a chapter of a new section

+
+ +
+

About some typography features

+ +
+

Italic and Bold Text

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut + pulvinar dolor ac orci finibus elementum. Praesent + sit amet ligula turpis. +

+
+ +
+

Small Caps Text

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pulvinar + dolor ac orci finibus elementum. +

+
+ +
+

Ligatures

+
+
Classical
+
OfferOffer
+
Discretionary
+
OftenOften
+
Contextual
+
#&#&
+
+
+ +
+

Numbers

+
+
Fractions
+
421/42 → 421/42
+
Ordinals
+
2a 3o → 2a 3o
+
Slashed zero
+
1000 → 1000
+
Superscript
+
a2 → a2
+
Subscript
+
C8H10N4O2 → C8H10N4O2
+
+
+ +
+

Figures

+
+
Lining
+
+
    +
  • 409,280
  • +
  • 367,112
  • +
+
+
Old-Style
+
+
    +
  • 409,280
  • +
  • 367,112
  • +
+
+
Tabular
+
+
    +
  • 409,280
  • +
  • 367,112
  • +
+
+
Old & Tab.
+
+
    +
  • 409,280
  • +
  • 367,112
  • +
+
+
+
+
+ + diff --git a/samples/report/internal-links.svg b/samples/report/internal-links.svg new file mode 100644 index 0000000..6c23af3 --- /dev/null +++ b/samples/report/internal-links.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/report/multi-columns.svg b/samples/report/multi-columns.svg new file mode 100644 index 0000000..4f2f9f9 --- /dev/null +++ b/samples/report/multi-columns.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/report/report-cover.jpg b/samples/report/report-cover.jpg new file mode 100644 index 0000000..314630d Binary files /dev/null and b/samples/report/report-cover.jpg differ diff --git a/samples/report/report.css b/samples/report/report.css new file mode 100644 index 0000000..77dd1d9 --- /dev/null +++ b/samples/report/report.css @@ -0,0 +1,398 @@ +@font-face { + font-family: Fira Sans; + font-weight: 400; + src: url(firasans-regular.otf); +} +@font-face { + font-family: Fira Sans; + font-style: italic; + font-weight: 400; + src: url(firasans-italic.otf); +} +@font-face { + font-family: Fira Sans; + font-weight: 300; + src: url(firasans-light.otf); +} +@font-face { + font-family: Fira Sans; + font-style: italic; + font-weight: 300; + src: url(firasans-lightitalic.otf); +} +@font-face { + font-family: Fira Sans; + font-weight: 700; + src: url(firasans-bold.otf); +} + +@page { + @top-left { + background: #fbc847; + content: counter(page); + height: 1cm; + text-align: center; + width: 1cm; + } + @top-center { + background: #fbc847; + content: ''; + display: block; + height: .05cm; + opacity: .5; + width: 100%; + } + @top-right { + content: string(heading); + font-size: 9pt; + height: 1cm; + vertical-align: middle; + width: 100%; + } +} +@page :blank { + @top-left { background: none; content: '' } + @top-center { content: none } + @top-right { content: none } +} +@page no-chapter { + @top-left { background: none; content: none } + @top-center { content: none } + @top-right { content: none } +} +@page :first { + background: url(report-cover.jpg) no-repeat center; + background-size: cover; + margin: 0; +} +@page chapter { + background: #fbc847; + margin: 0; + @top-left { content: none } + @top-center { content: none } + @top-right { content: none } +} + +html { + color: #393939; + font-family: Fira Sans; + font-size: 11pt; + font-weight: 300; + line-height: 1.5; +} + +h1 { + color: #fbc847; + font-size: 38pt; + margin: 5cm 2cm 0 2cm; + page: no-chapter; + width: 100%; +} +h2, h3, h4 { + color: black; + font-weight: 400; +} +h2 { + break-before: always; + font-size: 28pt; + string-set: heading content(); +} +h3 { + font-weight: 300; + font-size: 15pt; +} +h4 { + font-size: 13pt; +} + +#cover { + align-content: space-between; + display: flex; + flex-wrap: wrap; + height: 297mm; +} +#cover address { + background: #fbc847; + flex: 1 50%; + margin: 0 -2cm; + padding: 1cm 0; + white-space: pre-wrap; +} +#cover address:first-of-type { + padding-left: 3cm; +} +#contents { + break-before: right; + break-after: left; + page: no-chapter; +} +#contents h2 { + font-size: 20pt; + font-weight: 400; + margin-bottom: 3cm; +} +#contents h3 { + font-weight: 500; + margin: 3em 0 1em; +} +#contents h3::before { + background: #fbc847; + content: ''; + display: block; + height: .08cm; + margin-bottom: .25cm; + width: 2cm; +} +#contents ul { + list-style: none; + padding-left: 0; +} +#contents ul li { + border-top: .25pt solid #c1c1c1; + margin: .25cm 0; + padding-top: .25cm; +} +#contents ul li::before { + color: #fbc847; + content: '• '; + font-size: 40pt; + line-height: 16pt; + vertical-align: bottom; +} +#contents ul li a { + color: inherit; + text-decoration-line: inherit; +} +#contents ul li a::before { + content: target-text(attr(href)); +} +#contents ul li a::after { + color: #fbc847; + content: target-counter(attr(href), page); + float: right; +} + +#columns section { + columns: 2; + column-gap: 1cm; + padding-top: 1cm; +} +#columns section p { + text-align: justify; +} +#columns section p:first-of-type { + font-weight: 700; +} + +#skills h3 { + background: #fbc847; + margin: 0 -3cm 1cm; + padding: 1cm 1cm 1cm 3cm; + width: 21cm; +} +#skills section { + padding: .5cm 0; +} +#skills section#table-content::before { + background: url(table-content.svg) no-repeat center #fbc847; + background-size: 50%; + content: ''; + display: inline-block; + float: left; + height: 2cm; + margin-right: .5cm; + vertical-align: middle; + width: 2cm; +} +#skills section#heading::before { + background: url(heading.svg) no-repeat center #fbc847; + background-size: 50%; + content: ''; + display: inline-block; + float: left; + height: 2cm; + margin-right: .5cm; + vertical-align: middle; + width: 2cm; +} +#skills section#multi-columns::before { + background: url(multi-columns.svg) no-repeat center #fbc847; + background-size: 50%; + content: ''; + display: inline-block; + float: left; + height: 2cm; + margin-right: .5cm; + vertical-align: middle; + width: 2cm; +} +#skills section#internal-links::before { + background: url(internal-links.svg) no-repeat center #fbc847; + background-size: 50%; + content: ''; + display: inline-block; + float: left; + height: 2cm; + margin-right: .5cm; + vertical-align: middle; + width: 2cm; +} +#skills section#style::before { + background: url(style.svg) no-repeat center #fbc847; + background-size: 50%; + content: ''; + display: inline-block; + float: left; + height: 2cm; + margin-right: .5cm; + vertical-align: middle; + width: 2cm; +} +#skills section h4 { + margin: 0; +} +#skills section p { + margin-top: 0; +} + +#offers { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +#offers h2, #offers h3 { + width: 100%; +} +#offers section { + width: 30%; +} +#offers section h4 { + margin-bottom: 0; +} +#offers section ul { + list-style: none; + margin: 0; + padding-left: 0; +} +#offers section ul li:not(:last-of-type) { + margin: .5cm 0; +} +#offers section p { + background: #fbc847; + display: block; + font-size: 15pt; + font-weight: 700; + margin-bottom: 0; + padding: .25cm 0; + text-align: center; +} + +#chapter { + align-items: center; + display: flex; + height: 297mm; + justify-content: center; + page: chapter; +} + +#typography section { + display: flex; + flex-wrap: wrap; + margin: 1cm 0; +} +#typography section h4 { + border-top: 1pt solid; + flex: 1 25%; + margin: 0; +} +#typography section h4 + * { + flex: 1 75%; + margin: 0; + padding-left: .5cm; +} +#typography section p { + text-align: justify; +} +#typography section ul { + line-height: 2; + list-style: none; +} +#typography section#small-caps p { + font-variant: small-caps; +} +#typography section#ligatures dl { + display: flex; + flex-wrap: wrap; +} +#typography section#ligatures dl dt { + font-weight: 400; + width: 30%; +} +#typography section#ligatures dl dd { + flex: 1 70%; + margin: 0; + padding: 0; +} +#typography section#ligatures .none { + font-variant-ligatures: none; +} +#typography section#ligatures .common { + font-variant-ligatures: common-ligatures; +} +#typography section#ligatures .discretionary { + font-variant-ligatures: discretionary-ligatures; +} +#typography section#ligatures .contextual { + font-variant-ligatures: contextual; +} +#typography section#numbers dl { + display: flex; + flex-wrap: wrap; +} +#typography section#numbers dl dt { + font-weight: 400; + width: 30%; +} +#typography section#numbers dl dd { + flex: 1 70%; + margin: 0; + padding: 0; +} +#typography section#numbers #fractions { + font-variant-numeric: diagonal-fractions; +} +#typography section#numbers #ordinals { + font-variant-numeric: ordinal; +} +#typography section#numbers #slashed { + font-variant-numeric: slashed-zero; +} +#typography section#numbers #super { + font-variant-position: super; +} +#typography section#numbers #sub { + font-variant-position: sub; +} +#typography section#figures dl { + columns: 4; +} +#typography section#figures dl dt { + font-weight: 400; +} +#typography section#figures dl dd { + display: flex; + margin: 0; + padding: 0; +} +#typography section#figures dl dd ul { + padding: 0 1em 0 0; +} +#typography section#figures #oldstyle { + font-variant-numeric: oldstyle-nums; +} +#typography section#figures #tabular { + font-variant-numeric: tabular-nums; +} +#typography section#figures #old-tabular { + font-variant-numeric: oldstyle-nums tabular-nums; +} diff --git a/samples/report/report.pdf b/samples/report/report.pdf new file mode 100644 index 0000000..b8032a2 Binary files /dev/null and b/samples/report/report.pdf differ diff --git a/samples/report/style.svg b/samples/report/style.svg new file mode 100644 index 0000000..3930090 --- /dev/null +++ b/samples/report/style.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/report/table-content.svg b/samples/report/table-content.svg new file mode 100644 index 0000000..9961a20 --- /dev/null +++ b/samples/report/table-content.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/samples/report/thumbnail.png b/samples/report/thumbnail.png new file mode 100644 index 0000000..b847aaa Binary files /dev/null and b/samples/report/thumbnail.png differ