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:
authorDiego Borghetti <bdiego@gmail.com>2009-06-12 01:43:59 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-06-12 01:43:59 +0400
commitec8b2593ecdee9493210df0e6f9c4dbbcb2a1985 (patch)
treea2606bdb7d6da77c4c2243e12efc85fb4a957bd1 /source/blender/blenfont/intern/blf_glyph.c
parenta054f3ccce67ebf32ecc687b1f19ba0a6b6144f0 (diff)
Smal tweak to allow the user set a kerning value.
This commit add two option to the blenfont library: 1) BLF_FONT_KERNING This enable the kerning information that come with the font, by default this option is disable and still don't have a UI for change. 2) BLF USER_KERNING This allow the user set a kerning value to by apply for every character, by default this option is enable but all the font have a kerning value of zero. Ton I add this option to the style with a default value of 1. Access from: Outliner -> User Preferences -> Style -> FontStyle -> Kerning
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 142d2145ab2..33a435cc5be 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -213,7 +213,11 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
else
do_new= 1;
- err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+ if (font->flags & BLF_FONT_KERNING)
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP);
+ else
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+
if (err)
return(NULL);
@@ -328,7 +332,11 @@ GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c)
else
do_new= 1;
- err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+ if (font->flags & BLF_FONT_KERNING)
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP);
+ else
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+
if (err)
return(NULL);