TFontCache.GetTextCodePoints

function GetTextCodePoints(const text: UnicodeString): TArrayOfCardinal;

Unicode characters are usually directly equivalent to codepoint values, but occasionally UnicodeStrings contain "surrogate paired" characters that have to be decoded to make individual codepoints.