summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-13 13:50:28 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-13 13:50:28 +0300
commit488dcbf40df6bf80b1042d5234b60ee2973b2818 (patch)
tree0b0e0aa10e14c9bd6220bfac2d80b5bb158906e2 /src/ui
parente3a20607304e4933db283a6c78e614c472c95b9b (diff)
Updated the UI fonts to Source Sans 3
A new version of the typeface, now with all font variations needed for page content as well.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/text.c31
-rw-r--r--src/ui/util.c4
2 files changed, 17 insertions, 18 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index bb446440..9232bce2 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -252,11 +252,10 @@ static void initFonts_Text_(iText *d) {
252 lightFont = &fontLiterataExtraLightopsz18_Embedded; 252 lightFont = &fontLiterataExtraLightopsz18_Embedded;
253 } 253 }
254 else if (d->contentFont == sourceSansPro_TextFont) { 254 else if (d->contentFont == sourceSansPro_TextFont) {
255 regularFont = &fontSourceSansProRegular_Embedded; 255 regularFont = &fontSourceSans3Regular_Embedded;
256 boldFont = &fontSourceSansProBold_Embedded; 256 boldFont = &fontSourceSans3Semibold_Embedded;
257 italicFont = &fontFiraSansItalic_Embedded; 257 italicFont = &fontSourceSans3It_Embedded;
258 lightFont = &fontFiraSansLight_Embedded; 258 lightFont = &fontSourceSans3ExtraLight_Embedded;
259 lightScaling = italicScaling = 0.85f;
260 } 259 }
261 else if (d->contentFont == iosevka_TextFont) { 260 else if (d->contentFont == iosevka_TextFont) {
262 regularFont = &fontIosevkaTermExtended_Embedded; 261 regularFont = &fontIosevkaTermExtended_Embedded;
@@ -280,8 +279,8 @@ static void initFonts_Text_(iText *d) {
280 h3Font = &fontLiterataRegularopsz14_Embedded; 279 h3Font = &fontLiterataRegularopsz14_Embedded;
281 } 280 }
282 else if (d->headingFont == sourceSansPro_TextFont) { 281 else if (d->headingFont == sourceSansPro_TextFont) {
283 h12Font = &fontSourceSansProBold_Embedded; 282 h12Font = &fontSourceSans3Bold_Embedded;
284 h3Font = &fontSourceSansProRegular_Embedded; 283 h3Font = &fontSourceSans3Regular_Embedded;
285 } 284 }
286 else if (d->headingFont == iosevka_TextFont) { 285 else if (d->headingFont == iosevka_TextFont) {
287 h12Font = &fontIosevkaTermExtended_Embedded; 286 h12Font = &fontIosevkaTermExtended_Embedded;
@@ -301,15 +300,15 @@ static void initFonts_Text_(iText *d) {
301 /* Content sizes: smallmono, mono, 1.0, 1.2, 1.333, 1.666, 2.0 */ 300 /* Content sizes: smallmono, mono, 1.0, 1.2, 1.333, 1.666, 2.0 */
302 } fontData[max_FontId] = { 301 } fontData[max_FontId] = {
303 /* UI fonts: normal weight */ 302 /* UI fonts: normal weight */
304 { &fontSourceSansProRegular_Embedded, uiSize, 1.0f, uiNormal_FontSize }, 303 { &fontSourceSans3Regular_Embedded, uiSize, 1.0f, uiNormal_FontSize },
305 { &fontSourceSansProRegular_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, 304 { &fontSourceSans3Regular_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize },
306 { &fontSourceSansProRegular_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, 305 { &fontSourceSans3Regular_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize },
307 { &fontSourceSansProRegular_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, 306 { &fontSourceSans3Regular_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize },
308 /* UI fonts: bold weight */ 307 /* UI fonts: bold weight */
309 { &fontSourceSansProBold_Embedded, uiSize, 1.0f, uiNormal_FontSize }, 308 { &fontSourceSans3Bold_Embedded, uiSize, 1.0f, uiNormal_FontSize },
310 { &fontSourceSansProBold_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, 309 { &fontSourceSans3Bold_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize },
311 { &fontSourceSansProBold_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, 310 { &fontSourceSans3Bold_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize },
312 { &fontSourceSansProBold_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, 311 { &fontSourceSans3Bold_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize },
313 /* content fonts */ 312 /* content fonts */
314 { regularFont, textSize, scaling, contentRegular_FontSize }, 313 { regularFont, textSize, scaling, contentRegular_FontSize },
315 { boldFont, textSize, scaling, contentRegular_FontSize }, 314 { boldFont, textSize, scaling, contentRegular_FontSize },
@@ -322,7 +321,7 @@ static void initFonts_Text_(iText *d) {
322 { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, contentMonoSmall_FontSize }, 321 { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, contentMonoSmall_FontSize },
323 { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, contentMono_FontSize }, 322 { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, contentMono_FontSize },
324 /* extra content fonts */ 323 /* extra content fonts */
325 { &fontSourceSansProRegular_Embedded, textSize, scaling, contentRegular_FontSize }, 324 { &fontSourceSans3Regular_Embedded, textSize, scaling, contentRegular_FontSize },
326 { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, contentRegular_FontSize }, 325 { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, contentRegular_FontSize },
327 /* symbols and scripts */ 326 /* symbols and scripts */
328#define DEFINE_FONT_SET(data) \ 327#define DEFINE_FONT_SET(data) \
diff --git a/src/ui/util.c b/src/ui/util.c
index f430ac1c..e410ded1 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1902,14 +1902,14 @@ static void addRadioButton_(iWidget *parent, const char *id, const char *label,
1902 1902
1903static void addFontButtons_(iWidget *parent, const char *id) { 1903static void addFontButtons_(iWidget *parent, const char *id) {
1904 const char *fontNames[] = { 1904 const char *fontNames[] = {
1905 "Nunito", "Fira Sans", "Literata", "Tinos", "Source Sans Pro", "Iosevka" 1905 "Nunito", "Fira Sans", "Literata", "Tinos", "Source Sans 3", "Iosevka"
1906 }; 1906 };
1907 iArray *items = new_Array(sizeof(iMenuItem)); 1907 iArray *items = new_Array(sizeof(iMenuItem));
1908 iForIndices(i, fontNames) { 1908 iForIndices(i, fontNames) {
1909 pushBack_Array(items, 1909 pushBack_Array(items,
1910 &(iMenuItem){ fontNames[i], 0, 0, format_CStr("!%s.set arg:%d", id, i) }); 1910 &(iMenuItem){ fontNames[i], 0, 0, format_CStr("!%s.set arg:%d", id, i) });
1911 } 1911 }
1912 iLabelWidget *button = makeMenuButton_LabelWidget("Source Sans Pro", data_Array(items), size_Array(items)); 1912 iLabelWidget *button = makeMenuButton_LabelWidget("Source Sans 3", data_Array(items), size_Array(items));
1913 setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), uiBackgroundMenu_ColorId); 1913 setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), uiBackgroundMenu_ColorId);
1914 setId_Widget(as_Widget(button), format_CStr("prefs.%s", id)); 1914 setId_Widget(as_Widget(button), format_CStr("prefs.%s", id));
1915 addChildFlags_Widget(parent, iClob(button), alignLeft_WidgetFlag); 1915 addChildFlags_Widget(parent, iClob(button), alignLeft_WidgetFlag);