我试图让彩色字体在自由类型中工作,不幸的是,FT_Load_Glyph和FT_Render_Glyph返回“未实现的功能”,是否有某种允许彩色字体的免费字体的构建配置?因为我看不出代码有什么问题。我正在使用notocolouremoji字体。
uint32_t FT_flags = NULL;
FT_Face face = ((FT_Face)font->face);
if (FT_HAS_COLOR(face))
{
FT_flags |= FT_LOAD_COLOR;
}
else
{
FT_flags |= FT_LOAD_DEFAULT;
}
if (FT_HAS_FIXED_SIZES(face))
{
if ((err = FT_Select_Size(face, 0)) != 0)
{
}
}
else
{
if ((err = FT_Set_Char_Size(face, face->available_sizes[0].width, face->available_sizes[0].height, Utils.window.Extent.width, Utils.window.Extent.width)) != 0)
{
}
}
if ((err = FT_Load_Glyph(face, glyphindex, FT_flags)) != 0)
{
}
if ((err = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL)) != 0)
{
}发布于 2020-12-21 12:10:42
这可以在构建设置中实现。在启用FreeType选项的情况下构建FT_CONFIG_OPTION_USE_PNG。
https://stackoverflow.com/questions/63742055
复制相似问题