]> Shamusworld >> Repos - ardour-manual/blob - source/css/pdf.css
Font improvement to the manual
[ardour-manual] / source / css / pdf.css
1 /* this stylesheet is used when generating a PDF */
2 /* define a page */
3 @page {
4    size: A4;
5    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
6 }
7
8 @font-face {
9     font-family: 'lora';
10     src: url('../css/Lora-Regular.ttf')  format('truetype');
11     font-weight: normal;
12     font-style: normal;
13 }
14
15 body {
16         font-family: 'lora';
17         font-size: 12px;
18 }
19
20 img {
21         max-width: 100%;
22 }
23
24 div.frontcover {
25         page-break-after: always;
26         margin: auto;
27         width: 80%;
28         font-size: 3em;
29         text-align: center;
30 }
31
32 .frontcover #generationdate {
33         font-size: .25em;
34         text-align: right;
35         bottom: 3cm;
36 }
37
38 /* styles for the right hand spread
39         Bottom left we display the title of the book, bottom right the page using a CSS
40   counter, top right the content of the current chapter
41 */
42 @page :right {
43    @bottom-left {
44        margin: 10pt 0 30pt 0;
45        /*border-top: .25pt solid #666;*/
46            content: "The Ardour Manual";
47        font-size: 7pt;
48        color: #333;
49    }
50    @bottom-right {
51        margin: 10pt 0 30pt 0;
52        /*border-top: .25pt solid #666;*/
53        content: counter(page);
54        font-size: 7pt;
55    }
56    @top-right {
57            content: string(doctitle);
58            margin: 30pt 0 10pt 0;
59            font-size: 7pt;
60            color: #333;
61    }
62 }
63
64 /* styles for the left hand spread
65         Bottom right book title, bottom left current page
66 */
67 @page :left {
68    @bottom-right {
69        margin: 10pt 0 30pt 0;
70        /*border-top: .25pt solid #666;*/
71            content: "The Ardour Manual";
72        font-size: 7pt;
73        color: #333;
74    }
75    @bottom-left {
76        margin: 10pt 0 30pt 0;
77        /*border-top: .25pt solid #666;*/
78        content: counter(page);
79        font-size: 7pt;
80    }
81 }
82
83 /* first page */
84 @page :first {
85   @bottom-right {
86     content: normal;
87     margin: 0;
88   }
89
90   @bottom-left {
91     content: normal;
92     margin: 0;
93   }
94 }
95
96 body {
97         counter-reset: partnum chapternum subchapternum figurenum; /* resets all counters */
98         /*font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;*/
99         font-size: 10pt;
100         line-height: 1.25em;
101
102 }
103
104 h1, h2 {
105   string-set: doctitle content(); /* get the title of the current chapter */
106   page-break-before: always;
107 }
108
109 #toc::before { /* the ToC should not count...*/
110   content: none;
111   counter-reset: partnum;
112   /*counter-increment: partnum -1;*/
113 }
114
115 h1::before { /* parts */
116         counter-increment: partnum;
117         content: "Part " counter(partnum) " - ";
118 }
119
120 h2::before {    /* chapter */
121         counter-increment: chapternum;
122         content: "Chapter " counter(chapternum) " - ";
123 }
124
125 h3::before {    /* subchapter */
126   counter-increment: subchapternum;
127   content: counter(chapternum) "." counter(subchapternum) " - " ;
128 }
129
130 figcaption::before {
131         counter-increment: figurenum;
132         content: "Fig. " counter(chapternum) "." counter(figurenum) " - ";
133 }
134
135 h1 { font-size: 3em; }
136 h2 { font-size: 2.25em; counter-reset: subchapternum figurenum; }
137 h3 { font-size: 1.75em; }
138 h4 { font-size: 1.4em; }
139 h5 { font-size: 1.2em; }
140 h6 { font-size: 1.1em; }
141
142 h1,h2,h3,h4,h5 {
143         font-weight: bold;
144         page-break-after: avoid;
145         page-break-inside: avoid;
146         line-height: 1.25em;
147 }
148
149 h1+p, h2+p, h3+p {
150         page-break-before: avoid;
151 }
152
153 table, figure {
154         page-break-inside: avoid;
155 }
156
157 td, th {
158         vertical-align: top;
159 }
160
161 ul.toc {
162         white-space: nowrap;
163         list-style: none;
164         margin: 0;
165         padding: 0;
166 }
167
168 /* create page numbers using target-counter in the TOC */
169 ul.toc a::after {
170   content: target-counter(attr(href), page);
171   float: right;
172 }
173
174 ul.toc li {
175         line-height: 2;
176 }
177
178 ul.toc li a {
179         text-decoration: none;
180 }
181
182 ol {
183         list-style-position: inside;
184 }
185
186 a {
187         color: #000;
188 }
189
190 /* add page number to cross references */
191 a[href^="#"]::after {
192   content: " (p. " target-counter(attr(href, url), page) ")";
193 }
194 a[href^="http"]::after {
195         content: " (" attr(href) ")";
196 }