diff options
-rw-r--r-- | src/ui/text.c | 10 | ||||
-rw-r--r-- | src/ui/text.h | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index e7f996df..ea53539e 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -187,9 +187,11 @@ static void init_Font(iFont *d, const iBlock *data, int height, float scale, | |||
187 | d->baseline = ascent * d->yScale; | 187 | d->baseline = ascent * d->yScale; |
188 | d->vertOffset = height * (1.0f - scale) / 2; | 188 | d->vertOffset = height * (1.0f - scale) / 2; |
189 | /* Custom tweaks. */ | 189 | /* Custom tweaks. */ |
190 | if (data == &fontNotoSansSymbolsRegular_Embedded || | 190 | if (data == &fontNotoSansSymbolsRegular_Embedded) { |
191 | data == &fontNotoSansSymbols2Regular_Embedded) { | 191 | d->vertOffset *= 1.2f; |
192 | d->vertOffset /= 2; | 192 | } |
193 | else if (data == &fontNotoSansSymbols2Regular_Embedded) { | ||
194 | d->vertOffset /= 2; | ||
193 | } | 195 | } |
194 | else if (data == &fontNotoEmojiRegular_Embedded) { | 196 | else if (data == &fontNotoEmojiRegular_Embedded) { |
195 | //d->vertOffset -= height / 30; | 197 | //d->vertOffset -= height / 30; |
@@ -405,7 +407,7 @@ static void initFonts_Text_(iText *d) { | |||
405 | { (data), monoSize, glyphScale, contentMono_FontSize } | 407 | { (data), monoSize, glyphScale, contentMono_FontSize } |
406 | DEFINE_FONT_SET(userFont_ ? userFont_ : &fontIosevkaTermExtended_Embedded, 1.0f), | 408 | DEFINE_FONT_SET(userFont_ ? userFont_ : &fontIosevkaTermExtended_Embedded, 1.0f), |
407 | DEFINE_FONT_SET(&fontIosevkaTermExtended_Embedded, 0.866f), | 409 | DEFINE_FONT_SET(&fontIosevkaTermExtended_Embedded, 0.866f), |
408 | DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 1.45f), | 410 | DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 2.0f), |
409 | DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), | 411 | DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), |
410 | DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), | 412 | DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), |
411 | DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.10f), | 413 | DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.10f), |
diff --git a/src/ui/text.h b/src/ui/text.h index e5b57bf4..ac9db405 100644 --- a/src/ui/text.h +++ b/src/ui/text.h | |||
@@ -45,6 +45,13 @@ enum iFontSize { | |||
45 | max_FontSize, | 45 | max_FontSize, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | iLocalDef enum iFontSize larger_FontSize(enum iFontSize size) { | ||
49 | if (size == uiLarge_FontSize || size == contentHuge_FontSize || size == contentMono_FontSize) { | ||
50 | return size; /* biggest available */ | ||
51 | } | ||
52 | return size + 1; | ||
53 | } | ||
54 | |||
48 | enum iFontId { | 55 | enum iFontId { |
49 | /* UI fonts: normal weight (1x, 1.125x, 1.33x, 1.67x) */ | 56 | /* UI fonts: normal weight (1x, 1.125x, 1.33x, 1.67x) */ |
50 | default_FontId = 0, | 57 | default_FontId = 0, |