MCPcopy Create free account
hub / github.com/Snapchat/Valdi / createSubFont

Method createSubFont

snap_drawing/src/snap_drawing/cpp/Text/Harfbuzz.cpp:326–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326HBFont Harfbuzz::createSubFont(const HBFont& mainFont, SkFont* font) {
327 // Creating a sub font means that non-available functions
328 // are found from the parent.
329 HBFont hbFont(hb_font_create_sub_font(mainFont.get()));
330 if (hbFont.get() == nullptr) {
331 return HBFont(nullptr);
332 }
333
334 hb_font_set_funcs(hbFont.get(), skhbGetFontFuncs(), font, nullptr);
335 int scale = sskhbPosition(font->getSize());
336 hb_font_set_scale(hbFont.get(), scale, scale);
337
338 return hbFont;
339}
340
341}; // namespace snap::drawing

Callers

nothing calls this directly

Calls 5

HBFontClass · 0.85
skhbGetFontFuncsFunction · 0.85
sskhbPositionFunction · 0.85
getMethod · 0.65
getSizeMethod · 0.45

Tested by

no test coverage detected