MCPcopy Create free account
hub / github.com/defold/defold / TextToCodePoints

Function TextToCodePoints

engine/font/src/text_layout.cpp:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63uint32_t TextToCodePoints(const char* text, dmArray<uint32_t>& codepoints)
64{
65 const char* safe_text = text ? text : "";
66 uint32_t len = dmUtf8::StrLen(safe_text);
67 if (codepoints.Capacity() < len)
68 {
69 codepoints.SetCapacity(len);
70 }
71 codepoints.SetSize(0);
72
73 const char* cursor = safe_text;
74 while (uint32_t c = dmUtf8::NextChar(&cursor))
75 {
76 codepoints.Push(c);
77 }
78 return len;
79}
80
81TextResult TextLayoutCreate(HFontCollection collection,
82 uint32_t* codepoints, uint32_t num_codepoints,

Callers 9

CreateProfilerTextLayoutFunction · 0.85
CreateTextLayoutFunction · 0.85
GetTextMetricsFunction · 0.85
CreateFontVertexDataFunction · 0.85
TEST_FFunction · 0.85
CreateTestGlyphsFunction · 0.85
GetOrCreateTextLayoutFunction · 0.85
ResFontPrewarmTextFunction · 0.85

Calls 6

StrLenFunction · 0.85
NextCharFunction · 0.85
CapacityMethod · 0.45
SetCapacityMethod · 0.45
SetSizeMethod · 0.45
PushMethod · 0.45

Tested by 3

CreateTextLayoutFunction · 0.68
TEST_FFunction · 0.68
CreateTestGlyphsFunction · 0.68