diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-20 08:03:59 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-20 08:03:59 +0200 |
commit | 954dbbf9b5a5b881be3243e5e762f0dab33a5658 (patch) | |
tree | c93a1776ca83f950ca72d89e2b32e13c56fd4ffe | |
parent | f313aeb47bece406e324c68d8d3582836e93abbe (diff) |
Replaced EB Garamond with Tinos
Tinos is a much more readable serif font, especially when it comes to the italic variant.
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | res/about/help.gmi | 2 | ||||
-rw-r--r-- | res/about/license.gmi | 2 | ||||
-rw-r--r-- | res/fonts/EBGaramond-Bold.ttf | bin | 601316 -> 0 bytes | |||
-rw-r--r-- | res/fonts/EBGaramond-Italic.ttf | bin | 564280 -> 0 bytes | |||
-rw-r--r-- | res/fonts/EBGaramond-Regular.ttf | bin | 599076 -> 0 bytes | |||
-rw-r--r-- | res/fonts/LICENSE_EBGaramond.txt | 93 | ||||
-rw-r--r-- | res/fonts/Tinos-Bold.ttf | bin | 0 -> 431016 bytes | |||
-rw-r--r-- | res/fonts/Tinos-Italic.ttf | bin | 0 -> 435536 bytes | |||
-rw-r--r-- | res/fonts/Tinos-Regular.ttf | bin | 0 -> 454360 bytes | |||
-rw-r--r-- | src/ui/text.c | 51 | ||||
-rw-r--r-- | src/ui/text.h | 2 | ||||
-rw-r--r-- | src/ui/util.c | 2 |
13 files changed, 34 insertions, 124 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e7707f..1b52f242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -57,9 +57,9 @@ set (EMBED_RESOURCES | |||
57 | res/about/lagrange.gmi | 57 | res/about/lagrange.gmi |
58 | res/about/license.gmi | 58 | res/about/license.gmi |
59 | res/about/version.gmi | 59 | res/about/version.gmi |
60 | res/fonts/EBGaramond-Regular.ttf | 60 | res/fonts/Tinos-Regular.ttf |
61 | res/fonts/EBGaramond-Italic.ttf | 61 | res/fonts/Tinos-Italic.ttf |
62 | res/fonts/EBGaramond-Bold.ttf | 62 | res/fonts/Tinos-Bold.ttf |
63 | res/fonts/FiraMono-Regular.ttf | 63 | res/fonts/FiraMono-Regular.ttf |
64 | res/fonts/FiraSans-Bold.ttf | 64 | res/fonts/FiraSans-Bold.ttf |
65 | res/fonts/FiraSans-Italic.ttf | 65 | res/fonts/FiraSans-Italic.ttf |
diff --git a/res/about/help.gmi b/res/about/help.gmi index f0495c2c..af3b06be 100644 --- a/res/about/help.gmi +++ b/res/about/help.gmi | |||
@@ -215,7 +215,7 @@ There are two sans-serif and two serif fonts: | |||
215 | * "Nunito" is a friendly rounded sans-serif font. | 215 | * "Nunito" is a friendly rounded sans-serif font. |
216 | * "Fira Sans" is a bolder, narrower, and more angular sans-serif font. | 216 | * "Fira Sans" is a bolder, narrower, and more angular sans-serif font. |
217 | * "Literata" is a heavy and serious serif font. | 217 | * "Literata" is a heavy and serious serif font. |
218 | * "EB Garamond" is a lighter and more decorative serif font. You may find it more readable on light backgrounds. | 218 | * "Tinos" is a lighter serif font. |
219 | 219 | ||
220 | Other style options: | 220 | Other style options: |
221 | 221 | ||
diff --git a/res/about/license.gmi b/res/about/license.gmi index 96ca4ddd..0ea0897a 100644 --- a/res/about/license.gmi +++ b/res/about/license.gmi | |||
@@ -100,7 +100,6 @@ The libunistring library is covered by the GNU Lesser General Public License (LG | |||
100 | 100 | ||
101 | This application uses fonts licensed under the Open Font License. | 101 | This application uses fonts licensed under the Open Font License. |
102 | 102 | ||
103 | => https://fonts.google.com/specimen/EB+Garamond#license EB Garamond | ||
104 | => https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono | 103 | => https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono |
105 | => https://github.com/googlefonts/literata/blob/master/OFL.txt Literata | 104 | => https://github.com/googlefonts/literata/blob/master/OFL.txt Literata |
106 | => https://github.com/google/fonts/blob/master/ofl/nanumgothic/OFL.txt Nanum Gothic | 105 | => https://github.com/google/fonts/blob/master/ofl/nanumgothic/OFL.txt Nanum Gothic |
@@ -112,3 +111,4 @@ Additional fonts: | |||
112 | 111 | ||
113 | => https://github.com/googlefonts/noto-emoji/blob/master/LICENSE Noto Emoji (Apache License 2.0) | 112 | => https://github.com/googlefonts/noto-emoji/blob/master/LICENSE Noto Emoji (Apache License 2.0) |
114 | => https://dn-works.com/ufas/ Symbola (Public Domain) | 113 | => https://dn-works.com/ufas/ Symbola (Public Domain) |
114 | => https://fonts.google.com/specimen/Tinos#license Tinos (Apache License 2.0) | ||
diff --git a/res/fonts/EBGaramond-Bold.ttf b/res/fonts/EBGaramond-Bold.ttf deleted file mode 100644 index f380a1c3..00000000 --- a/res/fonts/EBGaramond-Bold.ttf +++ /dev/null | |||
Binary files differ | |||
diff --git a/res/fonts/EBGaramond-Italic.ttf b/res/fonts/EBGaramond-Italic.ttf deleted file mode 100644 index a7201b00..00000000 --- a/res/fonts/EBGaramond-Italic.ttf +++ /dev/null | |||
Binary files differ | |||
diff --git a/res/fonts/EBGaramond-Regular.ttf b/res/fonts/EBGaramond-Regular.ttf deleted file mode 100644 index f57146c9..00000000 --- a/res/fonts/EBGaramond-Regular.ttf +++ /dev/null | |||
Binary files differ | |||
diff --git a/res/fonts/LICENSE_EBGaramond.txt b/res/fonts/LICENSE_EBGaramond.txt deleted file mode 100644 index 1fb3e844..00000000 --- a/res/fonts/LICENSE_EBGaramond.txt +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | Copyright 2017 The EB Garamond Project Authors (https://github.com/octaviopardo/EBGaramond12) | ||
2 | |||
3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. | ||
4 | This license is copied below, and is also available with a FAQ at: | ||
5 | http://scripts.sil.org/OFL | ||
6 | |||
7 | |||
8 | ----------------------------------------------------------- | ||
9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 | ||
10 | ----------------------------------------------------------- | ||
11 | |||
12 | PREAMBLE | ||
13 | The goals of the Open Font License (OFL) are to stimulate worldwide | ||
14 | development of collaborative font projects, to support the font creation | ||
15 | efforts of academic and linguistic communities, and to provide a free and | ||
16 | open framework in which fonts may be shared and improved in partnership | ||
17 | with others. | ||
18 | |||
19 | The OFL allows the licensed fonts to be used, studied, modified and | ||
20 | redistributed freely as long as they are not sold by themselves. The | ||
21 | fonts, including any derivative works, can be bundled, embedded, | ||
22 | redistributed and/or sold with any software provided that any reserved | ||
23 | names are not used by derivative works. The fonts and derivatives, | ||
24 | however, cannot be released under any other type of license. The | ||
25 | requirement for fonts to remain under this license does not apply | ||
26 | to any document created using the fonts or their derivatives. | ||
27 | |||
28 | DEFINITIONS | ||
29 | "Font Software" refers to the set of files released by the Copyright | ||
30 | Holder(s) under this license and clearly marked as such. This may | ||
31 | include source files, build scripts and documentation. | ||
32 | |||
33 | "Reserved Font Name" refers to any names specified as such after the | ||
34 | copyright statement(s). | ||
35 | |||
36 | "Original Version" refers to the collection of Font Software components as | ||
37 | distributed by the Copyright Holder(s). | ||
38 | |||
39 | "Modified Version" refers to any derivative made by adding to, deleting, | ||
40 | or substituting -- in part or in whole -- any of the components of the | ||
41 | Original Version, by changing formats or by porting the Font Software to a | ||
42 | new environment. | ||
43 | |||
44 | "Author" refers to any designer, engineer, programmer, technical | ||
45 | writer or other person who contributed to the Font Software. | ||
46 | |||
47 | PERMISSION & CONDITIONS | ||
48 | Permission is hereby granted, free of charge, to any person obtaining | ||
49 | a copy of the Font Software, to use, study, copy, merge, embed, modify, | ||
50 | redistribute, and sell modified and unmodified copies of the Font | ||
51 | Software, subject to the following conditions: | ||
52 | |||
53 | 1) Neither the Font Software nor any of its individual components, | ||
54 | in Original or Modified Versions, may be sold by itself. | ||
55 | |||
56 | 2) Original or Modified Versions of the Font Software may be bundled, | ||
57 | redistributed and/or sold with any software, provided that each copy | ||
58 | contains the above copyright notice and this license. These can be | ||
59 | included either as stand-alone text files, human-readable headers or | ||
60 | in the appropriate machine-readable metadata fields within text or | ||
61 | binary files as long as those fields can be easily viewed by the user. | ||
62 | |||
63 | 3) No Modified Version of the Font Software may use the Reserved Font | ||
64 | Name(s) unless explicit written permission is granted by the corresponding | ||
65 | Copyright Holder. This restriction only applies to the primary font name as | ||
66 | presented to the users. | ||
67 | |||
68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font | ||
69 | Software shall not be used to promote, endorse or advertise any | ||
70 | Modified Version, except to acknowledge the contribution(s) of the | ||
71 | Copyright Holder(s) and the Author(s) or with their explicit written | ||
72 | permission. | ||
73 | |||
74 | 5) The Font Software, modified or unmodified, in part or in whole, | ||
75 | must be distributed entirely under this license, and must not be | ||
76 | distributed under any other license. The requirement for fonts to | ||
77 | remain under this license does not apply to any document created | ||
78 | using the Font Software. | ||
79 | |||
80 | TERMINATION | ||
81 | This license becomes null and void if any of the above conditions are | ||
82 | not met. | ||
83 | |||
84 | DISCLAIMER | ||
85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | ||
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | ||
88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE | ||
89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | ||
91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | ||
93 | OTHER DEALINGS IN THE FONT SOFTWARE. | ||
diff --git a/res/fonts/Tinos-Bold.ttf b/res/fonts/Tinos-Bold.ttf new file mode 100644 index 00000000..8b850691 --- /dev/null +++ b/res/fonts/Tinos-Bold.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/Tinos-Italic.ttf b/res/fonts/Tinos-Italic.ttf new file mode 100644 index 00000000..54b1f4d5 --- /dev/null +++ b/res/fonts/Tinos-Italic.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/Tinos-Regular.ttf b/res/fonts/Tinos-Regular.ttf new file mode 100644 index 00000000..823f7273 --- /dev/null +++ b/res/fonts/Tinos-Regular.ttf | |||
Binary files differ | |||
diff --git a/src/ui/text.c b/src/ui/text.c index 8b3badb4..c241c66b 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -165,23 +165,25 @@ static iText text_; | |||
165 | static void initFonts_Text_(iText *d) { | 165 | static void initFonts_Text_(iText *d) { |
166 | const float textSize = fontSize_UI * d->contentFontSize; | 166 | const float textSize = fontSize_UI * d->contentFontSize; |
167 | const float monoSize = fontSize_UI * d->contentFontSize / contentScale_Text_ * 0.866f; | 167 | const float monoSize = fontSize_UI * d->contentFontSize / contentScale_Text_ * 0.866f; |
168 | const iBlock *regularFont = &fontNunitoRegular_Embedded; | 168 | const iBlock *regularFont = &fontNunitoRegular_Embedded; |
169 | const iBlock *italicFont = &fontNunitoLightItalic_Embedded; | 169 | const iBlock *italicFont = &fontNunitoLightItalic_Embedded; |
170 | const iBlock *h12Font = &fontNunitoExtraBold_Embedded; | 170 | const iBlock *h12Font = &fontNunitoExtraBold_Embedded; |
171 | const iBlock *h3Font = &fontNunitoRegular_Embedded; | 171 | const iBlock *h3Font = &fontNunitoRegular_Embedded; |
172 | const iBlock *lightFont = &fontNunitoExtraLight_Embedded; | 172 | const iBlock *lightFont = &fontNunitoExtraLight_Embedded; |
173 | float scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ | 173 | float scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ |
174 | float h123Scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ | 174 | float lightScaling = 1.0f; |
175 | float h123Scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ | ||
175 | if (d->contentFont == firaSans_TextFont) { | 176 | if (d->contentFont == firaSans_TextFont) { |
176 | regularFont = &fontFiraSansRegular_Embedded; | 177 | regularFont = &fontFiraSansRegular_Embedded; |
177 | lightFont = &fontFiraSansLight_Embedded; | 178 | lightFont = &fontFiraSansLight_Embedded; |
178 | italicFont = &fontFiraSansItalic_Embedded; | 179 | italicFont = &fontFiraSansItalic_Embedded; |
179 | scaling = 0.85f; | 180 | scaling = lightScaling = 0.85f; |
180 | } | 181 | } |
181 | else if (d->contentFont == ebGaramond_TextFont) { | 182 | else if (d->contentFont == tinos_TextFont) { |
182 | regularFont = &fontEBGaramondRegular_Embedded; | 183 | regularFont = &fontTinosRegular_Embedded; |
183 | lightFont = &fontEBGaramondRegular_Embedded; | 184 | lightFont = &fontLiterataExtraLightopsz18_Embedded; |
184 | italicFont = &fontEBGaramondItalic_Embedded; | 185 | italicFont = &fontTinosItalic_Embedded; |
186 | scaling = 0.85f; | ||
185 | } | 187 | } |
186 | else if (d->contentFont == literata_TextFont) { | 188 | else if (d->contentFont == literata_TextFont) { |
187 | regularFont = &fontLiterataRegularopsz14_Embedded; | 189 | regularFont = &fontLiterataRegularopsz14_Embedded; |
@@ -193,9 +195,10 @@ static void initFonts_Text_(iText *d) { | |||
193 | h3Font = &fontFiraSansRegular_Embedded; | 195 | h3Font = &fontFiraSansRegular_Embedded; |
194 | h123Scaling = 0.85f; | 196 | h123Scaling = 0.85f; |
195 | } | 197 | } |
196 | else if (d->headingFont == ebGaramond_TextFont) { | 198 | else if (d->headingFont == tinos_TextFont) { |
197 | h12Font = &fontEBGaramondBold_Embedded; | 199 | h12Font = &fontTinosBold_Embedded; |
198 | h3Font = &fontEBGaramondRegular_Embedded; | 200 | h3Font = &fontTinosRegular_Embedded; |
201 | h123Scaling = 0.85f; | ||
199 | } | 202 | } |
200 | else if (d->headingFont == literata_TextFont) { | 203 | else if (d->headingFont == literata_TextFont) { |
201 | h12Font = &fontLiterataBoldopsz36_Embedded; | 204 | h12Font = &fontLiterataBoldopsz36_Embedded; |
@@ -213,15 +216,15 @@ static void initFonts_Text_(iText *d) { | |||
213 | { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId }, | 216 | { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId }, |
214 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, | 217 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, |
215 | /* content fonts */ | 218 | /* content fonts */ |
216 | { regularFont, textSize, scaling, symbols_FontId }, | 219 | { regularFont, textSize, scaling, symbols_FontId }, |
217 | { &fontFiraMonoRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 220 | { &fontFiraMonoRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
218 | { &fontFiraMonoRegular_Embedded, monoSize * 0.750f, 1.0f, monospaceSmallSymbols_FontId }, | 221 | { &fontFiraMonoRegular_Embedded, monoSize * 0.750f, 1.0f, monospaceSmallSymbols_FontId }, |
219 | { regularFont, textSize * 1.200f, scaling, mediumSymbols_FontId }, | 222 | { regularFont, textSize * 1.200f, scaling, mediumSymbols_FontId }, |
220 | { h3Font, textSize * 1.333f, scaling, bigSymbols_FontId }, | 223 | { h3Font, textSize * 1.333f, scaling, bigSymbols_FontId }, |
221 | { italicFont, textSize, scaling, symbols_FontId }, | 224 | { italicFont, textSize, scaling, symbols_FontId }, |
222 | { h12Font, textSize * 1.666f, h123Scaling, largeSymbols_FontId }, | 225 | { h12Font, textSize * 1.666f, h123Scaling, largeSymbols_FontId }, |
223 | { h12Font, textSize * 2.000f, h123Scaling, hugeSymbols_FontId }, | 226 | { h12Font, textSize * 2.000f, h123Scaling, hugeSymbols_FontId }, |
224 | { lightFont, textSize * 1.666f, scaling, largeSymbols_FontId }, | 227 | { lightFont, textSize * 1.666f, lightScaling, largeSymbols_FontId }, |
225 | /* monospace content fonts */ | 228 | /* monospace content fonts */ |
226 | { &fontFiraMonoRegular_Embedded, textSize, 0.8f, symbols_FontId }, | 229 | { &fontFiraMonoRegular_Embedded, textSize, 0.8f, symbols_FontId }, |
227 | /* symbol fonts */ | 230 | /* symbol fonts */ |
diff --git a/src/ui/text.h b/src/ui/text.h index e95b75d2..5bae8e2a 100644 --- a/src/ui/text.h +++ b/src/ui/text.h | |||
@@ -124,7 +124,7 @@ enum iTextFont { | |||
124 | nunito_TextFont, | 124 | nunito_TextFont, |
125 | firaSans_TextFont, | 125 | firaSans_TextFont, |
126 | literata_TextFont, | 126 | literata_TextFont, |
127 | ebGaramond_TextFont, | 127 | tinos_TextFont, |
128 | }; | 128 | }; |
129 | 129 | ||
130 | extern int gap_Text; /* affected by content font size */ | 130 | extern int gap_Text; /* affected by content font size */ |
diff --git a/src/ui/util.c b/src/ui/util.c index 9ac18881..bdb348f9 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -987,7 +987,7 @@ static void addRadioButton_(iWidget *parent, const char *id, const char *label, | |||
987 | 987 | ||
988 | static void addFontButtons_(iWidget *parent, const char *id) { | 988 | static void addFontButtons_(iWidget *parent, const char *id) { |
989 | const char *fontNames[] = { | 989 | const char *fontNames[] = { |
990 | "Nunito", "Fira Sans", "Literata", "EB Garamond" | 990 | "Nunito", "Fira Sans", "Literata", "Tinos" |
991 | }; | 991 | }; |
992 | iForIndices(i, fontNames) { | 992 | iForIndices(i, fontNames) { |
993 | addRadioButton_(parent, | 993 | addRadioButton_(parent, |