From 247b2c6cdea3e57f4d22d375b43927bc9f39efc8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 26 May 2021 11:58:29 +0300 Subject: Fonts: Added more Smol Emoji symbols --- src/defs.h | 2 +- src/ui/root.c | 2 +- src/ui/text.c | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/defs.h b/src/defs.h index c19dd50e..d592abb2 100644 --- a/src/defs.h +++ b/src/defs.h @@ -92,7 +92,7 @@ enum iFileVersion { #define globe_Icon "\U0001f310" #define magnifyingGlass_Icon "\U0001f50d" #define midEllipsis_Icon "\u00b7\u00b7\u00b7" -#define return_Icon "\u21a9" +#define return_Icon "\u23ce" #if defined (iPlatformApple) # 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) { moveToParentRightEdge_WidgetFlag); /* Feeds refresh indicator is inside the input field. */ { iLabelWidget *queryInd = - new_LabelWidget(uiTextAction_ColorEscape "${status.query} \u21a9", NULL); + new_LabelWidget(uiTextAction_ColorEscape "${status.query} " return_Icon, NULL); setId_Widget(as_Widget(queryInd), "input.indicator.search"); setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); 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, } d->baseline = ascent * d->yScale; d->vertOffset = height * (1.0f - scale) / 2; - if (scale > 1.0f) { - d->vertOffset /= 2; /* Tweak for Noto Sans Symbols */ + /* Custom tweaks. */ + if (data == &fontNotoSansSymbolsRegular_Embedded || + data == &fontNotoSansSymbols2Regular_Embedded) { + d->vertOffset /= 2; + } + else if (data == &fontNotoEmojiRegular_Embedded) { + //d->vertOffset -= height / 30; } d->sizeId = sizeId; memset(d->indexTable, 0xff, sizeof(d->indexTable)); @@ -338,7 +343,7 @@ static void initFonts_Text_(iText *d) { DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 1.45f), DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), - DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.0f), + DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.10f), DEFINE_FONT_SET(&fontNotoSansJPRegular_Embedded, 1.0f), DEFINE_FONT_SET(&fontNotoSansSCRegular_Embedded, 1.0f), 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) { } iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { + if (isVariationSelector_Char(ch)) { + return d; + } /* Smol Emoji overrides all other fonts. */ if (ch != 0x20) { iFont *smol = font_Text_(smolEmoji_FontId + d->sizeId); -- cgit v1.2.3