mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-07 14:29:24 +00:00
[coretext-font] Do early-return in get_nominal_glyphs()
Related to https://github.com/harfbuzz/harfbuzz/issues/5056
This commit is contained in:
parent
c5e6c885c1
commit
f6bf9f697e
1 changed files with 10 additions and 1 deletions
|
@ -136,7 +136,16 @@ hb_coretext_get_nominal_glyphs (hb_font_t *font HB_UNUSED,
|
|||
ch[j] = *first_unicode;
|
||||
first_unicode = &StructAtOffset<const hb_codepoint_t> (first_unicode, unicode_stride);
|
||||
}
|
||||
CTFontGetGlyphsForCharacters (ct_font, ch, cg_glyph, c);
|
||||
if (unlikely (!CTFontGetGlyphsForCharacters (ct_font, ch, cg_glyph, c)))
|
||||
{
|
||||
// Use slow path partially and return at first failure.
|
||||
for (unsigned j = 0; j < c; j++)
|
||||
{
|
||||
if (!hb_coretext_get_nominal_glyph (font, font_data, ch[j], first_glyph, nullptr))
|
||||
return i + j;
|
||||
first_glyph = &StructAtOffset<hb_codepoint_t> (first_glyph, glyph_stride);
|
||||
}
|
||||
}
|
||||
for (unsigned j = 0; j < c; j++)
|
||||
{
|
||||
*first_glyph = cg_glyph[j];
|
||||
|
|
Loading…
Add table
Reference in a new issue