MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / CFEGetGlyphFromUnicode

Function CFEGetGlyphFromUnicode

modules/commodetto/cfeBMF.c:224–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224CFEGlyph CFEGetGlyphFromUnicode(CommodettoFontEngine bmf, uint32_t unicode, uint8_t needPixels)
225{
226 uint16_t glyphID = bmfUnicodeToGlyphID(bmf, unicode);
227 if (kInvalidGlyphID == glyphID) {
228 bmf->glyph.substitute = getASCIISubstitution(unicode);
229 if (bmf->glyph.substitute)
230 return &bmf->glyph;
231 return C_NULL;
232 }
233
234 return CFEGetGlyphFromGlyphID(bmf, glyphID, needPixels);
235}
236
237int16_t CFEGetKerningOffset(CommodettoFontEngine bmf, uint32_t unicode1, uint32_t unicode2)
238{

Callers 5

xs_poco_getTextWidthFunction · 0.70
xs_poco_drawTextFunction · 0.70
PiuFontGetWidthFunction · 0.50
PiuViewDrawStringFunction · 0.50
PiuFontGetGlyphFunction · 0.50

Calls 3

bmfUnicodeToGlyphIDFunction · 0.85
getASCIISubstitutionFunction · 0.85
CFEGetGlyphFromGlyphIDFunction · 0.70

Tested by

no test coverage detected