summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-20 08:03:59 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-20 08:03:59 +0200
commit954dbbf9b5a5b881be3243e5e762f0dab33a5658 (patch)
treec93a1776ca83f950ca72d89e2b32e13c56fd4ffe /src/ui
parentf313aeb47bece406e324c68d8d3582836e93abbe (diff)
Replaced EB Garamond with Tinos
Tinos is a much more readable serif font, especially when it comes to the italic variant.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/text.c51
-rw-r--r--src/ui/text.h2
-rw-r--r--src/ui/util.c2
3 files changed, 29 insertions, 26 deletions
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_;
165static void initFonts_Text_(iText *d) { 165static 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
130extern int gap_Text; /* affected by content font size */ 130extern 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
988static void addFontButtons_(iWidget *parent, const char *id) { 988static 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,