diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 10:03:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 10:03:28 +0300 |
commit | 5300ba0ba50efb1656a2effa1053fb60875398ef (patch) | |
tree | ffde96caaec1f71bc75286bf78f8c570cac6b8fe /source/blender/blenfont/intern | |
parent | b51dcb6f07f34c904b036887e24f96542d9fb76d (diff) | |
parent | 21f61cbe73a1bc24d2e74b82b039ea5f36c960a5 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 11 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 11 |
2 files changed, 6 insertions, 16 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index b0e0cdac407..8e3f42e4d27 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -85,7 +85,6 @@ static FontBLF *global_font[BLF_MAX_FONT] = {NULL}; static int global_font_default = -1; static int global_font_points = 11; static int global_font_dpi = 72; -static bool global_use_antialias = true; /* XXX, should these be made into global_font_'s too? */ int blf_mono_font = -1; @@ -190,16 +189,6 @@ int BLF_default(void) return global_font_default; } -void BLF_antialias_set(bool enabled) -{ - global_use_antialias = enabled; -} - -bool BLF_antialias_get(void) -{ - return global_use_antialias; -} - int BLF_load(const char *name) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index f7f1e10a480..5b1a382e368 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; - const bool is_sharp = !BLF_antialias_get(); int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP; FT_BBox bbox; unsigned int key; @@ -294,10 +293,12 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) if (font->flags & BLF_HINTING) flags &= ~FT_LOAD_NO_HINTING; - if (is_sharp) + if (font->flags & BLF_MONOCHROME) { err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO); - else + } + else { err = FT_Load_Glyph(font->face, (FT_UInt)index, flags); + } if (err) { BLI_spin_unlock(font->ft_lib_mutex); @@ -307,7 +308,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) /* get the glyph. */ slot = font->face->glyph; - if (is_sharp) { + if (font->flags & BLF_MONOCHROME) { err = FT_Render_Glyph(slot, FT_RENDER_MODE_MONO); /* Convert result from 1 bit per pixel to 8 bit per pixel */ @@ -336,7 +337,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) g->height = (int)bitmap.rows; if (g->width && g->height) { - if (is_sharp) { + if (font->flags & BLF_MONOCHROME) { /* Font buffer uses only 0 or 1 values, Blender expects full 0..255 range */ int i; for (i = 0; i < (g->width * g->height); i++) { |