From 0546172e3e690d508a90662645a1c4ad7b826e04 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 29 Mar 2010 13:31:03 +0200 Subject: [PATCH] Basic thaana support --- font/font.c | 20 ++++++++++++++++++++ include/grub/unicode.h | 21 ++++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/font/font.c b/font/font.c index da3f0cc74..2eeadbbda 100644 --- a/font/font.c +++ b/font/font.c @@ -1259,6 +1259,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, case GRUB_UNICODE_COMB_ARABIC_SHADDA: case GRUB_UNICODE_COMB_HEBREW_RAFE: case GRUB_UNICODE_STACK_ABOVE: + stacked_above: space = combining_glyphs[i]->offset_y - grub_font_get_xheight (combining_glyphs[i]->font) - 1; if (space <= 0) @@ -1291,6 +1292,7 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, /* I don't know how ypogegrammeni differs from subscript. */ case GRUB_UNICODE_COMB_YPOGEGRAMMENI: case GRUB_UNICODE_STACK_BELOW: + stacked_below: space = -(combining_glyphs[i]->offset_y + combining_glyphs[i]->height); if (space <= 0) @@ -1303,6 +1305,24 @@ blit_comb (const struct grub_unicode_glyph *glyph_id, min_devwidth = combining_glyphs[i]->width; break; + case GRUB_UNICODE_COMB_MN: + switch (glyph_id->combining[i].code) + { + case GRUB_UNICODE_THAANA_ABAFILI: + case GRUB_UNICODE_THAANA_AABAAFILI: + case GRUB_UNICODE_THAANA_UBUFILI: + case GRUB_UNICODE_THAANA_OOBOOFILI: + case GRUB_UNICODE_THAANA_EBEFILI: + case GRUB_UNICODE_THAANA_EYBEYFILI: + case GRUB_UNICODE_THAANA_OBOFILI: + case GRUB_UNICODE_THAANA_OABOAFILI: + case GRUB_UNICODE_THAANA_SUKUN: + goto stacked_above; + case GRUB_UNICODE_THAANA_IBIFILI: + case GRUB_UNICODE_THAANA_EEBEEFILI: + goto stacked_below; + } + /* Fall through. */ default: { /* Default handling. Just draw combining character on top diff --git a/include/grub/unicode.h b/include/grub/unicode.h index f5da907aa..2e08fb0d1 100644 --- a/include/grub/unicode.h +++ b/include/grub/unicode.h @@ -170,11 +170,22 @@ struct grub_unicode_glyph #define GRUB_UNICODE_VARIATION_SELECTOR_16 0xfe0f #define GRUB_UNICODE_VARIATION_SELECTOR_17 0xe0100 #define GRUB_UNICODE_VARIATION_SELECTOR_256 0xe01ef -#define GRUB_UNICODE_HEBREW_WAW 0x05d5 -#define GRUB_UNICODE_ZWNJ 0x200c -#define GRUB_UNICODE_ZWJ 0x200d -#define GRUB_UNICODE_ARABIC_START 0x600 -#define GRUB_UNICODE_ARABIC_END 0x700 +#define GRUB_UNICODE_HEBREW_WAW 0x05d5 +#define GRUB_UNICODE_ZWNJ 0x200c +#define GRUB_UNICODE_ZWJ 0x200d +#define GRUB_UNICODE_ARABIC_START 0x0600 +#define GRUB_UNICODE_ARABIC_END 0x0700 +#define GRUB_UNICODE_THAANA_ABAFILI 0x07a6 +#define GRUB_UNICODE_THAANA_AABAAFILI 0x07a7 +#define GRUB_UNICODE_THAANA_IBIFILI 0x07a8 +#define GRUB_UNICODE_THAANA_EEBEEFILI 0x07a9 +#define GRUB_UNICODE_THAANA_UBUFILI 0x07aa +#define GRUB_UNICODE_THAANA_OOBOOFILI 0x07ab +#define GRUB_UNICODE_THAANA_EBEFILI 0x07ac +#define GRUB_UNICODE_THAANA_EYBEYFILI 0x07ad +#define GRUB_UNICODE_THAANA_OBOFILI 0x07ae +#define GRUB_UNICODE_THAANA_OABOAFILI 0x07af +#define GRUB_UNICODE_THAANA_SUKUN 0x07b0 extern struct grub_unicode_compact_range grub_unicode_compact[]; extern struct grub_unicode_bidi_pair grub_unicode_bidi_pairs[];