Add mirroring and stacked combining marks

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-07 21:25:56 +01:00
parent 72f12cdcd9
commit 97ea65d432
5 changed files with 193 additions and 746 deletions

View File

@ -850,6 +850,13 @@ grub_font_get_descent (grub_font_t font)
return font->descent;
}
/* FIXME: not correct for all fonts. */
int
grub_font_get_xheight (grub_font_t font)
{
return font->ascent / 2;
}
/* Get the *standard leading* of the font in pixel, which is the spacing
between two lines of text. Specifically, it is the space between the
descent of one line and the ascent of the next line. This is included
@ -1041,6 +1048,40 @@ grub_font_blit_glyph (struct grub_font_glyph *target,
}
}
static void
grub_font_blit_glyph_mirror (struct grub_font_glyph *target,
struct grub_font_glyph *src,
unsigned dx, unsigned dy)
{
unsigned tgt_bit, src_byte, tgt_byte;
signed src_bit;
unsigned i, j;
for (i = 0; i < src->height; i++)
{
src_bit = (src->width * i + src->width - 1) % 8;
src_byte = (src->width * i + src->width - 1) / 8;
tgt_bit = (target->width * (dy + i) + dx) % 8;
tgt_byte = (target->width * (dy + i) + dx) / 8;
for (j = 0; j < src->width; j++)
{
target->bitmap[tgt_byte] |= ((src->bitmap[src_byte] << src_bit)
& 0x80) >> tgt_bit;
src_bit--;
tgt_bit++;
if (src_bit == -1)
{
src_byte--;
src_bit = 7;
}
if (tgt_bit == 8)
{
tgt_byte++;
tgt_bit = 0;
}
}
}
}
static inline enum grub_comb_type
get_comb_type (grub_uint32_t c)
{
@ -1079,6 +1120,7 @@ grub_font_construct_glyph (grub_font_t hinted_font,
grub_uint16_t height;
grub_int16_t offset_x;
grub_int16_t offset_y;
grub_int16_t curtop, curbottom;
grub_uint16_t device_width;
struct grub_font_glyph *main_glyph;
struct grub_font_glyph **combining_glyphs;
@ -1093,12 +1135,12 @@ grub_font_construct_glyph (grub_font_t hinted_font,
return grub_font_dup_glyph (unknown_glyph);
}
if (!glyph_id->ncomb)
if (!glyph_id->ncomb && !glyph_id->attributes)
return grub_font_dup_glyph (main_glyph);
combining_glyphs = grub_malloc (sizeof (combining_glyphs[0])
* glyph_id->ncomb);
if (!combining_glyphs)
if (glyph_id->ncomb && !combining_glyphs)
{
grub_errno = GRUB_ERR_NONE;
return grub_font_dup_glyph (main_glyph);
@ -1121,6 +1163,43 @@ grub_font_construct_glyph (grub_font_t hinted_font,
combtype = get_comb_type (glyph_id->combining[i]);
switch (combtype)
{
case GRUB_UNICODE_STACK_ABOVE:
{
grub_int16_t space;
space = combining_glyphs[i]->offset_y
- grub_font_get_xheight (combining_glyphs[i]->font);
if (space < 1)
space = 1;
if (width < combining_glyphs[i]->width)
{
offset_x -= (combining_glyphs[i]->width - width) / 2;
width = combining_glyphs[i]->width;
}
if (device_width < combining_glyphs[i]->width)
device_width = combining_glyphs[i]->width;
height += combining_glyphs[i]->height + space;
}
break;
case GRUB_UNICODE_STACK_BELOW:
{
grub_int16_t space;
space = -(combining_glyphs[i]->offset_y
+ combining_glyphs[i]->height);
if (space < 1)
space = 1;
if (width < combining_glyphs[i]->width)
{
offset_x -= (combining_glyphs[i]->width - width) / 2;
width = combining_glyphs[i]->width;
}
if (device_width < combining_glyphs[i]->width)
device_width = combining_glyphs[i]->width;
height += combining_glyphs[i]->height + space;
offset_y -= combining_glyphs[i]->height + space;
}
break;
default:
{
/* Default handling. Just draw combining character on top
@ -1166,9 +1245,18 @@ grub_font_construct_glyph (grub_font_t hinted_font,
glyph->offset_y = offset_y;
glyph->device_width = device_width;
grub_font_blit_glyph (glyph, main_glyph, main_glyph->offset_x - offset_x,
(height + offset_y)
- (main_glyph->height + main_glyph->offset_y));
if (glyph_id->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR)
grub_font_blit_glyph_mirror (glyph, main_glyph,
main_glyph->offset_x - offset_x,
(height + offset_y)
- (main_glyph->height + main_glyph->offset_y));
else
grub_font_blit_glyph (glyph, main_glyph, main_glyph->offset_x - offset_x,
(height + offset_y)
- (main_glyph->height + main_glyph->offset_y));
curtop = main_glyph->height + main_glyph->offset_y;
curbottom = main_glyph->offset_y;
for (i = 0; i < glyph_id->ncomb; i++)
{
@ -1178,6 +1266,37 @@ grub_font_construct_glyph (grub_font_t hinted_font,
combtype = get_comb_type (glyph_id->combining[i]);
switch (combtype)
{
case GRUB_UNICODE_STACK_ABOVE:
{
grub_int16_t space;
space = combining_glyphs[i]->offset_y
- grub_font_get_xheight (combining_glyphs[i]->font);
if (space < 0)
space = 1;
curtop += combining_glyphs[i]->height + space;
grub_font_blit_glyph (glyph, combining_glyphs[i],
(width - combining_glyphs[i]->width) / 2,
(height + offset_y) - curtop);
}
break;
case GRUB_UNICODE_STACK_BELOW:
{
grub_int16_t space;
space = -(combining_glyphs[i]->offset_y
+ combining_glyphs[i]->height);
if (space < 0)
space = 1;
curbottom -= space;
grub_font_blit_glyph (glyph, combining_glyphs[i],
(width - combining_glyphs[i]->width) / 2,
(height + offset_y) - curbottom);
curbottom -= combining_glyphs[i]->height;
}
break;
default:
{
/* Default handling. Just draw combining character on top
@ -1247,27 +1366,39 @@ grub_font_draw_glyph (struct grub_font_glyph *glyph,
glyph->width, glyph->height);
}
static grub_uint8_t *bidi_types = NULL;
static void
unpack_bidi (void)
{
unsigned i;
struct grub_unicode_compact_range *cur;
bidi_types = grub_zalloc (GRUB_UNICODE_MAX_CACHED_CHAR);
if (!bidi_types)
{
grub_errno = GRUB_ERR_NONE;
return;
}
for (cur = grub_unicode_compact; cur->end; cur++)
for (i = cur->start; i <= cur->end
&& i < GRUB_UNICODE_MAX_CACHED_CHAR; i++)
if (cur->bidi_mirror)
bidi_types[i] = cur->bidi_type | 0x80;
else
bidi_types[i] = cur->bidi_type | 0x00;
}
static inline enum grub_bidi_type
get_bidi_type (grub_uint32_t c)
{
static grub_uint8_t *bidi_types = NULL;
struct grub_unicode_compact_range *cur;
if (!bidi_types)
{
unsigned i;
bidi_types = grub_zalloc (GRUB_UNICODE_MAX_CACHED_CHAR);
if (bidi_types)
for (cur = grub_unicode_compact; cur->end; cur++)
for (i = cur->start; i <= cur->end
&& i < GRUB_UNICODE_MAX_CACHED_CHAR; i++)
bidi_types[i] = cur->bidi_type;
else
grub_errno = GRUB_ERR_NONE;
}
unpack_bidi ();
if (bidi_types && c < GRUB_UNICODE_MAX_CACHED_CHAR)
return bidi_types[c];
return bidi_types[c] & 0x7f;
for (cur = grub_unicode_compact; cur->end; cur++)
if (cur->start <= c && c <= cur->end)
@ -1276,6 +1407,24 @@ get_bidi_type (grub_uint32_t c)
return GRUB_BIDI_TYPE_L;
}
static inline int
is_mirrored (grub_uint32_t c)
{
struct grub_unicode_compact_range *cur;
if (!bidi_types)
unpack_bidi ();
if (bidi_types && c < GRUB_UNICODE_MAX_CACHED_CHAR)
return !!(bidi_types[c] & 0x80);
for (cur = grub_unicode_compact; cur->end; cur++)
if (cur->start <= c && c <= cur->end)
return cur->bidi_mirror;
return 0;
}
static grub_ssize_t
grub_err_bidi_logical_to_visual (grub_uint32_t *logical,
grub_size_t logical_len,
@ -1450,6 +1599,7 @@ grub_err_bidi_logical_to_visual (grub_uint32_t *logical,
resolved_types[visual_len] = type;
visual[visual_len].base = logical[i];
visual[visual_len].variant = 0;
visual[visual_len].attributes = 0;
visual[visual_len].ncomb = 0;
visual[visual_len].combining = NULL;
visual_len++;
@ -1629,7 +1779,7 @@ grub_err_bidi_logical_to_visual (grub_uint32_t *logical,
if (levels[i] > max_level)
max_level = levels[i];
if (levels[i] < min_odd_level && (levels[i] & 1))
min_odd_level = levels[i];
min_odd_level = levels[i];
}
for (j = max_level; j >= min_odd_level; j--)
{
@ -1644,6 +1794,10 @@ grub_err_bidi_logical_to_visual (grub_uint32_t *logical,
}
}
for (i = 0; i < visual_len; i++)
if (is_mirrored (visual[i].base) && levels[i])
visual[i].attributes |= GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR;
grub_free (levels);
*visual_out = visual;

View File

@ -96,6 +96,8 @@ int grub_font_get_leading (grub_font_t font);
int grub_font_get_height (grub_font_t font);
int grub_font_get_xheight (grub_font_t font);
int grub_font_get_string_width (grub_font_t font, const char *str);
struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,

View File

@ -27,6 +27,7 @@ struct grub_unicode_compact_range
grub_uint32_t end:21;
grub_uint8_t bidi_type:5;
grub_uint8_t comb_type;
grub_uint8_t bidi_mirror:1;
} __attribute__ ((packed));
enum grub_bidi_type
@ -67,13 +68,13 @@ enum grub_comb_type
struct grub_unicode_glyph
{
grub_uint32_t base;
/* Unicode permits 256 variation selectors but since we need a value
for "default" we have to use grub_uint16_t. */
grub_uint16_t variant;
grub_uint16_t variant:9;
grub_uint8_t attributes:1;
grub_size_t ncomb;
grub_uint32_t *combining;
};
#define GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR 0x1
#define GRUB_UNICODE_VARIATION_SELECTOR_1 0xfe00
#define GRUB_UNICODE_VARIATION_SELECTOR_16 0xfe0f
#define GRUB_UNICODE_VARIATION_SELECTOR_17 0xe0100

715
unidata.c
View File

@ -1,715 +0,0 @@
#include <grub/unicode.h>
struct grub_unicode_compact_range grub_unicode_compact[] = {
{0x0, 0x8, GRUB_BIDI_TYPE_BN, 0},
{0x9, 0x9, GRUB_BIDI_TYPE_S, 0},
{0xa, 0xa, GRUB_BIDI_TYPE_B, 0},
{0xb, 0xb, GRUB_BIDI_TYPE_S, 0},
{0xc, 0xc, GRUB_BIDI_TYPE_WS, 0},
{0xd, 0xd, GRUB_BIDI_TYPE_B, 0},
{0xe, 0x1b, GRUB_BIDI_TYPE_BN, 0},
{0x1c, 0x1e, GRUB_BIDI_TYPE_B, 0},
{0x1f, 0x1f, GRUB_BIDI_TYPE_S, 0},
{0x20, 0x20, GRUB_BIDI_TYPE_WS, 0},
{0x21, 0x22, GRUB_BIDI_TYPE_ON, 0},
{0x23, 0x25, GRUB_BIDI_TYPE_ET, 0},
{0x26, 0x2a, GRUB_BIDI_TYPE_ON, 0},
{0x2b, 0x2b, GRUB_BIDI_TYPE_ES, 0},
{0x2c, 0x2c, GRUB_BIDI_TYPE_CS, 0},
{0x2d, 0x2d, GRUB_BIDI_TYPE_ES, 0},
{0x2e, 0x2f, GRUB_BIDI_TYPE_CS, 0},
{0x30, 0x39, GRUB_BIDI_TYPE_EN, 0},
{0x3a, 0x3a, GRUB_BIDI_TYPE_CS, 0},
{0x3b, 0x40, GRUB_BIDI_TYPE_ON, 0},
{0x5b, 0x60, GRUB_BIDI_TYPE_ON, 0},
{0x7b, 0x7e, GRUB_BIDI_TYPE_ON, 0},
{0x7f, 0x84, GRUB_BIDI_TYPE_BN, 0},
{0x85, 0x85, GRUB_BIDI_TYPE_B, 0},
{0x86, 0x9f, GRUB_BIDI_TYPE_BN, 0},
{0xa0, 0xa0, GRUB_BIDI_TYPE_CS, 0},
{0xa1, 0xa1, GRUB_BIDI_TYPE_ON, 0},
{0xa2, 0xa5, GRUB_BIDI_TYPE_ET, 0},
{0xa6, 0xa9, GRUB_BIDI_TYPE_ON, 0},
{0xab, 0xac, GRUB_BIDI_TYPE_ON, 0},
{0xad, 0xad, GRUB_BIDI_TYPE_BN, 0},
{0xae, 0xaf, GRUB_BIDI_TYPE_ON, 0},
{0xb0, 0xb1, GRUB_BIDI_TYPE_ET, 0},
{0xb2, 0xb3, GRUB_BIDI_TYPE_EN, 0},
{0xb4, 0xb4, GRUB_BIDI_TYPE_ON, 0},
{0xb6, 0xb8, GRUB_BIDI_TYPE_ON, 0},
{0xb9, 0xb9, GRUB_BIDI_TYPE_EN, 0},
{0xbb, 0xbf, GRUB_BIDI_TYPE_ON, 0},
{0xd7, 0xd7, GRUB_BIDI_TYPE_ON, 0},
{0xf7, 0xf7, GRUB_BIDI_TYPE_ON, 0},
{0x2b9, 0x2ba, GRUB_BIDI_TYPE_ON, 0},
{0x2c2, 0x2cf, GRUB_BIDI_TYPE_ON, 0},
{0x2d2, 0x2df, GRUB_BIDI_TYPE_ON, 0},
{0x2e5, 0x2ed, GRUB_BIDI_TYPE_ON, 0},
{0x2ef, 0x2ff, GRUB_BIDI_TYPE_ON, 0},
{0x300, 0x314, GRUB_BIDI_TYPE_NSM, 230},
{0x315, 0x315, GRUB_BIDI_TYPE_NSM, 232},
{0x316, 0x319, GRUB_BIDI_TYPE_NSM, 220},
{0x31a, 0x31a, GRUB_BIDI_TYPE_NSM, 232},
{0x31b, 0x31b, GRUB_BIDI_TYPE_NSM, 216},
{0x31c, 0x320, GRUB_BIDI_TYPE_NSM, 220},
{0x321, 0x322, GRUB_BIDI_TYPE_NSM, 202},
{0x323, 0x326, GRUB_BIDI_TYPE_NSM, 220},
{0x327, 0x328, GRUB_BIDI_TYPE_NSM, 202},
{0x329, 0x333, GRUB_BIDI_TYPE_NSM, 220},
{0x334, 0x338, GRUB_BIDI_TYPE_NSM, 1},
{0x339, 0x33c, GRUB_BIDI_TYPE_NSM, 220},
{0x33d, 0x344, GRUB_BIDI_TYPE_NSM, 230},
{0x345, 0x345, GRUB_BIDI_TYPE_NSM, 240},
{0x346, 0x346, GRUB_BIDI_TYPE_NSM, 230},
{0x347, 0x349, GRUB_BIDI_TYPE_NSM, 220},
{0x34a, 0x34c, GRUB_BIDI_TYPE_NSM, 230},
{0x34d, 0x34e, GRUB_BIDI_TYPE_NSM, 220},
{0x34f, 0x34f, GRUB_BIDI_TYPE_NSM, 255},
{0x350, 0x352, GRUB_BIDI_TYPE_NSM, 230},
{0x353, 0x356, GRUB_BIDI_TYPE_NSM, 220},
{0x357, 0x357, GRUB_BIDI_TYPE_NSM, 230},
{0x358, 0x358, GRUB_BIDI_TYPE_NSM, 232},
{0x359, 0x35a, GRUB_BIDI_TYPE_NSM, 220},
{0x35b, 0x35b, GRUB_BIDI_TYPE_NSM, 230},
{0x35c, 0x35c, GRUB_BIDI_TYPE_NSM, 233},
{0x35d, 0x35e, GRUB_BIDI_TYPE_NSM, 234},
{0x35f, 0x35f, GRUB_BIDI_TYPE_NSM, 233},
{0x360, 0x361, GRUB_BIDI_TYPE_NSM, 234},
{0x362, 0x362, GRUB_BIDI_TYPE_NSM, 233},
{0x363, 0x36f, GRUB_BIDI_TYPE_NSM, 230},
{0x374, 0x375, GRUB_BIDI_TYPE_ON, 0},
{0x37e, 0x37e, GRUB_BIDI_TYPE_ON, 0},
{0x384, 0x385, GRUB_BIDI_TYPE_ON, 0},
{0x387, 0x387, GRUB_BIDI_TYPE_ON, 0},
{0x3f6, 0x3f6, GRUB_BIDI_TYPE_ON, 0},
{0x483, 0x487, GRUB_BIDI_TYPE_NSM, 230},
{0x488, 0x489, GRUB_BIDI_TYPE_NSM, 253},
{0x58a, 0x58a, GRUB_BIDI_TYPE_ON, 0},
{0x591, 0x591, GRUB_BIDI_TYPE_NSM, 220},
{0x592, 0x595, GRUB_BIDI_TYPE_NSM, 230},
{0x596, 0x596, GRUB_BIDI_TYPE_NSM, 220},
{0x597, 0x599, GRUB_BIDI_TYPE_NSM, 230},
{0x59a, 0x59a, GRUB_BIDI_TYPE_NSM, 222},
{0x59b, 0x59b, GRUB_BIDI_TYPE_NSM, 220},
{0x59c, 0x5a1, GRUB_BIDI_TYPE_NSM, 230},
{0x5a2, 0x5a7, GRUB_BIDI_TYPE_NSM, 220},
{0x5a8, 0x5a9, GRUB_BIDI_TYPE_NSM, 230},
{0x5aa, 0x5aa, GRUB_BIDI_TYPE_NSM, 220},
{0x5ab, 0x5ac, GRUB_BIDI_TYPE_NSM, 230},
{0x5ad, 0x5ad, GRUB_BIDI_TYPE_NSM, 222},
{0x5ae, 0x5ae, GRUB_BIDI_TYPE_NSM, 228},
{0x5af, 0x5af, GRUB_BIDI_TYPE_NSM, 230},
{0x5b0, 0x5b0, GRUB_BIDI_TYPE_NSM, 10},
{0x5b1, 0x5b1, GRUB_BIDI_TYPE_NSM, 11},
{0x5b2, 0x5b2, GRUB_BIDI_TYPE_NSM, 12},
{0x5b3, 0x5b3, GRUB_BIDI_TYPE_NSM, 13},
{0x5b4, 0x5b4, GRUB_BIDI_TYPE_NSM, 14},
{0x5b5, 0x5b5, GRUB_BIDI_TYPE_NSM, 15},
{0x5b6, 0x5b6, GRUB_BIDI_TYPE_NSM, 16},
{0x5b7, 0x5b7, GRUB_BIDI_TYPE_NSM, 17},
{0x5b8, 0x5b8, GRUB_BIDI_TYPE_NSM, 18},
{0x5b9, 0x5ba, GRUB_BIDI_TYPE_NSM, 19},
{0x5bb, 0x5bb, GRUB_BIDI_TYPE_NSM, 20},
{0x5bc, 0x5bc, GRUB_BIDI_TYPE_NSM, 21},
{0x5bd, 0x5bd, GRUB_BIDI_TYPE_NSM, 22},
{0x5be, 0x5be, GRUB_BIDI_TYPE_R, 0},
{0x5bf, 0x5bf, GRUB_BIDI_TYPE_NSM, 23},
{0x5c0, 0x5c0, GRUB_BIDI_TYPE_R, 0},
{0x5c1, 0x5c1, GRUB_BIDI_TYPE_NSM, 24},
{0x5c2, 0x5c2, GRUB_BIDI_TYPE_NSM, 25},
{0x5c3, 0x5c3, GRUB_BIDI_TYPE_R, 0},
{0x5c4, 0x5c4, GRUB_BIDI_TYPE_NSM, 230},
{0x5c5, 0x5c5, GRUB_BIDI_TYPE_NSM, 220},
{0x5c6, 0x5c6, GRUB_BIDI_TYPE_R, 0},
{0x5c7, 0x5c7, GRUB_BIDI_TYPE_NSM, 18},
{0x5d0, 0x5ea, GRUB_BIDI_TYPE_R, 0},
{0x5f0, 0x5f4, GRUB_BIDI_TYPE_R, 0},
{0x600, 0x603, GRUB_BIDI_TYPE_AN, 0},
{0x606, 0x607, GRUB_BIDI_TYPE_ON, 0},
{0x608, 0x608, GRUB_BIDI_TYPE_AL, 0},
{0x609, 0x60a, GRUB_BIDI_TYPE_ET, 0},
{0x60b, 0x60b, GRUB_BIDI_TYPE_AL, 0},
{0x60c, 0x60c, GRUB_BIDI_TYPE_CS, 0},
{0x60d, 0x60d, GRUB_BIDI_TYPE_AL, 0},
{0x60e, 0x60f, GRUB_BIDI_TYPE_ON, 0},
{0x610, 0x617, GRUB_BIDI_TYPE_NSM, 230},
{0x618, 0x618, GRUB_BIDI_TYPE_NSM, 30},
{0x619, 0x619, GRUB_BIDI_TYPE_NSM, 31},
{0x61a, 0x61a, GRUB_BIDI_TYPE_NSM, 32},
{0x61b, 0x61b, GRUB_BIDI_TYPE_AL, 0},
{0x61e, 0x61f, GRUB_BIDI_TYPE_AL, 0},
{0x621, 0x64a, GRUB_BIDI_TYPE_AL, 0},
{0x64b, 0x64b, GRUB_BIDI_TYPE_NSM, 27},
{0x64c, 0x64c, GRUB_BIDI_TYPE_NSM, 28},
{0x64d, 0x64d, GRUB_BIDI_TYPE_NSM, 29},
{0x64e, 0x64e, GRUB_BIDI_TYPE_NSM, 30},
{0x64f, 0x64f, GRUB_BIDI_TYPE_NSM, 31},
{0x650, 0x650, GRUB_BIDI_TYPE_NSM, 32},
{0x651, 0x651, GRUB_BIDI_TYPE_NSM, 33},
{0x652, 0x652, GRUB_BIDI_TYPE_NSM, 34},
{0x653, 0x654, GRUB_BIDI_TYPE_NSM, 230},
{0x655, 0x656, GRUB_BIDI_TYPE_NSM, 220},
{0x657, 0x65b, GRUB_BIDI_TYPE_NSM, 230},
{0x65c, 0x65c, GRUB_BIDI_TYPE_NSM, 220},
{0x65d, 0x65e, GRUB_BIDI_TYPE_NSM, 230},
{0x660, 0x669, GRUB_BIDI_TYPE_AN, 0},
{0x66a, 0x66a, GRUB_BIDI_TYPE_ET, 0},
{0x66b, 0x66c, GRUB_BIDI_TYPE_AN, 0},
{0x66d, 0x66f, GRUB_BIDI_TYPE_AL, 0},
{0x670, 0x670, GRUB_BIDI_TYPE_NSM, 35},
{0x671, 0x6d5, GRUB_BIDI_TYPE_AL, 0},
{0x6d6, 0x6dc, GRUB_BIDI_TYPE_NSM, 230},
{0x6dd, 0x6dd, GRUB_BIDI_TYPE_AN, 0},
{0x6de, 0x6de, GRUB_BIDI_TYPE_NSM, 253},
{0x6df, 0x6e2, GRUB_BIDI_TYPE_NSM, 230},
{0x6e3, 0x6e3, GRUB_BIDI_TYPE_NSM, 220},
{0x6e4, 0x6e4, GRUB_BIDI_TYPE_NSM, 230},
{0x6e5, 0x6e6, GRUB_BIDI_TYPE_AL, 0},
{0x6e7, 0x6e8, GRUB_BIDI_TYPE_NSM, 230},
{0x6e9, 0x6e9, GRUB_BIDI_TYPE_ON, 0},
{0x6ea, 0x6ea, GRUB_BIDI_TYPE_NSM, 220},
{0x6eb, 0x6ec, GRUB_BIDI_TYPE_NSM, 230},
{0x6ed, 0x6ed, GRUB_BIDI_TYPE_NSM, 220},
{0x6ee, 0x6ef, GRUB_BIDI_TYPE_AL, 0},
{0x6f0, 0x6f9, GRUB_BIDI_TYPE_EN, 0},
{0x6fa, 0x70d, GRUB_BIDI_TYPE_AL, 0},
{0x70f, 0x70f, GRUB_BIDI_TYPE_BN, 0},
{0x710, 0x710, GRUB_BIDI_TYPE_AL, 0},
{0x711, 0x711, GRUB_BIDI_TYPE_NSM, 36},
{0x712, 0x72f, GRUB_BIDI_TYPE_AL, 0},
{0x730, 0x730, GRUB_BIDI_TYPE_NSM, 230},
{0x731, 0x731, GRUB_BIDI_TYPE_NSM, 220},
{0x732, 0x733, GRUB_BIDI_TYPE_NSM, 230},
{0x734, 0x734, GRUB_BIDI_TYPE_NSM, 220},
{0x735, 0x736, GRUB_BIDI_TYPE_NSM, 230},
{0x737, 0x739, GRUB_BIDI_TYPE_NSM, 220},
{0x73a, 0x73a, GRUB_BIDI_TYPE_NSM, 230},
{0x73b, 0x73c, GRUB_BIDI_TYPE_NSM, 220},
{0x73d, 0x73d, GRUB_BIDI_TYPE_NSM, 230},
{0x73e, 0x73e, GRUB_BIDI_TYPE_NSM, 220},
{0x73f, 0x741, GRUB_BIDI_TYPE_NSM, 230},
{0x742, 0x742, GRUB_BIDI_TYPE_NSM, 220},
{0x743, 0x743, GRUB_BIDI_TYPE_NSM, 230},
{0x744, 0x744, GRUB_BIDI_TYPE_NSM, 220},
{0x745, 0x745, GRUB_BIDI_TYPE_NSM, 230},
{0x746, 0x746, GRUB_BIDI_TYPE_NSM, 220},
{0x747, 0x747, GRUB_BIDI_TYPE_NSM, 230},
{0x748, 0x748, GRUB_BIDI_TYPE_NSM, 220},
{0x749, 0x74a, GRUB_BIDI_TYPE_NSM, 230},
{0x74d, 0x7a5, GRUB_BIDI_TYPE_AL, 0},
{0x7a6, 0x7b0, GRUB_BIDI_TYPE_NSM, 255},
{0x7b1, 0x7b1, GRUB_BIDI_TYPE_AL, 0},
{0x7c0, 0x7ea, GRUB_BIDI_TYPE_R, 0},
{0x7eb, 0x7f1, GRUB_BIDI_TYPE_NSM, 230},
{0x7f2, 0x7f2, GRUB_BIDI_TYPE_NSM, 220},
{0x7f3, 0x7f3, GRUB_BIDI_TYPE_NSM, 230},
{0x7f4, 0x7f5, GRUB_BIDI_TYPE_R, 0},
{0x7f6, 0x7f9, GRUB_BIDI_TYPE_ON, 0},
{0x7fa, 0x7fa, GRUB_BIDI_TYPE_R, 0},
{0x901, 0x902, GRUB_BIDI_TYPE_NSM, 255},
{0x903, 0x903, GRUB_BIDI_TYPE_L, 254},
{0x93c, 0x93c, GRUB_BIDI_TYPE_NSM, 7},
{0x93e, 0x940, GRUB_BIDI_TYPE_L, 254},
{0x941, 0x948, GRUB_BIDI_TYPE_NSM, 255},
{0x949, 0x94c, GRUB_BIDI_TYPE_L, 254},
{0x94d, 0x94d, GRUB_BIDI_TYPE_NSM, 9},
{0x951, 0x951, GRUB_BIDI_TYPE_NSM, 230},
{0x952, 0x952, GRUB_BIDI_TYPE_NSM, 220},
{0x953, 0x954, GRUB_BIDI_TYPE_NSM, 230},
{0x962, 0x963, GRUB_BIDI_TYPE_NSM, 255},
{0x981, 0x981, GRUB_BIDI_TYPE_NSM, 255},
{0x982, 0x983, GRUB_BIDI_TYPE_L, 254},
{0x9bc, 0x9bc, GRUB_BIDI_TYPE_NSM, 7},
{0x9be, 0x9c0, GRUB_BIDI_TYPE_L, 254},
{0x9c1, 0x9c4, GRUB_BIDI_TYPE_NSM, 255},
{0x9c7, 0x9c8, GRUB_BIDI_TYPE_L, 254},
{0x9cb, 0x9cc, GRUB_BIDI_TYPE_L, 254},
{0x9cd, 0x9cd, GRUB_BIDI_TYPE_NSM, 9},
{0x9d7, 0x9d7, GRUB_BIDI_TYPE_L, 254},
{0x9e2, 0x9e3, GRUB_BIDI_TYPE_NSM, 255},
{0x9f2, 0x9f3, GRUB_BIDI_TYPE_ET, 0},
{0xa01, 0xa02, GRUB_BIDI_TYPE_NSM, 255},
{0xa03, 0xa03, GRUB_BIDI_TYPE_L, 254},
{0xa3c, 0xa3c, GRUB_BIDI_TYPE_NSM, 7},
{0xa3e, 0xa40, GRUB_BIDI_TYPE_L, 254},
{0xa41, 0xa42, GRUB_BIDI_TYPE_NSM, 255},
{0xa47, 0xa48, GRUB_BIDI_TYPE_NSM, 255},
{0xa4b, 0xa4c, GRUB_BIDI_TYPE_NSM, 255},
{0xa4d, 0xa4d, GRUB_BIDI_TYPE_NSM, 9},
{0xa51, 0xa51, GRUB_BIDI_TYPE_NSM, 255},
{0xa70, 0xa71, GRUB_BIDI_TYPE_NSM, 255},
{0xa75, 0xa75, GRUB_BIDI_TYPE_NSM, 255},
{0xa81, 0xa82, GRUB_BIDI_TYPE_NSM, 255},
{0xa83, 0xa83, GRUB_BIDI_TYPE_L, 254},
{0xabc, 0xabc, GRUB_BIDI_TYPE_NSM, 7},
{0xabe, 0xac0, GRUB_BIDI_TYPE_L, 254},
{0xac1, 0xac5, GRUB_BIDI_TYPE_NSM, 255},
{0xac7, 0xac8, GRUB_BIDI_TYPE_NSM, 255},
{0xac9, 0xac9, GRUB_BIDI_TYPE_L, 254},
{0xacb, 0xacc, GRUB_BIDI_TYPE_L, 254},
{0xacd, 0xacd, GRUB_BIDI_TYPE_NSM, 9},
{0xae2, 0xae3, GRUB_BIDI_TYPE_NSM, 255},
{0xaf1, 0xaf1, GRUB_BIDI_TYPE_ET, 0},
{0xb01, 0xb01, GRUB_BIDI_TYPE_NSM, 255},
{0xb02, 0xb03, GRUB_BIDI_TYPE_L, 254},
{0xb3c, 0xb3c, GRUB_BIDI_TYPE_NSM, 7},
{0xb3e, 0xb3e, GRUB_BIDI_TYPE_L, 254},
{0xb3f, 0xb3f, GRUB_BIDI_TYPE_NSM, 255},
{0xb40, 0xb40, GRUB_BIDI_TYPE_L, 254},
{0xb41, 0xb44, GRUB_BIDI_TYPE_NSM, 255},
{0xb47, 0xb48, GRUB_BIDI_TYPE_L, 254},
{0xb4b, 0xb4c, GRUB_BIDI_TYPE_L, 254},
{0xb4d, 0xb4d, GRUB_BIDI_TYPE_NSM, 9},
{0xb56, 0xb56, GRUB_BIDI_TYPE_NSM, 255},
{0xb57, 0xb57, GRUB_BIDI_TYPE_L, 254},
{0xb62, 0xb63, GRUB_BIDI_TYPE_NSM, 255},
{0xb82, 0xb82, GRUB_BIDI_TYPE_NSM, 255},
{0xbbe, 0xbbf, GRUB_BIDI_TYPE_L, 254},
{0xbc0, 0xbc0, GRUB_BIDI_TYPE_NSM, 255},
{0xbc1, 0xbc2, GRUB_BIDI_TYPE_L, 254},
{0xbc6, 0xbc8, GRUB_BIDI_TYPE_L, 254},
{0xbca, 0xbcc, GRUB_BIDI_TYPE_L, 254},
{0xbcd, 0xbcd, GRUB_BIDI_TYPE_NSM, 9},
{0xbd7, 0xbd7, GRUB_BIDI_TYPE_L, 254},
{0xbf3, 0xbf8, GRUB_BIDI_TYPE_ON, 0},
{0xbf9, 0xbf9, GRUB_BIDI_TYPE_ET, 0},
{0xbfa, 0xbfa, GRUB_BIDI_TYPE_ON, 0},
{0xc01, 0xc03, GRUB_BIDI_TYPE_L, 254},
{0xc3e, 0xc40, GRUB_BIDI_TYPE_NSM, 255},
{0xc41, 0xc44, GRUB_BIDI_TYPE_L, 254},
{0xc46, 0xc48, GRUB_BIDI_TYPE_NSM, 255},
{0xc4a, 0xc4c, GRUB_BIDI_TYPE_NSM, 255},
{0xc4d, 0xc4d, GRUB_BIDI_TYPE_NSM, 9},
{0xc55, 0xc55, GRUB_BIDI_TYPE_NSM, 84},
{0xc56, 0xc56, GRUB_BIDI_TYPE_NSM, 91},
{0xc62, 0xc63, GRUB_BIDI_TYPE_NSM, 255},
{0xc78, 0xc7e, GRUB_BIDI_TYPE_ON, 0},
{0xc82, 0xc83, GRUB_BIDI_TYPE_L, 254},
{0xcbc, 0xcbc, GRUB_BIDI_TYPE_NSM, 7},
{0xcbe, 0xcbe, GRUB_BIDI_TYPE_L, 254},
{0xcbf, 0xcbf, GRUB_BIDI_TYPE_L, 255},
{0xcc0, 0xcc4, GRUB_BIDI_TYPE_L, 254},
{0xcc6, 0xcc6, GRUB_BIDI_TYPE_L, 255},
{0xcc7, 0xcc8, GRUB_BIDI_TYPE_L, 254},
{0xcca, 0xccb, GRUB_BIDI_TYPE_L, 254},
{0xccc, 0xccc, GRUB_BIDI_TYPE_NSM, 255},
{0xccd, 0xccd, GRUB_BIDI_TYPE_NSM, 9},
{0xcd5, 0xcd6, GRUB_BIDI_TYPE_L, 254},
{0xce2, 0xce3, GRUB_BIDI_TYPE_NSM, 255},
{0xcf1, 0xcf2, GRUB_BIDI_TYPE_ON, 0},
{0xd02, 0xd03, GRUB_BIDI_TYPE_L, 254},
{0xd3e, 0xd40, GRUB_BIDI_TYPE_L, 254},
{0xd41, 0xd44, GRUB_BIDI_TYPE_NSM, 255},
{0xd46, 0xd48, GRUB_BIDI_TYPE_L, 254},
{0xd4a, 0xd4c, GRUB_BIDI_TYPE_L, 254},
{0xd4d, 0xd4d, GRUB_BIDI_TYPE_NSM, 9},
{0xd57, 0xd57, GRUB_BIDI_TYPE_L, 254},
{0xd62, 0xd63, GRUB_BIDI_TYPE_NSM, 255},
{0xd82, 0xd83, GRUB_BIDI_TYPE_L, 254},
{0xdca, 0xdca, GRUB_BIDI_TYPE_NSM, 9},
{0xdcf, 0xdd1, GRUB_BIDI_TYPE_L, 254},
{0xdd2, 0xdd4, GRUB_BIDI_TYPE_NSM, 255},
{0xdd6, 0xdd6, GRUB_BIDI_TYPE_NSM, 255},
{0xdd8, 0xddf, GRUB_BIDI_TYPE_L, 254},
{0xdf2, 0xdf3, GRUB_BIDI_TYPE_L, 254},
{0xe31, 0xe31, GRUB_BIDI_TYPE_NSM, 255},
{0xe34, 0xe37, GRUB_BIDI_TYPE_NSM, 255},
{0xe38, 0xe39, GRUB_BIDI_TYPE_NSM, 103},
{0xe3a, 0xe3a, GRUB_BIDI_TYPE_NSM, 9},
{0xe3f, 0xe3f, GRUB_BIDI_TYPE_ET, 0},
{0xe47, 0xe47, GRUB_BIDI_TYPE_NSM, 255},
{0xe48, 0xe4b, GRUB_BIDI_TYPE_NSM, 107},
{0xe4c, 0xe4e, GRUB_BIDI_TYPE_NSM, 255},
{0xeb1, 0xeb1, GRUB_BIDI_TYPE_NSM, 255},
{0xeb4, 0xeb7, GRUB_BIDI_TYPE_NSM, 255},
{0xeb8, 0xeb9, GRUB_BIDI_TYPE_NSM, 118},
{0xebb, 0xebc, GRUB_BIDI_TYPE_NSM, 255},
{0xec8, 0xecb, GRUB_BIDI_TYPE_NSM, 122},
{0xecc, 0xecd, GRUB_BIDI_TYPE_NSM, 255},
{0xf18, 0xf19, GRUB_BIDI_TYPE_NSM, 220},
{0xf35, 0xf35, GRUB_BIDI_TYPE_NSM, 220},
{0xf37, 0xf37, GRUB_BIDI_TYPE_NSM, 220},
{0xf39, 0xf39, GRUB_BIDI_TYPE_NSM, 216},
{0xf3a, 0xf3d, GRUB_BIDI_TYPE_ON, 0},
{0xf3e, 0xf3f, GRUB_BIDI_TYPE_L, 254},
{0xf71, 0xf71, GRUB_BIDI_TYPE_NSM, 129},
{0xf72, 0xf72, GRUB_BIDI_TYPE_NSM, 130},
{0xf73, 0xf73, GRUB_BIDI_TYPE_NSM, 255},
{0xf74, 0xf74, GRUB_BIDI_TYPE_NSM, 132},
{0xf75, 0xf79, GRUB_BIDI_TYPE_NSM, 255},
{0xf7a, 0xf7d, GRUB_BIDI_TYPE_NSM, 130},
{0xf7e, 0xf7e, GRUB_BIDI_TYPE_NSM, 255},
{0xf7f, 0xf7f, GRUB_BIDI_TYPE_L, 254},
{0xf80, 0xf80, GRUB_BIDI_TYPE_NSM, 130},
{0xf81, 0xf81, GRUB_BIDI_TYPE_NSM, 255},
{0xf82, 0xf83, GRUB_BIDI_TYPE_NSM, 230},
{0xf84, 0xf84, GRUB_BIDI_TYPE_NSM, 9},
{0xf86, 0xf87, GRUB_BIDI_TYPE_NSM, 230},
{0xf90, 0xf97, GRUB_BIDI_TYPE_NSM, 255},
{0xf99, 0xfbc, GRUB_BIDI_TYPE_NSM, 255},
{0xfc6, 0xfc6, GRUB_BIDI_TYPE_NSM, 220},
{0x102b, 0x102c, GRUB_BIDI_TYPE_L, 254},
{0x102d, 0x1030, GRUB_BIDI_TYPE_NSM, 255},
{0x1031, 0x1031, GRUB_BIDI_TYPE_L, 254},
{0x1032, 0x1036, GRUB_BIDI_TYPE_NSM, 255},
{0x1037, 0x1037, GRUB_BIDI_TYPE_NSM, 7},
{0x1038, 0x1038, GRUB_BIDI_TYPE_L, 254},
{0x1039, 0x103a, GRUB_BIDI_TYPE_NSM, 9},
{0x103b, 0x103c, GRUB_BIDI_TYPE_L, 254},
{0x103d, 0x103e, GRUB_BIDI_TYPE_NSM, 255},
{0x1056, 0x1057, GRUB_BIDI_TYPE_L, 254},
{0x1058, 0x1059, GRUB_BIDI_TYPE_NSM, 255},
{0x105e, 0x1060, GRUB_BIDI_TYPE_NSM, 255},
{0x1062, 0x1064, GRUB_BIDI_TYPE_L, 254},
{0x1067, 0x106d, GRUB_BIDI_TYPE_L, 254},
{0x1071, 0x1074, GRUB_BIDI_TYPE_NSM, 255},
{0x1082, 0x1082, GRUB_BIDI_TYPE_NSM, 255},
{0x1083, 0x1084, GRUB_BIDI_TYPE_L, 254},
{0x1085, 0x1086, GRUB_BIDI_TYPE_NSM, 255},
{0x1087, 0x108c, GRUB_BIDI_TYPE_L, 254},
{0x108d, 0x108d, GRUB_BIDI_TYPE_NSM, 220},
{0x108f, 0x108f, GRUB_BIDI_TYPE_L, 254},
{0x135f, 0x135f, GRUB_BIDI_TYPE_NSM, 230},
{0x1390, 0x1399, GRUB_BIDI_TYPE_ON, 0},
{0x1680, 0x1680, GRUB_BIDI_TYPE_WS, 0},
{0x169b, 0x169c, GRUB_BIDI_TYPE_ON, 0},
{0x1712, 0x1713, GRUB_BIDI_TYPE_NSM, 255},
{0x1714, 0x1714, GRUB_BIDI_TYPE_NSM, 9},
{0x1732, 0x1733, GRUB_BIDI_TYPE_NSM, 255},
{0x1734, 0x1734, GRUB_BIDI_TYPE_NSM, 9},
{0x1752, 0x1753, GRUB_BIDI_TYPE_NSM, 255},
{0x1772, 0x1773, GRUB_BIDI_TYPE_NSM, 255},
{0x17b6, 0x17b6, GRUB_BIDI_TYPE_L, 254},
{0x17b7, 0x17bd, GRUB_BIDI_TYPE_NSM, 255},
{0x17be, 0x17c5, GRUB_BIDI_TYPE_L, 254},
{0x17c6, 0x17c6, GRUB_BIDI_TYPE_NSM, 255},
{0x17c7, 0x17c8, GRUB_BIDI_TYPE_L, 254},
{0x17c9, 0x17d1, GRUB_BIDI_TYPE_NSM, 255},
{0x17d2, 0x17d2, GRUB_BIDI_TYPE_NSM, 9},
{0x17d3, 0x17d3, GRUB_BIDI_TYPE_NSM, 255},
{0x17db, 0x17db, GRUB_BIDI_TYPE_ET, 0},
{0x17dd, 0x17dd, GRUB_BIDI_TYPE_NSM, 230},
{0x17f0, 0x17f9, GRUB_BIDI_TYPE_ON, 0},
{0x1800, 0x180a, GRUB_BIDI_TYPE_ON, 0},
{0x180b, 0x180d, GRUB_BIDI_TYPE_NSM, 255},
{0x180e, 0x180e, GRUB_BIDI_TYPE_WS, 0},
{0x18a9, 0x18a9, GRUB_BIDI_TYPE_NSM, 228},
{0x1920, 0x1922, GRUB_BIDI_TYPE_NSM, 255},
{0x1923, 0x1926, GRUB_BIDI_TYPE_L, 254},
{0x1927, 0x1928, GRUB_BIDI_TYPE_NSM, 255},
{0x1929, 0x192b, GRUB_BIDI_TYPE_L, 254},
{0x1930, 0x1931, GRUB_BIDI_TYPE_L, 254},
{0x1932, 0x1932, GRUB_BIDI_TYPE_NSM, 255},
{0x1933, 0x1938, GRUB_BIDI_TYPE_L, 254},
{0x1939, 0x1939, GRUB_BIDI_TYPE_NSM, 222},
{0x193a, 0x193a, GRUB_BIDI_TYPE_NSM, 230},
{0x193b, 0x193b, GRUB_BIDI_TYPE_NSM, 220},
{0x1940, 0x1940, GRUB_BIDI_TYPE_ON, 0},
{0x1944, 0x1945, GRUB_BIDI_TYPE_ON, 0},
{0x19b0, 0x19c0, GRUB_BIDI_TYPE_L, 254},
{0x19c8, 0x19c9, GRUB_BIDI_TYPE_L, 254},
{0x19de, 0x19ff, GRUB_BIDI_TYPE_ON, 0},
{0x1a17, 0x1a17, GRUB_BIDI_TYPE_NSM, 230},
{0x1a18, 0x1a18, GRUB_BIDI_TYPE_NSM, 220},
{0x1a19, 0x1a1b, GRUB_BIDI_TYPE_L, 254},
{0x1b00, 0x1b03, GRUB_BIDI_TYPE_NSM, 255},
{0x1b04, 0x1b04, GRUB_BIDI_TYPE_L, 254},
{0x1b34, 0x1b34, GRUB_BIDI_TYPE_NSM, 7},
{0x1b35, 0x1b35, GRUB_BIDI_TYPE_L, 254},
{0x1b36, 0x1b3a, GRUB_BIDI_TYPE_NSM, 255},
{0x1b3b, 0x1b3b, GRUB_BIDI_TYPE_L, 254},
{0x1b3c, 0x1b3c, GRUB_BIDI_TYPE_NSM, 255},
{0x1b3d, 0x1b41, GRUB_BIDI_TYPE_L, 254},
{0x1b42, 0x1b42, GRUB_BIDI_TYPE_NSM, 255},
{0x1b43, 0x1b43, GRUB_BIDI_TYPE_L, 254},
{0x1b44, 0x1b44, GRUB_BIDI_TYPE_L, 9},
{0x1b6b, 0x1b6b, GRUB_BIDI_TYPE_NSM, 230},
{0x1b6c, 0x1b6c, GRUB_BIDI_TYPE_NSM, 220},
{0x1b6d, 0x1b73, GRUB_BIDI_TYPE_NSM, 230},
{0x1b80, 0x1b81, GRUB_BIDI_TYPE_NSM, 255},
{0x1b82, 0x1b82, GRUB_BIDI_TYPE_L, 254},
{0x1ba1, 0x1ba1, GRUB_BIDI_TYPE_L, 254},
{0x1ba2, 0x1ba5, GRUB_BIDI_TYPE_NSM, 255},
{0x1ba6, 0x1ba7, GRUB_BIDI_TYPE_L, 254},
{0x1ba8, 0x1ba9, GRUB_BIDI_TYPE_NSM, 255},
{0x1baa, 0x1baa, GRUB_BIDI_TYPE_L, 9},
{0x1c24, 0x1c2b, GRUB_BIDI_TYPE_L, 254},
{0x1c2c, 0x1c33, GRUB_BIDI_TYPE_NSM, 255},
{0x1c34, 0x1c35, GRUB_BIDI_TYPE_L, 254},
{0x1c36, 0x1c36, GRUB_BIDI_TYPE_NSM, 255},
{0x1c37, 0x1c37, GRUB_BIDI_TYPE_NSM, 7},
{0x1dc0, 0x1dc1, GRUB_BIDI_TYPE_NSM, 230},
{0x1dc2, 0x1dc2, GRUB_BIDI_TYPE_NSM, 220},
{0x1dc3, 0x1dc9, GRUB_BIDI_TYPE_NSM, 230},
{0x1dca, 0x1dca, GRUB_BIDI_TYPE_NSM, 220},
{0x1dcb, 0x1dcc, GRUB_BIDI_TYPE_NSM, 230},
{0x1dcd, 0x1dcd, GRUB_BIDI_TYPE_NSM, 234},
{0x1dce, 0x1dce, GRUB_BIDI_TYPE_NSM, 214},
{0x1dcf, 0x1dcf, GRUB_BIDI_TYPE_NSM, 220},
{0x1dd0, 0x1dd0, GRUB_BIDI_TYPE_NSM, 202},
{0x1dd1, 0x1de6, GRUB_BIDI_TYPE_NSM, 230},
{0x1dfe, 0x1dfe, GRUB_BIDI_TYPE_NSM, 230},
{0x1dff, 0x1dff, GRUB_BIDI_TYPE_NSM, 220},
{0x1fbd, 0x1fbd, GRUB_BIDI_TYPE_ON, 0},
{0x1fbf, 0x1fc1, GRUB_BIDI_TYPE_ON, 0},
{0x1fcd, 0x1fcf, GRUB_BIDI_TYPE_ON, 0},
{0x1fdd, 0x1fdf, GRUB_BIDI_TYPE_ON, 0},
{0x1fed, 0x1fef, GRUB_BIDI_TYPE_ON, 0},
{0x1ffd, 0x1ffe, GRUB_BIDI_TYPE_ON, 0},
{0x2000, 0x200a, GRUB_BIDI_TYPE_WS, 0},
{0x200b, 0x200d, GRUB_BIDI_TYPE_BN, 0},
{0x200f, 0x200f, GRUB_BIDI_TYPE_R, 0},
{0x2010, 0x2027, GRUB_BIDI_TYPE_ON, 0},
{0x2028, 0x2028, GRUB_BIDI_TYPE_WS, 0},
{0x2029, 0x2029, GRUB_BIDI_TYPE_B, 0},
{0x202a, 0x202a, GRUB_BIDI_TYPE_LRE, 0},
{0x202b, 0x202b, GRUB_BIDI_TYPE_RLE, 0},
{0x202c, 0x202c, GRUB_BIDI_TYPE_PDF, 0},
{0x202d, 0x202d, GRUB_BIDI_TYPE_LRO, 0},
{0x202e, 0x202e, GRUB_BIDI_TYPE_RLO, 0},
{0x202f, 0x202f, GRUB_BIDI_TYPE_CS, 0},
{0x2030, 0x2034, GRUB_BIDI_TYPE_ET, 0},
{0x2035, 0x2043, GRUB_BIDI_TYPE_ON, 0},
{0x2044, 0x2044, GRUB_BIDI_TYPE_CS, 0},
{0x2045, 0x205e, GRUB_BIDI_TYPE_ON, 0},
{0x205f, 0x205f, GRUB_BIDI_TYPE_WS, 0},
{0x2060, 0x2064, GRUB_BIDI_TYPE_BN, 0},
{0x206a, 0x206f, GRUB_BIDI_TYPE_BN, 0},
{0x2070, 0x2070, GRUB_BIDI_TYPE_EN, 0},
{0x2074, 0x2079, GRUB_BIDI_TYPE_EN, 0},
{0x207a, 0x207b, GRUB_BIDI_TYPE_ES, 0},
{0x207c, 0x207e, GRUB_BIDI_TYPE_ON, 0},
{0x2080, 0x2089, GRUB_BIDI_TYPE_EN, 0},
{0x208a, 0x208b, GRUB_BIDI_TYPE_ES, 0},
{0x208c, 0x208e, GRUB_BIDI_TYPE_ON, 0},
{0x20a0, 0x20b5, GRUB_BIDI_TYPE_ET, 0},
{0x20d0, 0x20d1, GRUB_BIDI_TYPE_NSM, 230},
{0x20d2, 0x20d3, GRUB_BIDI_TYPE_NSM, 1},
{0x20d4, 0x20d7, GRUB_BIDI_TYPE_NSM, 230},
{0x20d8, 0x20da, GRUB_BIDI_TYPE_NSM, 1},
{0x20db, 0x20dc, GRUB_BIDI_TYPE_NSM, 230},
{0x20dd, 0x20e0, GRUB_BIDI_TYPE_NSM, 253},
{0x20e1, 0x20e1, GRUB_BIDI_TYPE_NSM, 230},
{0x20e2, 0x20e4, GRUB_BIDI_TYPE_NSM, 253},
{0x20e5, 0x20e6, GRUB_BIDI_TYPE_NSM, 1},
{0x20e7, 0x20e7, GRUB_BIDI_TYPE_NSM, 230},
{0x20e8, 0x20e8, GRUB_BIDI_TYPE_NSM, 220},
{0x20e9, 0x20e9, GRUB_BIDI_TYPE_NSM, 230},
{0x20ea, 0x20eb, GRUB_BIDI_TYPE_NSM, 1},
{0x20ec, 0x20ef, GRUB_BIDI_TYPE_NSM, 220},
{0x20f0, 0x20f0, GRUB_BIDI_TYPE_NSM, 230},
{0x2100, 0x2101, GRUB_BIDI_TYPE_ON, 0},
{0x2103, 0x2106, GRUB_BIDI_TYPE_ON, 0},
{0x2108, 0x2109, GRUB_BIDI_TYPE_ON, 0},
{0x2114, 0x2114, GRUB_BIDI_TYPE_ON, 0},
{0x2116, 0x2118, GRUB_BIDI_TYPE_ON, 0},
{0x211e, 0x2123, GRUB_BIDI_TYPE_ON, 0},
{0x2125, 0x2125, GRUB_BIDI_TYPE_ON, 0},
{0x2127, 0x2127, GRUB_BIDI_TYPE_ON, 0},
{0x2129, 0x2129, GRUB_BIDI_TYPE_ON, 0},
{0x212e, 0x212e, GRUB_BIDI_TYPE_ET, 0},
{0x213a, 0x213b, GRUB_BIDI_TYPE_ON, 0},
{0x2140, 0x2144, GRUB_BIDI_TYPE_ON, 0},
{0x214a, 0x214d, GRUB_BIDI_TYPE_ON, 0},
{0x2153, 0x215f, GRUB_BIDI_TYPE_ON, 0},
{0x2190, 0x2211, GRUB_BIDI_TYPE_ON, 0},
{0x2212, 0x2212, GRUB_BIDI_TYPE_ES, 0},
{0x2213, 0x2213, GRUB_BIDI_TYPE_ET, 0},
{0x2214, 0x2335, GRUB_BIDI_TYPE_ON, 0},
{0x237b, 0x2394, GRUB_BIDI_TYPE_ON, 0},
{0x2396, 0x23e7, GRUB_BIDI_TYPE_ON, 0},
{0x2400, 0x2426, GRUB_BIDI_TYPE_ON, 0},
{0x2440, 0x244a, GRUB_BIDI_TYPE_ON, 0},
{0x2460, 0x2487, GRUB_BIDI_TYPE_ON, 0},
{0x2488, 0x249b, GRUB_BIDI_TYPE_EN, 0},
{0x24ea, 0x269d, GRUB_BIDI_TYPE_ON, 0},
{0x26a0, 0x26ab, GRUB_BIDI_TYPE_ON, 0},
{0x26ad, 0x26bc, GRUB_BIDI_TYPE_ON, 0},
{0x26c0, 0x26c3, GRUB_BIDI_TYPE_ON, 0},
{0x2701, 0x2704, GRUB_BIDI_TYPE_ON, 0},
{0x2706, 0x2709, GRUB_BIDI_TYPE_ON, 0},
{0x270c, 0x2727, GRUB_BIDI_TYPE_ON, 0},
{0x2729, 0x274b, GRUB_BIDI_TYPE_ON, 0},
{0x274d, 0x274d, GRUB_BIDI_TYPE_ON, 0},
{0x274f, 0x2752, GRUB_BIDI_TYPE_ON, 0},
{0x2756, 0x2756, GRUB_BIDI_TYPE_ON, 0},
{0x2758, 0x275e, GRUB_BIDI_TYPE_ON, 0},
{0x2761, 0x2794, GRUB_BIDI_TYPE_ON, 0},
{0x2798, 0x27af, GRUB_BIDI_TYPE_ON, 0},
{0x27b1, 0x27be, GRUB_BIDI_TYPE_ON, 0},
{0x27c0, 0x27ca, GRUB_BIDI_TYPE_ON, 0},
{0x27cc, 0x27cc, GRUB_BIDI_TYPE_ON, 0},
{0x27d0, 0x27ff, GRUB_BIDI_TYPE_ON, 0},
{0x2900, 0x2b4c, GRUB_BIDI_TYPE_ON, 0},
{0x2b50, 0x2b54, GRUB_BIDI_TYPE_ON, 0},
{0x2ce5, 0x2cea, GRUB_BIDI_TYPE_ON, 0},
{0x2cf9, 0x2cff, GRUB_BIDI_TYPE_ON, 0},
{0x2de0, 0x2dff, GRUB_BIDI_TYPE_NSM, 230},
{0x2e00, 0x2e30, GRUB_BIDI_TYPE_ON, 0},
{0x2e80, 0x2e99, GRUB_BIDI_TYPE_ON, 0},
{0x2e9b, 0x2ef3, GRUB_BIDI_TYPE_ON, 0},
{0x2f00, 0x2fd5, GRUB_BIDI_TYPE_ON, 0},
{0x2ff0, 0x2ffb, GRUB_BIDI_TYPE_ON, 0},
{0x3000, 0x3000, GRUB_BIDI_TYPE_WS, 0},
{0x3001, 0x3004, GRUB_BIDI_TYPE_ON, 0},
{0x3008, 0x3020, GRUB_BIDI_TYPE_ON, 0},
{0x302a, 0x302a, GRUB_BIDI_TYPE_NSM, 218},
{0x302b, 0x302b, GRUB_BIDI_TYPE_NSM, 228},
{0x302c, 0x302c, GRUB_BIDI_TYPE_NSM, 232},
{0x302d, 0x302d, GRUB_BIDI_TYPE_NSM, 222},
{0x302e, 0x302f, GRUB_BIDI_TYPE_NSM, 224},
{0x3030, 0x3030, GRUB_BIDI_TYPE_ON, 0},
{0x3036, 0x3037, GRUB_BIDI_TYPE_ON, 0},
{0x303d, 0x303f, GRUB_BIDI_TYPE_ON, 0},
{0x3099, 0x309a, GRUB_BIDI_TYPE_NSM, 8},
{0x309b, 0x309c, GRUB_BIDI_TYPE_ON, 0},
{0x30a0, 0x30a0, GRUB_BIDI_TYPE_ON, 0},
{0x30fb, 0x30fb, GRUB_BIDI_TYPE_ON, 0},
{0x31c0, 0x31e3, GRUB_BIDI_TYPE_ON, 0},
{0x321d, 0x321e, GRUB_BIDI_TYPE_ON, 0},
{0x3250, 0x325f, GRUB_BIDI_TYPE_ON, 0},
{0x327c, 0x327e, GRUB_BIDI_TYPE_ON, 0},
{0x32b1, 0x32bf, GRUB_BIDI_TYPE_ON, 0},
{0x32cc, 0x32cf, GRUB_BIDI_TYPE_ON, 0},
{0x3377, 0x337a, GRUB_BIDI_TYPE_ON, 0},
{0x33de, 0x33df, GRUB_BIDI_TYPE_ON, 0},
{0x33ff, 0x33ff, GRUB_BIDI_TYPE_ON, 0},
{0x4dc0, 0x4dff, GRUB_BIDI_TYPE_ON, 0},
{0xa490, 0xa4c6, GRUB_BIDI_TYPE_ON, 0},
{0xa60d, 0xa60f, GRUB_BIDI_TYPE_ON, 0},
{0xa66f, 0xa66f, GRUB_BIDI_TYPE_NSM, 230},
{0xa670, 0xa672, GRUB_BIDI_TYPE_NSM, 253},
{0xa673, 0xa673, GRUB_BIDI_TYPE_ON, 0},
{0xa67c, 0xa67d, GRUB_BIDI_TYPE_NSM, 230},
{0xa67e, 0xa67f, GRUB_BIDI_TYPE_ON, 0},
{0xa700, 0xa721, GRUB_BIDI_TYPE_ON, 0},
{0xa788, 0xa788, GRUB_BIDI_TYPE_ON, 0},
{0xa802, 0xa802, GRUB_BIDI_TYPE_NSM, 255},
{0xa806, 0xa806, GRUB_BIDI_TYPE_NSM, 9},
{0xa80b, 0xa80b, GRUB_BIDI_TYPE_NSM, 255},
{0xa823, 0xa824, GRUB_BIDI_TYPE_L, 254},
{0xa825, 0xa826, GRUB_BIDI_TYPE_NSM, 255},
{0xa827, 0xa827, GRUB_BIDI_TYPE_L, 254},
{0xa828, 0xa82b, GRUB_BIDI_TYPE_ON, 0},
{0xa874, 0xa877, GRUB_BIDI_TYPE_ON, 0},
{0xa880, 0xa881, GRUB_BIDI_TYPE_L, 254},
{0xa8b4, 0xa8c3, GRUB_BIDI_TYPE_L, 254},
{0xa8c4, 0xa8c4, GRUB_BIDI_TYPE_NSM, 9},
{0xa926, 0xa92a, GRUB_BIDI_TYPE_NSM, 255},
{0xa92b, 0xa92d, GRUB_BIDI_TYPE_NSM, 220},
{0xa947, 0xa951, GRUB_BIDI_TYPE_NSM, 255},
{0xa952, 0xa952, GRUB_BIDI_TYPE_L, 254},
{0xa953, 0xa953, GRUB_BIDI_TYPE_L, 9},
{0xaa29, 0xaa2e, GRUB_BIDI_TYPE_NSM, 255},
{0xaa2f, 0xaa30, GRUB_BIDI_TYPE_L, 254},
{0xaa31, 0xaa32, GRUB_BIDI_TYPE_NSM, 255},
{0xaa33, 0xaa34, GRUB_BIDI_TYPE_L, 254},
{0xaa35, 0xaa36, GRUB_BIDI_TYPE_NSM, 255},
{0xaa43, 0xaa43, GRUB_BIDI_TYPE_NSM, 255},
{0xaa4c, 0xaa4c, GRUB_BIDI_TYPE_NSM, 255},
{0xaa4d, 0xaa4d, GRUB_BIDI_TYPE_L, 254},
{0xfb1d, 0xfb1d, GRUB_BIDI_TYPE_R, 0},
{0xfb1e, 0xfb1e, GRUB_BIDI_TYPE_NSM, 26},
{0xfb1f, 0xfb28, GRUB_BIDI_TYPE_R, 0},
{0xfb29, 0xfb29, GRUB_BIDI_TYPE_ES, 0},
{0xfb2a, 0xfb36, GRUB_BIDI_TYPE_R, 0},
{0xfb38, 0xfb3c, GRUB_BIDI_TYPE_R, 0},
{0xfb3e, 0xfb3e, GRUB_BIDI_TYPE_R, 0},
{0xfb40, 0xfb41, GRUB_BIDI_TYPE_R, 0},
{0xfb43, 0xfb44, GRUB_BIDI_TYPE_R, 0},
{0xfb46, 0xfb4f, GRUB_BIDI_TYPE_R, 0},
{0xfb50, 0xfbb1, GRUB_BIDI_TYPE_AL, 0},
{0xfbd3, 0xfd3d, GRUB_BIDI_TYPE_AL, 0},
{0xfd3e, 0xfd3f, GRUB_BIDI_TYPE_ON, 0},
{0xfd50, 0xfd8f, GRUB_BIDI_TYPE_AL, 0},
{0xfd92, 0xfdc7, GRUB_BIDI_TYPE_AL, 0},
{0xfdf0, 0xfdfc, GRUB_BIDI_TYPE_AL, 0},
{0xfdfd, 0xfdfd, GRUB_BIDI_TYPE_ON, 0},
{0xfe00, 0xfe0f, GRUB_BIDI_TYPE_NSM, 255},
{0xfe10, 0xfe19, GRUB_BIDI_TYPE_ON, 0},
{0xfe20, 0xfe26, GRUB_BIDI_TYPE_NSM, 230},
{0xfe30, 0xfe4f, GRUB_BIDI_TYPE_ON, 0},
{0xfe50, 0xfe50, GRUB_BIDI_TYPE_CS, 0},
{0xfe51, 0xfe51, GRUB_BIDI_TYPE_ON, 0},
{0xfe52, 0xfe52, GRUB_BIDI_TYPE_CS, 0},
{0xfe54, 0xfe54, GRUB_BIDI_TYPE_ON, 0},
{0xfe55, 0xfe55, GRUB_BIDI_TYPE_CS, 0},
{0xfe56, 0xfe5e, GRUB_BIDI_TYPE_ON, 0},
{0xfe5f, 0xfe5f, GRUB_BIDI_TYPE_ET, 0},
{0xfe60, 0xfe61, GRUB_BIDI_TYPE_ON, 0},
{0xfe62, 0xfe63, GRUB_BIDI_TYPE_ES, 0},
{0xfe64, 0xfe66, GRUB_BIDI_TYPE_ON, 0},
{0xfe68, 0xfe68, GRUB_BIDI_TYPE_ON, 0},
{0xfe69, 0xfe6a, GRUB_BIDI_TYPE_ET, 0},
{0xfe6b, 0xfe6b, GRUB_BIDI_TYPE_ON, 0},
{0xfe70, 0xfe74, GRUB_BIDI_TYPE_AL, 0},
{0xfe76, 0xfefc, GRUB_BIDI_TYPE_AL, 0},
{0xfeff, 0xfeff, GRUB_BIDI_TYPE_BN, 0},
{0xff01, 0xff02, GRUB_BIDI_TYPE_ON, 0},
{0xff03, 0xff05, GRUB_BIDI_TYPE_ET, 0},
{0xff06, 0xff0a, GRUB_BIDI_TYPE_ON, 0},
{0xff0b, 0xff0b, GRUB_BIDI_TYPE_ES, 0},
{0xff0c, 0xff0c, GRUB_BIDI_TYPE_CS, 0},
{0xff0d, 0xff0d, GRUB_BIDI_TYPE_ES, 0},
{0xff0e, 0xff0f, GRUB_BIDI_TYPE_CS, 0},
{0xff10, 0xff19, GRUB_BIDI_TYPE_EN, 0},
{0xff1a, 0xff1a, GRUB_BIDI_TYPE_CS, 0},
{0xff1b, 0xff20, GRUB_BIDI_TYPE_ON, 0},
{0xff3b, 0xff40, GRUB_BIDI_TYPE_ON, 0},
{0xff5b, 0xff65, GRUB_BIDI_TYPE_ON, 0},
{0xffe0, 0xffe1, GRUB_BIDI_TYPE_ET, 0},
{0xffe2, 0xffe4, GRUB_BIDI_TYPE_ON, 0},
{0xffe5, 0xffe6, GRUB_BIDI_TYPE_ET, 0},
{0xffe8, 0xffee, GRUB_BIDI_TYPE_ON, 0},
{0xfff9, 0xfffd, GRUB_BIDI_TYPE_ON, 0},
{0x10101, 0x10101, GRUB_BIDI_TYPE_ON, 0},
{0x10140, 0x1018a, GRUB_BIDI_TYPE_ON, 0},
{0x10190, 0x1019b, GRUB_BIDI_TYPE_ON, 0},
{0x101fd, 0x101fd, GRUB_BIDI_TYPE_NSM, 220},
{0x10800, 0x10805, GRUB_BIDI_TYPE_R, 0},
{0x10808, 0x10808, GRUB_BIDI_TYPE_R, 0},
{0x1080a, 0x10835, GRUB_BIDI_TYPE_R, 0},
{0x10837, 0x10838, GRUB_BIDI_TYPE_R, 0},
{0x1083c, 0x1083c, GRUB_BIDI_TYPE_R, 0},
{0x1083f, 0x1083f, GRUB_BIDI_TYPE_R, 0},
{0x10900, 0x10919, GRUB_BIDI_TYPE_R, 0},
{0x1091f, 0x1091f, GRUB_BIDI_TYPE_ON, 0},
{0x10920, 0x10939, GRUB_BIDI_TYPE_R, 0},
{0x1093f, 0x1093f, GRUB_BIDI_TYPE_R, 0},
{0x10a00, 0x10a00, GRUB_BIDI_TYPE_R, 0},
{0x10a01, 0x10a03, GRUB_BIDI_TYPE_NSM, 255},
{0x10a05, 0x10a06, GRUB_BIDI_TYPE_NSM, 255},
{0x10a0c, 0x10a0c, GRUB_BIDI_TYPE_NSM, 255},
{0x10a0d, 0x10a0d, GRUB_BIDI_TYPE_NSM, 220},
{0x10a0e, 0x10a0e, GRUB_BIDI_TYPE_NSM, 255},
{0x10a0f, 0x10a0f, GRUB_BIDI_TYPE_NSM, 230},
{0x10a10, 0x10a13, GRUB_BIDI_TYPE_R, 0},
{0x10a15, 0x10a17, GRUB_BIDI_TYPE_R, 0},
{0x10a19, 0x10a33, GRUB_BIDI_TYPE_R, 0},
{0x10a38, 0x10a38, GRUB_BIDI_TYPE_NSM, 230},
{0x10a39, 0x10a39, GRUB_BIDI_TYPE_NSM, 1},
{0x10a3a, 0x10a3a, GRUB_BIDI_TYPE_NSM, 220},
{0x10a3f, 0x10a3f, GRUB_BIDI_TYPE_NSM, 9},
{0x10a40, 0x10a47, GRUB_BIDI_TYPE_R, 0},
{0x10a50, 0x10a58, GRUB_BIDI_TYPE_R, 0},
{0x1d165, 0x1d166, GRUB_BIDI_TYPE_L, 216},
{0x1d167, 0x1d169, GRUB_BIDI_TYPE_NSM, 1},
{0x1d16d, 0x1d16d, GRUB_BIDI_TYPE_L, 226},
{0x1d16e, 0x1d172, GRUB_BIDI_TYPE_L, 216},
{0x1d173, 0x1d17a, GRUB_BIDI_TYPE_BN, 0},
{0x1d17b, 0x1d182, GRUB_BIDI_TYPE_NSM, 220},
{0x1d185, 0x1d189, GRUB_BIDI_TYPE_NSM, 230},
{0x1d18a, 0x1d18b, GRUB_BIDI_TYPE_NSM, 220},
{0x1d1aa, 0x1d1ad, GRUB_BIDI_TYPE_NSM, 230},
{0x1d200, 0x1d241, GRUB_BIDI_TYPE_ON, 0},
{0x1d242, 0x1d244, GRUB_BIDI_TYPE_NSM, 230},
{0x1d245, 0x1d245, GRUB_BIDI_TYPE_ON, 0},
{0x1d300, 0x1d356, GRUB_BIDI_TYPE_ON, 0},
{0x1d7ce, 0x1d7ff, GRUB_BIDI_TYPE_EN, 0},
{0x1f000, 0x1f02b, GRUB_BIDI_TYPE_ON, 0},
{0x1f030, 0x1f093, GRUB_BIDI_TYPE_ON, 0},
{0xe0001, 0xe0001, GRUB_BIDI_TYPE_BN, 0},
{0xe0020, 0xe007f, GRUB_BIDI_TYPE_BN, 0},
{0xe0100, 0xe01ef, GRUB_BIDI_TYPE_NSM, 255},
{0, 0, 0, 0},
};

View File

@ -33,12 +33,14 @@ outfile.write ("struct grub_unicode_compact_range grub_unicode_compact[] = {\n")
begincode = -2
lastcode = -2
lastbiditype = "X"
lastmirrortype = False
lastcombtype = -1
for line in infile:
sp = line.split (";")
curcode = int (sp[0], 16)
curbiditype = sp[4]
curcombtype = int (sp[3], 10)
curbiditype = sp[4]
curmirrortype = (sp[9] == "Y")
if curcombtype <= 255 and curcombtype >= 253:
print ("UnicodeData.txt uses combination type %d. Conflict." \
% curcombtype)
@ -50,18 +52,21 @@ for line in infile:
if curcombtype == 0 and sp[2] == "Mn":
curcombtype = 255
if lastcode + 1 != curcode or curbiditype != lastbiditype \
or curcombtype != lastcombtype:
if begincode != -2 and (lastbiditype != "L" or lastcombtype != 0):
outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d},\n" \
or curcombtype != lastcombtype or curmirrortype != lastmirrortype:
if begincode != -2 and (lastbiditype != "L" or lastcombtype != 0 or \
lastmirrortype):
outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d, %d},\n" \
% (begincode, lastcode, lastbiditype, \
lastcombtype)))
lastcombtype, lastmirrortype)))
begincode = curcode
lastcode = curcode
lastbiditype = curbiditype
lastcombtype = curcombtype
if lastbiditype != "L" or lastcombtype != 0:
outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d},\n" \
% (begincode, lastcode, lastbiditype, lastcombtype)))
outfile.write ("{0, 0, 0, 0},\n")
lastmirrortype = curmirrortype
if lastbiditype != "L" or lastcombtype != 0 or lastmirrortype:
outfile.write (("{0x%x, 0x%x, GRUB_BIDI_TYPE_%s, %d, %d},\n" \
% (begincode, lastcode, lastbiditype, lastcombtype, \
lastmirrortype)))
outfile.write ("{0, 0, 0, 0, 0},\n")
outfile.write ("};")