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:
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c21
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 f1301d38ab6..c19c8528232 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;
- int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
FT_BBox bbox;
unsigned int key;
@@ -242,13 +241,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);
}