diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-26 11:58:29 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-26 11:58:29 +0300 |
commit | 247b2c6cdea3e57f4d22d375b43927bc9f39efc8 (patch) | |
tree | 4eff622ad397dbfd51db16292ad4bc42ee14f14c /src | |
parent | f53e6d34fbb8d2f2fb54aff8b746b1c5d06fe497 (diff) |
Fonts: Added more Smol Emoji symbols
Diffstat (limited to 'src')
-rw-r--r-- | src/defs.h | 2 | ||||
-rw-r--r-- | src/ui/root.c | 2 | ||||
-rw-r--r-- | src/ui/text.c | 14 |
3 files changed, 13 insertions, 5 deletions
@@ -92,7 +92,7 @@ enum iFileVersion { | |||
92 | #define globe_Icon "\U0001f310" | 92 | #define globe_Icon "\U0001f310" |
93 | #define magnifyingGlass_Icon "\U0001f50d" | 93 | #define magnifyingGlass_Icon "\U0001f50d" |
94 | #define midEllipsis_Icon "\u00b7\u00b7\u00b7" | 94 | #define midEllipsis_Icon "\u00b7\u00b7\u00b7" |
95 | #define return_Icon "\u21a9" | 95 | #define return_Icon "\u23ce" |
96 | 96 | ||
97 | #if defined (iPlatformApple) | 97 | #if defined (iPlatformApple) |
98 | # define shift_Icon "\u21e7" | 98 | # define shift_Icon "\u21e7" |
diff --git a/src/ui/root.c b/src/ui/root.c index 49925856..15548e74 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -1049,7 +1049,7 @@ void createUserInterface_Root(iRoot *d) { | |||
1049 | moveToParentRightEdge_WidgetFlag); | 1049 | moveToParentRightEdge_WidgetFlag); |
1050 | /* Feeds refresh indicator is inside the input field. */ { | 1050 | /* Feeds refresh indicator is inside the input field. */ { |
1051 | iLabelWidget *queryInd = | 1051 | iLabelWidget *queryInd = |
1052 | new_LabelWidget(uiTextAction_ColorEscape "${status.query} \u21a9", NULL); | 1052 | new_LabelWidget(uiTextAction_ColorEscape "${status.query} " return_Icon, NULL); |
1053 | setId_Widget(as_Widget(queryInd), "input.indicator.search"); | 1053 | setId_Widget(as_Widget(queryInd), "input.indicator.search"); |
1054 | setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); | 1054 | setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); |
1055 | setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId); | 1055 | setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId); |
diff --git a/src/ui/text.c b/src/ui/text.c index 0e6a6d32..d35b470c 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -154,8 +154,13 @@ static void init_Font(iFont *d, const iBlock *data, int height, float scale, | |||
154 | } | 154 | } |
155 | d->baseline = ascent * d->yScale; | 155 | d->baseline = ascent * d->yScale; |
156 | d->vertOffset = height * (1.0f - scale) / 2; | 156 | d->vertOffset = height * (1.0f - scale) / 2; |
157 | if (scale > 1.0f) { | 157 | /* Custom tweaks. */ |
158 | d->vertOffset /= 2; /* Tweak for Noto Sans Symbols */ | 158 | if (data == &fontNotoSansSymbolsRegular_Embedded || |
159 | data == &fontNotoSansSymbols2Regular_Embedded) { | ||
160 | d->vertOffset /= 2; | ||
161 | } | ||
162 | else if (data == &fontNotoEmojiRegular_Embedded) { | ||
163 | //d->vertOffset -= height / 30; | ||
159 | } | 164 | } |
160 | d->sizeId = sizeId; | 165 | d->sizeId = sizeId; |
161 | memset(d->indexTable, 0xff, sizeof(d->indexTable)); | 166 | memset(d->indexTable, 0xff, sizeof(d->indexTable)); |
@@ -338,7 +343,7 @@ static void initFonts_Text_(iText *d) { | |||
338 | DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 1.45f), | 343 | DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 1.45f), |
339 | DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), | 344 | DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), |
340 | DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), | 345 | DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), |
341 | DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.0f), | 346 | DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.10f), |
342 | DEFINE_FONT_SET(&fontNotoSansJPRegular_Embedded, 1.0f), | 347 | DEFINE_FONT_SET(&fontNotoSansJPRegular_Embedded, 1.0f), |
343 | DEFINE_FONT_SET(&fontNotoSansSCRegular_Embedded, 1.0f), | 348 | DEFINE_FONT_SET(&fontNotoSansSCRegular_Embedded, 1.0f), |
344 | DEFINE_FONT_SET(&fontNanumGothicRegular_Embedded, 1.0f), /* TODO: should use Noto Sans here, too */ | 349 | DEFINE_FONT_SET(&fontNanumGothicRegular_Embedded, 1.0f), /* TODO: should use Noto Sans here, too */ |
@@ -563,6 +568,9 @@ static void allocate_Font_(iFont *d, iGlyph *glyph, int hoff) { | |||
563 | } | 568 | } |
564 | 569 | ||
565 | iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { | 570 | iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { |
571 | if (isVariationSelector_Char(ch)) { | ||
572 | return d; | ||
573 | } | ||
566 | /* Smol Emoji overrides all other fonts. */ | 574 | /* Smol Emoji overrides all other fonts. */ |
567 | if (ch != 0x20) { | 575 | if (ch != 0x20) { |
568 | iFont *smol = font_Text_(smolEmoji_FontId + d->sizeId); | 576 | iFont *smol = font_Text_(smolEmoji_FontId + d->sizeId); |