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

Function CFELayoutRun

modules/commodetto/cfeNFNT.c:157–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void CFELayoutRun(CommodettoFontEngine tf, const char *utf8, int32_t byteLength, CFERun run, int32_t runLength, int32_t width)
158{
159 const char *utf8End = utf8 + byteLength;
160
161 while (utf8 < utf8End) {
162 CFEGlyph glyph;
163 uint16_t glyphID = unicodeToMacRoman(PocoNextFromUTF8((uint8_t **)&utf8));
164 if (kInvalidGlyphID == glyphID)
165 continue;
166
167 glyph = CFEGetGlyphFromGlyphID(tf, glyphID, false);
168 if (NULL == glyph)
169 continue;
170
171 run->glyphID = glyphID;
172 run->advance = glyph->advance;
173
174 runLength -= 1;
175 if (1 == runLength)
176 break; //@@ report run array overflow
177 }
178
179 run->glyphID = kInvalidGlyphID;
180}
181
182void CFEGetOutlineFromUnicode(CommodettoFontEngine cfe, uint32_t unicode, uint8_t **outline, uint32_t *outlineSize)
183{

Callers

nothing calls this directly

Calls 3

unicodeToMacRomanFunction · 0.85
PocoNextFromUTF8Function · 0.85
CFEGetGlyphFromGlyphIDFunction · 0.70

Tested by

no test coverage detected