diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-10 17:08:42 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-10 17:08:42 +0200 |
commit | 11b5e74022461308da506f63f3e1902a64e5496a (patch) | |
tree | b378a1931666e7e1381aee4e29984fa3fc6cef01 /src/ui/text.c | |
parent | be1b78651171e9a9386c9fbbf8b8aced2e8dbcac (diff) |
GmDocument: Links use a bold, tinted font
Links are important enough to stand out clearly. A bold font can be tinted with the primary theme color without losing readability.
Diffstat (limited to 'src/ui/text.c')
-rw-r--r-- | src/ui/text.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index d9ddf2b2..520ae74a 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -210,41 +210,48 @@ static void initFonts_Text_(iText *d) { | |||
210 | const float monoSize = textSize * 0.71f; | 210 | const float monoSize = textSize * 0.71f; |
211 | const float smallMonoSize = monoSize * 0.8f; | 211 | const float smallMonoSize = monoSize * 0.8f; |
212 | const iBlock *regularFont = &fontNunitoRegular_Embedded; | 212 | const iBlock *regularFont = &fontNunitoRegular_Embedded; |
213 | const iBlock *boldFont = &fontNunitoExtraBold_Embedded; | ||
213 | const iBlock *italicFont = &fontNunitoLightItalic_Embedded; | 214 | const iBlock *italicFont = &fontNunitoLightItalic_Embedded; |
214 | const iBlock *h12Font = &fontNunitoExtraBold_Embedded; | 215 | const iBlock *h12Font = &fontNunitoExtraBold_Embedded; |
215 | const iBlock *h3Font = &fontNunitoRegular_Embedded; | 216 | const iBlock *h3Font = &fontNunitoRegular_Embedded; |
216 | const iBlock *lightFont = &fontNunitoExtraLight_Embedded; | 217 | const iBlock *lightFont = &fontNunitoExtraLight_Embedded; |
217 | float scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ | 218 | float scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ |
219 | float italicScaling= 1.0f; | ||
218 | float lightScaling = 1.0f; | 220 | float lightScaling = 1.0f; |
219 | float h123Scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ | 221 | float h123Scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */ |
220 | if (d->contentFont == firaSans_TextFont) { | 222 | if (d->contentFont == firaSans_TextFont) { |
221 | regularFont = &fontFiraSansRegular_Embedded; | 223 | regularFont = &fontFiraSansRegular_Embedded; |
224 | boldFont = &fontFiraSansBold_Embedded; | ||
222 | lightFont = &fontFiraSansLight_Embedded; | 225 | lightFont = &fontFiraSansLight_Embedded; |
223 | italicFont = &fontFiraSansItalic_Embedded; | 226 | italicFont = &fontFiraSansItalic_Embedded; |
224 | scaling = lightScaling = 0.85f; | 227 | scaling = italicScaling = lightScaling = 0.85f; |
225 | } | 228 | } |
226 | else if (d->contentFont == tinos_TextFont) { | 229 | else if (d->contentFont == tinos_TextFont) { |
227 | regularFont = &fontTinosRegular_Embedded; | 230 | regularFont = &fontTinosRegular_Embedded; |
231 | boldFont = &fontTinosBold_Embedded; | ||
228 | lightFont = &fontLiterataExtraLightopsz18_Embedded; | 232 | lightFont = &fontLiterataExtraLightopsz18_Embedded; |
229 | italicFont = &fontTinosItalic_Embedded; | 233 | italicFont = &fontTinosItalic_Embedded; |
230 | scaling = 0.85f; | 234 | scaling = italicScaling = 0.85f; |
231 | } | 235 | } |
232 | else if (d->contentFont == literata_TextFont) { | 236 | else if (d->contentFont == literata_TextFont) { |
233 | regularFont = &fontLiterataRegularopsz14_Embedded; | 237 | regularFont = &fontLiterataRegularopsz14_Embedded; |
238 | boldFont = &fontLiterataBoldopsz36_Embedded; | ||
234 | italicFont = &fontLiterataLightItalicopsz10_Embedded; | 239 | italicFont = &fontLiterataLightItalicopsz10_Embedded; |
235 | lightFont = &fontLiterataExtraLightopsz18_Embedded; | 240 | lightFont = &fontLiterataExtraLightopsz18_Embedded; |
236 | } | 241 | } |
237 | else if (d->contentFont == sourceSansPro_TextFont) { | 242 | else if (d->contentFont == sourceSansPro_TextFont) { |
238 | regularFont = &fontSourceSansProRegular_Embedded; | 243 | regularFont = &fontSourceSansProRegular_Embedded; |
244 | boldFont = &fontSourceSansProBold_Embedded; | ||
239 | italicFont = &fontFiraSansItalic_Embedded; | 245 | italicFont = &fontFiraSansItalic_Embedded; |
240 | lightFont = &fontFiraSansLight_Embedded; | 246 | lightFont = &fontFiraSansLight_Embedded; |
241 | lightScaling = 0.85f; | 247 | lightScaling = italicScaling = 0.85f; |
242 | } | 248 | } |
243 | else if (d->contentFont == iosevka_TextFont) { | 249 | else if (d->contentFont == iosevka_TextFont) { |
244 | regularFont = &fontIosevkaTermExtended_Embedded; | 250 | regularFont = &fontIosevkaTermExtended_Embedded; |
251 | boldFont = &fontIosevkaTermExtended_Embedded; | ||
245 | italicFont = &fontIosevkaTermExtended_Embedded; | 252 | italicFont = &fontIosevkaTermExtended_Embedded; |
246 | lightFont = &fontIosevkaTermExtended_Embedded; | 253 | lightFont = &fontIosevkaTermExtended_Embedded; |
247 | scaling = lightScaling = 0.866f; | 254 | scaling = italicScaling = lightScaling = 0.866f; |
248 | } | 255 | } |
249 | if (d->headingFont == firaSans_TextFont) { | 256 | if (d->headingFont == firaSans_TextFont) { |
250 | h12Font = &fontFiraSansBold_Embedded; | 257 | h12Font = &fontFiraSansBold_Embedded; |
@@ -291,11 +298,12 @@ static void initFonts_Text_(iText *d) { | |||
291 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, | 298 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, |
292 | /* content fonts */ | 299 | /* content fonts */ |
293 | { regularFont, textSize, scaling, symbols_FontId }, | 300 | { regularFont, textSize, scaling, symbols_FontId }, |
301 | { boldFont, textSize, scaling, symbols_FontId }, | ||
294 | { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 302 | { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
295 | { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, | 303 | { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, |
296 | { regularFont, textSize * 1.200f, scaling, mediumSymbols_FontId }, | 304 | { regularFont, textSize * 1.200f, scaling, mediumSymbols_FontId }, |
297 | { h3Font, textSize * 1.333f, h123Scaling, bigSymbols_FontId }, | 305 | { h3Font, textSize * 1.333f, h123Scaling, bigSymbols_FontId }, |
298 | { italicFont, textSize, scaling, symbols_FontId }, | 306 | { italicFont, textSize, italicScaling,symbols_FontId }, |
299 | { h12Font, textSize * 1.666f, h123Scaling, largeSymbols_FontId }, | 307 | { h12Font, textSize * 1.666f, h123Scaling, largeSymbols_FontId }, |
300 | { h12Font, textSize * 2.000f, h123Scaling, hugeSymbols_FontId }, | 308 | { h12Font, textSize * 2.000f, h123Scaling, hugeSymbols_FontId }, |
301 | { lightFont, textSize * 1.666f, lightScaling, largeSymbols_FontId }, | 309 | { lightFont, textSize * 1.666f, lightScaling, largeSymbols_FontId }, |