std::string
is commonly interpreted as UTF8, hence has a variable length encoding. In my font renderer I've hit a problem in that I'm not sure how to get a "character" from a std::string and convert it into a Freetype FT_ULong
in order to get a glyph with FT_Get_Char_Index
. That is to say, I am not sure that what I'm doing is "correct" as I'm just iterating through std::string
and casting the resulting chars over (surely this is incorrect, although it works with my OS defaults).
So is there a "correct" way of doing this and more importantly has someone written a library that implements this "correct" way that I can use off the shelf?