The question is about text rendering, my system is Pango + FreeType + FontConfig + CentOS.
My ultimate goal is to decide if a font can supports all characters of a given string. The given string can use multiple languages.
The best solution I found so far is using this freetype function. Therefore I need the capability to loop through chars of a string. Here is a test case: "TestText測試テスト", and I use std::string to store it. when I loop through it, I got:
length = 23, string = TestText測試テスト
T, 54
e, 65
s, 73
t, 74
T, 54
e, 65
x, 78
t, 74
byte 0: 54
byte 1: 65
byte 2: 73
byte 3: 74
byte 4: 54
byte 5: 65
byte 6: 78
byte 7: 74
byte 8: E6
byte 9: B8
byte 10: AC
byte 11: E8
byte 12: A9
byte 13: A6
byte 14: E3
byte 15: 83
byte 16: 86
byte 17: E3
byte 18: 82
byte 19: B9
byte 20: E3
byte 21: 83
byte 22: 88
I probably can't use the simple for loop for this case since some char is of more than 1 byte. What would be the right way to loop through?
Thanks for any advice, and even other solution of approaching the goal besides the freetype function.