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:
authorCampbell Barton <ideasman42@gmail.com>2018-07-31 09:57:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-31 09:57:05 +0300
commit21f61cbe73a1bc24d2e74b82b039ea5f36c960a5 (patch)
treeb2949478a021e3d36b58edfe1b3523486495839e /source/blender/blenfont/intern/blf_glyph.c
parent18888b7b0c3556d3a2177fe7693fda02bf2a8cb5 (diff)
BLF: replace global aa pref w/ monochrome flag
Now disabling anti-aliasing doesn't impact sequencer, render stamp etc.
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 9af347908e1..f1301d38ab6 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -221,7 +221,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;
@@ -246,10 +245,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);
@@ -259,7 +260,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 */
@@ -288,7 +289,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++) {