Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-03-25 02:20:10 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-03-25 02:20:10 +0300
commitb030ec8760a0f3ca9b0eb36c265cb35025fdc7ca (patch)
tree659ce71fae920aa436702baa80f46548e97599c4 /source/blender/blenfont/intern
parent4fd0a69d7ba86e92390c421a745c6f32f1050c31 (diff)
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
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r--source/blender/blenfont/intern/blf.c2
-rw-r--r--source/blender/blenfont/intern/blf_font.c2
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c4
3 files changed, 4 insertions, 4 deletions
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;
}