summaryrefslogtreecommitdiff
path: root/src/ui/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/text.c')
-rw-r--r--src/ui/text.c14
1 files changed, 11 insertions, 3 deletions
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
565iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { 570iLocalDef 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);