summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-25 18:25:40 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-25 18:25:51 +0300
commitf53e6d34fbb8d2f2fb54aff8b746b1c5d06fe497 (patch)
treec8cbe09db582b66262dd6472bd55be7b485fdf66 /src/app.c
parent54d38100bb49a34f9ad11570e0144dc1ec006858 (diff)
Removed Symbola, replaced with other/new fonts
Symbola's license is not permissive enough, so it has been removed. Added "Smol Emoji" with face emoticons and other UI characters for Lagrange. More symbols provided by Noto Sans Symbols and Noto Sans Symbols 2. The fallback fonts are now Iosevka, which has a pretty good coverage (although monospace), and the user's chosen TrueType font (which could still be a local copy of Symbola). Still a work in progress: some characters are missing. IssueID #283
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/app.c b/src/app.c
index e22ee494..bb3afea6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -204,6 +204,7 @@ static iString *serializePrefs_App_(const iApp *d) {
204 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window)); 204 appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window));
205 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab); 205 appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab);
206 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font); 206 appendFormat_String(str, "font.set arg:%d\n", d->prefs.font);
207 appendFormat_String(str, "font.user path:%s\n", cstr_String(&d->prefs.symbolFontPath));
207 appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont); 208 appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont);
208 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); 209 appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent);
209 appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling); 210 appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling);
@@ -1555,24 +1556,25 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) {
1555 isSelected_Widget(findChild_Widget(d, "prefs.imageloadscroll"))); 1556 isSelected_Widget(findChild_Widget(d, "prefs.imageloadscroll")));
1556 postCommandf_App("hidetoolbarscroll arg:%d", 1557 postCommandf_App("hidetoolbarscroll arg:%d",
1557 isSelected_Widget(findChild_Widget(d, "prefs.hidetoolbarscroll"))); 1558 isSelected_Widget(findChild_Widget(d, "prefs.hidetoolbarscroll")));
1558 postCommandf_App("ostheme arg:%d", 1559 postCommandf_App("ostheme arg:%d", isSelected_Widget(findChild_Widget(d, "prefs.ostheme")));
1559 isSelected_Widget(findChild_Widget(d, "prefs.ostheme"))); 1560 postCommandf_App("font.user path:%s",
1561 cstrText_InputWidget(findChild_Widget(d, "prefs.userfont")));
1560 postCommandf_App("decodeurls arg:%d", 1562 postCommandf_App("decodeurls arg:%d",
1561 isSelected_Widget(findChild_Widget(d, "prefs.decodeurls"))); 1563 isSelected_Widget(findChild_Widget(d, "prefs.decodeurls")));
1562 postCommandf_App("searchurl address:%s", 1564 postCommandf_App("searchurl address:%s",
1563 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.searchurl")))); 1565 cstrText_InputWidget(findChild_Widget(d, "prefs.searchurl")));
1564 postCommandf_App("cachesize.set arg:%d", 1566 postCommandf_App("cachesize.set arg:%d",
1565 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize")))); 1567 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize"))));
1566 postCommandf_App("ca.file path:%s", 1568 postCommandf_App("ca.file path:%s",
1567 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.ca.file")))); 1569 cstrText_InputWidget(findChild_Widget(d, "prefs.ca.file")));
1568 postCommandf_App("ca.path path:%s", 1570 postCommandf_App("ca.path path:%s",
1569 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.ca.path")))); 1571 cstrText_InputWidget(findChild_Widget(d, "prefs.ca.path")));
1570 postCommandf_App("proxy.gemini address:%s", 1572 postCommandf_App("proxy.gemini address:%s",
1571 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.gemini")))); 1573 cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.gemini")));
1572 postCommandf_App("proxy.gopher address:%s", 1574 postCommandf_App("proxy.gopher address:%s",
1573 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.gopher")))); 1575 cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.gopher")));
1574 postCommandf_App("proxy.http address:%s", 1576 postCommandf_App("proxy.http address:%s",
1575 cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.http")))); 1577 cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.http")));
1576 const iWidget *tabs = findChild_Widget(d, "prefs.tabs"); 1578 const iWidget *tabs = findChild_Widget(d, "prefs.tabs");
1577 if (tabs) { 1579 if (tabs) {
1578 postCommandf_App("prefs.dialogtab arg:%u", 1580 postCommandf_App("prefs.dialogtab arg:%u",
@@ -1892,6 +1894,22 @@ iBool handleCommand_App(const char *cmd) {
1892 resetFonts_Text(); 1894 resetFonts_Text();
1893 return iTrue; 1895 return iTrue;
1894 } 1896 }
1897 else if (equal_Command(cmd, "font.user")) {
1898 const char *path = suffixPtr_Command(cmd, "path");
1899 if (cmp_String(&d->prefs.symbolFontPath, path)) {
1900 if (!isFrozen) {
1901 setFreezeDraw_Window(get_Window(), iTrue);
1902 }
1903 setCStr_String(&d->prefs.symbolFontPath, path);
1904 loadUserFonts_Text();
1905 resetFonts_Text();
1906 if (!isFrozen) {
1907 postCommand_App("font.changed");
1908 postCommand_App("window.unfreeze");
1909 }
1910 }
1911 return iTrue;
1912 }
1895 else if (equal_Command(cmd, "font.set")) { 1913 else if (equal_Command(cmd, "font.set")) {
1896 if (!isFrozen) { 1914 if (!isFrozen) {
1897 setFreezeDraw_Window(get_Window(), iTrue); 1915 setFreezeDraw_Window(get_Window(), iTrue);
@@ -2332,6 +2350,7 @@ iBool handleCommand_App(const char *cmd) {
2332 setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages); 2350 setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages);
2333 setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); 2351 setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme);
2334 setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame); 2352 setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame);
2353 setText_InputWidget(findChild_Widget(dlg, "prefs.userfont"), &d->prefs.symbolFontPath);
2335 updatePrefsPinSplitButtons_(dlg, d->prefs.pinSplit); 2354 updatePrefsPinSplitButtons_(dlg, d->prefs.pinSplit);
2336 updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); 2355 updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage));
2337 setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); 2356 setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize);