| 61 | } |
| 62 | |
| 63 | uint32_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 | |
| 81 | TextResult TextLayoutCreate(HFontCollection collection, |
| 82 | uint32_t* codepoints, uint32_t num_codepoints, |