【问题标题】:FreeType Colour rendering FT_Load_Glyph returns "Unimplemented Feature"FreeType 颜色渲染 FT_Load_Glyph 返回“未实现的功能”
【发布时间】:2020-12-21 21:03:05
【问题描述】:

我正在尝试让彩色字体在 freetype 中工作,不幸的是 FT_Load_Glyph 和 FT_Render_Glyph 返回“未实现的功能”,freetype 是否有某种构建配置以允许彩色字体?因为我没有看到代码有任何问题。 我正在使用 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)
{
}

【问题讨论】:

标签: c freetype


【解决方案1】:

这可以在构建设置中实现。在启用 FT_CONFIG_OPTION_USE_PNG 选项的情况下构建 FreeType。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-13
    • 2021-09-23
    • 2015-02-20
    相关资源
    最近更新 更多