BLF Cleanup: Use FreeType Enum FT_Err_Ok

Replace comparisons of FT_Error against 0 with FT_Err_Ok instead.

See D14052 for more details.

Differential Revision: https://developer.blender.org/D14052

Reviewed by Campbell Barton
This commit is contained in:
Harley Acheson 2022-03-24 16:20:10 -07:00
parent 4fd0a69d7b
commit b030ec8760
3 changed files with 4 additions and 4 deletions

View File

@ -129,7 +129,7 @@ bool BLF_has_glyph(int fontid, unsigned int unicode)
{
FontBLF *font = blf_get(fontid);
if (font) {
return FT_Get_Char_Index(font->face, unicode) != 0;
return FT_Get_Char_Index(font->face, unicode) != FT_Err_Ok;
}
return false;
}

View File

@ -1340,7 +1340,7 @@ bool blf_font_size(FontBLF *font, float size, unsigned int dpi)
size = (float)ft_size / 64.0f;
if (font->size != size || font->dpi != dpi) {
if (FT_Set_Char_Size(font->face, 0, ft_size, dpi, dpi) == 0) {
if (FT_Set_Char_Size(font->face, 0, ft_size, dpi, dpi) == FT_Err_Ok) {
font->size = size;
font->dpi = dpi;
}

View File

@ -258,7 +258,7 @@ static FT_GlyphSlot blf_glyph_load(FontBLF *font, FT_UInt glyph_index)
}
}
if (FT_Load_Glyph(font->face, glyph_index, load_flags) == 0) {
if (FT_Load_Glyph(font->face, glyph_index, load_flags) == FT_Err_Ok) {
return font->face->glyph;
}
return NULL;
@ -280,7 +280,7 @@ static bool blf_glyph_render_bitmap(FontBLF *font, FT_GlyphSlot glyph)
/* Render the glyph curves to a bitmap. */
FT_Error err = FT_Render_Glyph(glyph, render_mode);
if (err != 0) {
if (err != FT_Err_Ok) {
return false;
}