[coretext-font] Implement get_variation_glyph()

Not sure if I got it right, but *seems* to work.
This commit is contained in:
Behdad Esfahbod 2024-10-15 14:05:39 -06:00
parent d44cc8a1fc
commit e1026a2252

View file

@ -107,8 +107,18 @@ hb_coretext_get_variation_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
// TODO. How?
return false;
CTFontRef ct_font = (CTFontRef) font_data;
UniChar ch[2] = { unicode, variation_selector };
CGGlyph cg_glyph[2];
CTFontGetGlyphsForCharacters (ct_font, ch, cg_glyph, 2);
if (cg_glyph[1])
return false;
*glyph = cg_glyph[0];
return true;
}
static void