From 488dcbf40df6bf80b1042d5234b60ee2973b2818 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 13 Apr 2021 13:50:28 +0300 Subject: 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. --- CMakeLists.txt | 7 +++++-- res/fonts/SourceSans3-Bold.ttf | Bin 0 -> 298256 bytes res/fonts/SourceSans3-ExtraLight.ttf | Bin 0 -> 293932 bytes res/fonts/SourceSans3-It.ttf | Bin 0 -> 214992 bytes res/fonts/SourceSans3-Regular.ttf | Bin 0 -> 299252 bytes res/fonts/SourceSans3-Semibold.ttf | Bin 0 -> 298888 bytes res/fonts/SourceSansPro-Bold.ttf | Bin 288712 -> 0 bytes res/fonts/SourceSansPro-Regular.ttf | Bin 290156 -> 0 bytes src/ui/text.c | 31 +++++++++++++++---------------- src/ui/util.c | 4 ++-- 10 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 res/fonts/SourceSans3-Bold.ttf create mode 100644 res/fonts/SourceSans3-ExtraLight.ttf create mode 100644 res/fonts/SourceSans3-It.ttf create mode 100644 res/fonts/SourceSans3-Regular.ttf create mode 100644 res/fonts/SourceSans3-Semibold.ttf delete mode 100644 res/fonts/SourceSansPro-Bold.ttf delete mode 100644 res/fonts/SourceSansPro-Regular.ttf diff --git a/CMakeLists.txt b/CMakeLists.txt index 3477eb6a..6b89a89d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,11 @@ set (EMBED_RESOURCES res/fonts/Nunito-ExtraLight.ttf res/fonts/Nunito-LightItalic.ttf res/fonts/Nunito-Regular.ttf - res/fonts/SourceSansPro-Regular.ttf - res/fonts/SourceSansPro-Bold.ttf + res/fonts/SourceSans3-Bold.ttf + res/fonts/SourceSans3-ExtraLight.ttf + res/fonts/SourceSans3-It.ttf + res/fonts/SourceSans3-Regular.ttf + res/fonts/SourceSans3-Semibold.ttf res/fonts/Symbola.ttf res/lang/de.bin res/lang/en.bin diff --git a/res/fonts/SourceSans3-Bold.ttf b/res/fonts/SourceSans3-Bold.ttf new file mode 100644 index 00000000..486ede63 Binary files /dev/null and b/res/fonts/SourceSans3-Bold.ttf differ diff --git a/res/fonts/SourceSans3-ExtraLight.ttf b/res/fonts/SourceSans3-ExtraLight.ttf new file mode 100644 index 00000000..53e1541c Binary files /dev/null and b/res/fonts/SourceSans3-ExtraLight.ttf differ diff --git a/res/fonts/SourceSans3-It.ttf b/res/fonts/SourceSans3-It.ttf new file mode 100644 index 00000000..9823601c Binary files /dev/null and b/res/fonts/SourceSans3-It.ttf differ diff --git a/res/fonts/SourceSans3-Regular.ttf b/res/fonts/SourceSans3-Regular.ttf new file mode 100644 index 00000000..f6d31e8c Binary files /dev/null and b/res/fonts/SourceSans3-Regular.ttf differ diff --git a/res/fonts/SourceSans3-Semibold.ttf b/res/fonts/SourceSans3-Semibold.ttf new file mode 100644 index 00000000..d4774aab Binary files /dev/null and b/res/fonts/SourceSans3-Semibold.ttf differ diff --git a/res/fonts/SourceSansPro-Bold.ttf b/res/fonts/SourceSansPro-Bold.ttf deleted file mode 100644 index a253fdc2..00000000 Binary files a/res/fonts/SourceSansPro-Bold.ttf and /dev/null differ diff --git a/res/fonts/SourceSansPro-Regular.ttf b/res/fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index d9344ce8..00000000 Binary files a/res/fonts/SourceSansPro-Regular.ttf and /dev/null differ 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) { lightFont = &fontLiterataExtraLightopsz18_Embedded; } else if (d->contentFont == sourceSansPro_TextFont) { - regularFont = &fontSourceSansProRegular_Embedded; - boldFont = &fontSourceSansProBold_Embedded; - italicFont = &fontFiraSansItalic_Embedded; - lightFont = &fontFiraSansLight_Embedded; - lightScaling = italicScaling = 0.85f; + regularFont = &fontSourceSans3Regular_Embedded; + boldFont = &fontSourceSans3Semibold_Embedded; + italicFont = &fontSourceSans3It_Embedded; + lightFont = &fontSourceSans3ExtraLight_Embedded; } else if (d->contentFont == iosevka_TextFont) { regularFont = &fontIosevkaTermExtended_Embedded; @@ -280,8 +279,8 @@ static void initFonts_Text_(iText *d) { h3Font = &fontLiterataRegularopsz14_Embedded; } else if (d->headingFont == sourceSansPro_TextFont) { - h12Font = &fontSourceSansProBold_Embedded; - h3Font = &fontSourceSansProRegular_Embedded; + h12Font = &fontSourceSans3Bold_Embedded; + h3Font = &fontSourceSans3Regular_Embedded; } else if (d->headingFont == iosevka_TextFont) { h12Font = &fontIosevkaTermExtended_Embedded; @@ -301,15 +300,15 @@ static void initFonts_Text_(iText *d) { /* Content sizes: smallmono, mono, 1.0, 1.2, 1.333, 1.666, 2.0 */ } fontData[max_FontId] = { /* UI fonts: normal weight */ - { &fontSourceSansProRegular_Embedded, uiSize, 1.0f, uiNormal_FontSize }, - { &fontSourceSansProRegular_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, - { &fontSourceSansProRegular_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, - { &fontSourceSansProRegular_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, + { &fontSourceSans3Regular_Embedded, uiSize, 1.0f, uiNormal_FontSize }, + { &fontSourceSans3Regular_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, + { &fontSourceSans3Regular_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, + { &fontSourceSans3Regular_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, /* UI fonts: bold weight */ - { &fontSourceSansProBold_Embedded, uiSize, 1.0f, uiNormal_FontSize }, - { &fontSourceSansProBold_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, - { &fontSourceSansProBold_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, - { &fontSourceSansProBold_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, + { &fontSourceSans3Bold_Embedded, uiSize, 1.0f, uiNormal_FontSize }, + { &fontSourceSans3Bold_Embedded, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, + { &fontSourceSans3Bold_Embedded, uiSize * 1.333f, 1.0f, uiBig_FontSize }, + { &fontSourceSans3Bold_Embedded, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, /* content fonts */ { regularFont, textSize, scaling, contentRegular_FontSize }, { boldFont, textSize, scaling, contentRegular_FontSize }, @@ -322,7 +321,7 @@ static void initFonts_Text_(iText *d) { { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, contentMonoSmall_FontSize }, { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, contentMono_FontSize }, /* extra content fonts */ - { &fontSourceSansProRegular_Embedded, textSize, scaling, contentRegular_FontSize }, + { &fontSourceSans3Regular_Embedded, textSize, scaling, contentRegular_FontSize }, { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, contentRegular_FontSize }, /* symbols and scripts */ #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, static void addFontButtons_(iWidget *parent, const char *id) { const char *fontNames[] = { - "Nunito", "Fira Sans", "Literata", "Tinos", "Source Sans Pro", "Iosevka" + "Nunito", "Fira Sans", "Literata", "Tinos", "Source Sans 3", "Iosevka" }; iArray *items = new_Array(sizeof(iMenuItem)); iForIndices(i, fontNames) { pushBack_Array(items, &(iMenuItem){ fontNames[i], 0, 0, format_CStr("!%s.set arg:%d", id, i) }); } - iLabelWidget *button = makeMenuButton_LabelWidget("Source Sans Pro", data_Array(items), size_Array(items)); + iLabelWidget *button = makeMenuButton_LabelWidget("Source Sans 3", data_Array(items), size_Array(items)); setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), uiBackgroundMenu_ColorId); setId_Widget(as_Widget(button), format_CStr("prefs.%s", id)); addChildFlags_Widget(parent, iClob(button), alignLeft_WidgetFlag); -- cgit v1.2.3