From b030ec8760a0f3ca9b0eb36c265cb35025fdc7ca Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 24 Mar 2022 16:20:10 -0700 Subject: 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 --- source/blender/blenfont/intern/blf.c | 2 +- source/blender/blenfont/intern/blf_font.c | 2 +- source/blender/blenfont/intern/blf_glyph.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenfont') diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 17d6e431632..2b5a2cdf606 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -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; } diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index f833eb96f38..60ff5f6470f 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -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; } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 4810e46b1d2..28531c5afc1 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -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; } -- cgit v1.2.3