Minor refactoring
This commit is contained in:
parent
61f41849af
commit
428dfcab66
|
@ -81,6 +81,24 @@
|
||||||
* egrep "`echo -n ';('; grep ';<' UnicodeData.txt | cut -d';' -f1 | tr '\n' '|'; echo ') '`" UnicodeData.txt
|
* egrep "`echo -n ';('; grep ';<' UnicodeData.txt | cut -d';' -f1 | tr '\n' '|'; echo ') '`" UnicodeData.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static hb_bool_t
|
||||||
|
decompose_func (hb_unicode_funcs_t *unicode,
|
||||||
|
hb_codepoint_t ab,
|
||||||
|
hb_codepoint_t *a,
|
||||||
|
hb_codepoint_t *b)
|
||||||
|
{
|
||||||
|
return unicode->decompose (ab, a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
static hb_bool_t
|
||||||
|
compose_func (hb_unicode_funcs_t *unicode,
|
||||||
|
hb_codepoint_t a,
|
||||||
|
hb_codepoint_t b,
|
||||||
|
hb_codepoint_t *ab)
|
||||||
|
{
|
||||||
|
return unicode->compose (a, b, ab);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
output_glyph (hb_buffer_t *buffer, hb_codepoint_t glyph)
|
output_glyph (hb_buffer_t *buffer, hb_codepoint_t glyph)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +113,7 @@ decompose (hb_font_t *font, hb_buffer_t *buffer,
|
||||||
{
|
{
|
||||||
hb_codepoint_t a, b, glyph;
|
hb_codepoint_t a, b, glyph;
|
||||||
|
|
||||||
if (!buffer->unicode->decompose (ab, &a, &b) ||
|
if (!decompose_func (buffer->unicode, ab, &a, &b) ||
|
||||||
(b && !font->get_glyph (b, 0, &glyph)))
|
(b && !font->get_glyph (b, 0, &glyph)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -281,9 +299,10 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
|
||||||
(starter == buffer->out_len - 1 ||
|
(starter == buffer->out_len - 1 ||
|
||||||
_hb_glyph_info_get_modified_combining_class (&buffer->prev()) < _hb_glyph_info_get_modified_combining_class (&buffer->cur())) &&
|
_hb_glyph_info_get_modified_combining_class (&buffer->prev()) < _hb_glyph_info_get_modified_combining_class (&buffer->cur())) &&
|
||||||
/* And compose. */
|
/* And compose. */
|
||||||
buffer->unicode->compose (buffer->out_info[starter].codepoint,
|
compose_func (buffer->unicode,
|
||||||
buffer->cur().codepoint,
|
buffer->out_info[starter].codepoint,
|
||||||
&composed) &&
|
buffer->cur().codepoint,
|
||||||
|
&composed) &&
|
||||||
/* And the font has glyph for the composite. */
|
/* And the font has glyph for the composite. */
|
||||||
font->get_glyph (composed, 0, &glyph))
|
font->get_glyph (composed, 0, &glyph))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue