diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-13 13:50:28 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-13 13:50:28 +0300 |
commit | 488dcbf40df6bf80b1042d5234b60ee2973b2818 (patch) | |
tree | 0b0e0aa10e14c9bd6220bfac2d80b5bb158906e2 | |
parent | e3a20607304e4933db283a6c78e614c472c95b9b (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.
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | res/fonts/SourceSans3-Bold.ttf | bin | 0 -> 298256 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-ExtraLight.ttf | bin | 0 -> 293932 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-It.ttf | bin | 0 -> 214992 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-Regular.ttf | bin | 0 -> 299252 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-Semibold.ttf | bin | 0 -> 298888 bytes | |||
-rw-r--r-- | res/fonts/SourceSansPro-Bold.ttf | bin | 288712 -> 0 bytes | |||
-rw-r--r-- | res/fonts/SourceSansPro-Regular.ttf | bin | 290156 -> 0 bytes | |||
-rw-r--r-- | src/ui/text.c | 31 | ||||
-rw-r--r-- | src/ui/util.c | 4 |
10 files changed, 22 insertions, 20 deletions
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 | |||
72 | res/fonts/Nunito-ExtraLight.ttf | 72 | res/fonts/Nunito-ExtraLight.ttf |
73 | res/fonts/Nunito-LightItalic.ttf | 73 | res/fonts/Nunito-LightItalic.ttf |
74 | res/fonts/Nunito-Regular.ttf | 74 | res/fonts/Nunito-Regular.ttf |
75 | res/fonts/SourceSansPro-Regular.ttf | 75 | res/fonts/SourceSans3-Bold.ttf |
76 | res/fonts/SourceSansPro-Bold.ttf | 76 | res/fonts/SourceSans3-ExtraLight.ttf |
77 | res/fonts/SourceSans3-It.ttf | ||
78 | res/fonts/SourceSans3-Regular.ttf | ||
79 | res/fonts/SourceSans3-Semibold.ttf | ||
77 | res/fonts/Symbola.ttf | 80 | res/fonts/Symbola.ttf |
78 | res/lang/de.bin | 81 | res/lang/de.bin |
79 | res/lang/en.bin | 82 | 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 --- /dev/null +++ b/res/fonts/SourceSans3-Bold.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSans3-ExtraLight.ttf b/res/fonts/SourceSans3-ExtraLight.ttf new file mode 100644 index 00000000..53e1541c --- /dev/null +++ b/res/fonts/SourceSans3-ExtraLight.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSans3-It.ttf b/res/fonts/SourceSans3-It.ttf new file mode 100644 index 00000000..9823601c --- /dev/null +++ b/res/fonts/SourceSans3-It.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSans3-Regular.ttf b/res/fonts/SourceSans3-Regular.ttf new file mode 100644 index 00000000..f6d31e8c --- /dev/null +++ b/res/fonts/SourceSans3-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSans3-Semibold.ttf b/res/fonts/SourceSans3-Semibold.ttf new file mode 100644 index 00000000..d4774aab --- /dev/null +++ b/res/fonts/SourceSans3-Semibold.ttf | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSansPro-Bold.ttf b/res/fonts/SourceSansPro-Bold.ttf deleted file mode 100644 index a253fdc2..00000000 --- a/res/fonts/SourceSansPro-Bold.ttf +++ /dev/null | |||
Binary files differ | |||
diff --git a/res/fonts/SourceSansPro-Regular.ttf b/res/fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index d9344ce8..00000000 --- a/res/fonts/SourceSansPro-Regular.ttf +++ /dev/null | |||
Binary files 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) { | |||
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 | ||
1903 | static void addFontButtons_(iWidget *parent, const char *id) { | 1903 | static 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); |