summaryrefslogtreecommitdiff
path: root/src/ui/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/text.c')
-rw-r--r--src/ui/text.c51
1 files changed, 27 insertions, 24 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 */