summaryrefslogtreecommitdiff
path: root/src/ui/text.h
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/ui/text.h
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/ui/text.h')
-rw-r--r--src/ui/text.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/text.h b/src/ui/text.h
index 044ddd32..1bb60e8b 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -68,11 +68,14 @@ enum iFontId {
68 monospace_FontId, 68 monospace_FontId,
69 /* extra content fonts */ 69 /* extra content fonts */
70 defaultContentSized_FontId, /* UI font but sized to regular_FontId */ 70 defaultContentSized_FontId, /* UI font but sized to regular_FontId */
71 regularMonospace_FontId,
72 /* symbols and scripts */ 71 /* symbols and scripts */
73 symbols_FontId, 72 userSymbols_FontId,
74 emoji_FontId = symbols_FontId + max_FontSize, 73 iosevka_FontId = userSymbols_FontId + max_FontSize,
75 japanese_FontId = emoji_FontId + max_FontSize, 74 symbols_FontId = iosevka_FontId + max_FontSize,
75 symbols2_FontId = symbols_FontId + max_FontSize,
76 smolEmoji_FontId = symbols2_FontId + max_FontSize,
77 notoEmoji_FontId = smolEmoji_FontId + max_FontSize,
78 japanese_FontId = notoEmoji_FontId + max_FontSize,
76 chineseSimplified_FontId = japanese_FontId + max_FontSize, 79 chineseSimplified_FontId = japanese_FontId + max_FontSize,
77 korean_FontId = chineseSimplified_FontId + max_FontSize, 80 korean_FontId = chineseSimplified_FontId + max_FontSize,
78 arabic_FontId = korean_FontId + max_FontSize, 81 arabic_FontId = korean_FontId + max_FontSize,
@@ -91,7 +94,7 @@ enum iFontId {
91 uiInput_FontId = defaultMedium_FontId, 94 uiInput_FontId = defaultMedium_FontId,
92 uiContent_FontId = defaultMedium_FontId, 95 uiContent_FontId = defaultMedium_FontId,
93 uiContentBold_FontId = defaultMediumBold_FontId, 96 uiContentBold_FontId = defaultMediumBold_FontId,
94 uiContentSymbols_FontId = symbols_FontId + uiMedium_FontSize, 97 uiContentSymbols_FontId = symbols_FontId + uiMedium_FontSize,
95 /* Document fonts: */ 98 /* Document fonts: */
96 paragraph_FontId = regular_FontId, 99 paragraph_FontId = regular_FontId,
97 firstParagraph_FontId = medium_FontId, 100 firstParagraph_FontId = medium_FontId,
@@ -102,6 +105,7 @@ enum iFontId {
102 heading2_FontId = largeBold_FontId, 105 heading2_FontId = largeBold_FontId,
103 heading3_FontId = big_FontId, 106 heading3_FontId = big_FontId,
104 banner_FontId = largeLight_FontId, 107 banner_FontId = largeLight_FontId,
108 regularMonospace_FontId = iosevka_FontId + contentRegular_FontSize
105}; 109};
106 110
107iLocalDef iBool isJapanese_FontId(enum iFontId id) { 111iLocalDef iBool isJapanese_FontId(enum iFontId id) {
@@ -124,6 +128,8 @@ extern int gap_Text; /* affected by content font size */
124void init_Text (SDL_Renderer *); 128void init_Text (SDL_Renderer *);
125void deinit_Text (void); 129void deinit_Text (void);
126 130
131void loadUserFonts_Text (void); /* based on Prefs */
132
127void setContentFont_Text (enum iTextFont font); 133void setContentFont_Text (enum iTextFont font);
128void setHeadingFont_Text (enum iTextFont font); 134void setHeadingFont_Text (enum iTextFont font);
129void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ 135void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */