diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-21 20:08:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-21 20:08:23 +0300 |
commit | 596c3368f4b09bdeec46e7b44abfc8bcb7ba8fcf (patch) | |
tree | 09a8d4af2f134db67579577d38ad78fa667afede /source/blender/blenfont/intern | |
parent | 794836c8f17a2feaa43d31d23982fa41e3f953a4 (diff) | |
parent | 34029fc71a3cc7e69f977462d4b3f09eb10ccca2 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 5b1a382e368..2679deea254 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -269,7 +269,6 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) GlyphBLF *g; FT_Error err; FT_Bitmap bitmap, tempbitmap; - int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP; FT_BBox bbox; unsigned int key; @@ -290,13 +289,27 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) return g; } - if (font->flags & BLF_HINTING) - flags &= ~FT_LOAD_NO_HINTING; - if (font->flags & BLF_MONOCHROME) { err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO); } else { + int flags = FT_LOAD_NO_BITMAP; + + if (font->flags & BLF_HINTING_NONE) { + flags |= FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING; + } + else if (font->flags & BLF_HINTING_SLIGHT) { + flags |= FT_LOAD_TARGET_LIGHT; + } + else if (font->flags & BLF_HINTING_FULL) { + flags |= FT_LOAD_TARGET_NORMAL; + } + else { + /* Default, hinting disabled until FreeType has been upgraded + * to give good results on all platforms. */ + flags |= FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING; + } + err = FT_Load_Glyph(font->face, (FT_UInt)index, flags); } |