| 263 | } |
| 264 | |
| 265 | static hb_font_funcs_t* skhbGetFontFuncs() { |
| 266 | static hb_font_funcs_t* const funcs = [] { |
| 267 | // HarfBuzz will use the default (parent) implementation if they aren't set. |
| 268 | hb_font_funcs_t* const funcs = hb_font_funcs_create(); |
| 269 | hb_font_funcs_set_variation_glyph_func(funcs, skhbGlyph, nullptr, nullptr); |
| 270 | hb_font_funcs_set_nominal_glyph_func(funcs, skhbNominalGlyph, nullptr, nullptr); |
| 271 | hb_font_funcs_set_nominal_glyphs_func(funcs, skhbNominalGlyphs, nullptr, nullptr); |
| 272 | hb_font_funcs_set_glyph_h_advance_func(funcs, skhbGlyphHAdvance, nullptr, nullptr); |
| 273 | hb_font_funcs_set_glyph_h_advances_func(funcs, skhbGlyphHAdvances, nullptr, nullptr); |
| 274 | hb_font_funcs_set_glyph_extents_func(funcs, skhbGlyphExtents, nullptr, nullptr); |
| 275 | hb_font_funcs_make_immutable(funcs); |
| 276 | return funcs; |
| 277 | }(); |
| 278 | return funcs; |
| 279 | } |
| 280 | |
| 281 | static hb_blob_t* skhbGetTable(hb_face_t* /*face*/, hb_tag_t tag, void* userData) { |
| 282 | SkTypeface& typeface = *reinterpret_cast<SkTypeface*>(userData); |