Disable compatibility decomposition usage during normalization
Fixes https://github.com/behdad/harfbuzz/issues/152
This commit is contained in:
parent
ce889189c1
commit
f679970040
|
@ -171,28 +171,6 @@ decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 0 if didn't decompose, number of resulting characters otherwise. */
|
|
||||||
static inline unsigned int
|
|
||||||
decompose_compatibility (const hb_ot_shape_normalize_context_t *c, hb_codepoint_t u)
|
|
||||||
{
|
|
||||||
unsigned int len, i;
|
|
||||||
hb_codepoint_t decomposed[HB_UNICODE_MAX_DECOMPOSITION_LEN];
|
|
||||||
hb_codepoint_t glyphs[HB_UNICODE_MAX_DECOMPOSITION_LEN];
|
|
||||||
|
|
||||||
len = c->buffer->unicode->decompose_compatibility (u, decomposed);
|
|
||||||
if (!len)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
if (!c->font->get_glyph (decomposed[i], 0, &glyphs[i]))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
output_char (c->buffer, decomposed[i], glyphs[i]);
|
|
||||||
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shortest)
|
decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shortest)
|
||||||
{
|
{
|
||||||
|
@ -207,8 +185,6 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
|
||||||
skip_char (buffer);
|
skip_char (buffer);
|
||||||
else if (!shortest && c->font->get_glyph (u, 0, &glyph))
|
else if (!shortest && c->font->get_glyph (u, 0, &glyph))
|
||||||
next_char (buffer, glyph);
|
next_char (buffer, glyph);
|
||||||
else if (decompose_compatibility (c, u))
|
|
||||||
skip_char (buffer);
|
|
||||||
else
|
else
|
||||||
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
|
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue