diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-28 09:28:37 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-28 09:28:37 +0300 |
commit | 4756b0a18d58560cc4023ed61d4940b127da63f3 (patch) | |
tree | 644c5868e4ad89e7bd1f74be92c0e9e471090630 /src | |
parent | 7512470f3b36d25ffd714f1013bbb4ee9fea0e2c (diff) |
Added Noto Sans Arabic
Added a font for Arabic, making the glyphs available for rendering.
Of course, this doesn't solve Arabic text rendering yet. There is still the RTL direction to work out and possibly some missing glyph combining rules.
IssueID #195
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/text.c | 8 | ||||
-rw-r--r-- | src/ui/text.h | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index 6aaf40f5..b4401abb 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -331,6 +331,7 @@ static void initFonts_Text_(iText *d) { | |||
331 | DEFINE_FONT_SET(fontNotoSansJPRegular_Embedded), | 331 | DEFINE_FONT_SET(fontNotoSansJPRegular_Embedded), |
332 | DEFINE_FONT_SET(fontNotoSansSCRegular_Embedded), | 332 | DEFINE_FONT_SET(fontNotoSansSCRegular_Embedded), |
333 | DEFINE_FONT_SET(fontNanumGothicRegular_Embedded), /* TODO: should use Noto Sans here, too */ | 333 | DEFINE_FONT_SET(fontNanumGothicRegular_Embedded), /* TODO: should use Noto Sans here, too */ |
334 | DEFINE_FONT_SET(fontNotoSansArabicUIRegular_Embedded), | ||
334 | }; | 335 | }; |
335 | iForIndices(i, fontData) { | 336 | iForIndices(i, fontData) { |
336 | iFont *font = &d->fonts[i]; | 337 | iFont *font = &d->fonts[i]; |
@@ -584,6 +585,13 @@ iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { | |||
584 | return japanese; | 585 | return japanese; |
585 | } | 586 | } |
586 | } | 587 | } |
588 | /* Maybe Arabic. */ | ||
589 | if (ch >= 0x600) { | ||
590 | iFont *arabic = font_Text_(arabic_FontId + d->sizeId); | ||
591 | if (arabic != d && (*glyphIndex = glyphIndex_Font_(arabic, ch)) != 0) { | ||
592 | return arabic; | ||
593 | } | ||
594 | } | ||
587 | #if defined (iPlatformApple) | 595 | #if defined (iPlatformApple) |
588 | /* White up arrow is used for the Shift key on macOS. Symbola's glyph is not a great | 596 | /* White up arrow is used for the Shift key on macOS. Symbola's glyph is not a great |
589 | match to the other text, so use the UI font instead. */ | 597 | match to the other text, so use the UI font instead. */ |
diff --git a/src/ui/text.h b/src/ui/text.h index d86754cc..58941974 100644 --- a/src/ui/text.h +++ b/src/ui/text.h | |||
@@ -75,7 +75,8 @@ enum iFontId { | |||
75 | japanese_FontId = emoji_FontId + max_FontSize, | 75 | japanese_FontId = emoji_FontId + max_FontSize, |
76 | chineseSimplified_FontId = japanese_FontId + max_FontSize, | 76 | chineseSimplified_FontId = japanese_FontId + max_FontSize, |
77 | korean_FontId = chineseSimplified_FontId + max_FontSize, | 77 | korean_FontId = chineseSimplified_FontId + max_FontSize, |
78 | max_FontId = korean_FontId + max_FontSize, | 78 | arabic_FontId = korean_FontId + max_FontSize, |
79 | max_FontId = arabic_FontId + max_FontSize, | ||
79 | 80 | ||
80 | /* Meta: */ | 81 | /* Meta: */ |
81 | mask_FontId = 0xffff, | 82 | mask_FontId = 0xffff, |