我初始化的FreeType如下:的FreeType使用Unicode [错误]
if (FT_Init_FreeType(&ft)) {
printf("couldn't init freetype\n");
exit(1);
}
std::string fontPath = "D:/fonts/newscycle-bold.ttf";
if (FT_New_Face(ft, fontPath.c_str(), 0, &face)) {
printf("couldn't open font\n");
exit(1);
}
FT_Select_Charmap(face, ft_encoding_unicode);
FT_Set_Pixel_Sizes(face, 0, size);
g = face->glyph; // declaration like FT_GlyphSlot g;
我得到字形如下:
// load the w_char into the face object
if (FT_Load_Char(face, c, FT_LOAD_RENDER))
printf("freetype is unable to load char: %c\n", c); // this runs if error was occured
,而且我用wchar_t*
和wchar_t
类型。
但我看到以下内容:
你期望看到什么?可以从你发布的代码中推断出来吗? –