diff options
author | Diego Borghetti <bdiego@gmail.com> | 2009-06-12 21:18:59 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2009-06-12 21:18:59 +0400 |
commit | 845e9a0e25ab7257005288fe2938a8ca9ca856d2 (patch) | |
tree | c27e2064ad29f429b5fe78874388491effc50ca0 /source/blender/blenfont/intern | |
parent | 0e170f8e5633ee46c413ab759e9cf3ba1ffb82ea (diff) |
Made the kerning a float, this give a little more of tweak.
0.5 is the default value now, the range are from -5.0 to 5.0.
Note that we allow negative value, but the current draw code
always check for overlap characters.
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 2 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 6 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_internal_types.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index ffb845f7888..f06c7fb0d28 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -492,7 +492,7 @@ void BLF_mode(int mode) font->mode= mode; } -void BLF_kerning(int space) +void BLF_kerning(float space) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index df77aee70e8..5a3b3207e29 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str) GlyphBLF *g, *g_prev; FT_Vector delta; FT_UInt glyph_index, g_prev_index; - int pen_x, pen_y, old_pen_x; + float pen_x, pen_y, old_pen_x; int i, has_kerning; if (!font->glyph_cache) @@ -159,7 +159,7 @@ void blf_font_draw(FontBLF *font, char *str) } /* do not return this loop if clipped, we want every character tested */ - blf_glyph_render(font, g, (float)pen_x, (float)pen_y); + blf_glyph_render(font, g, pen_x, pen_y); pen_x += g->advance; g_prev= g; @@ -321,7 +321,7 @@ void blf_font_fill(FontBLF *font) font->flags= BLF_USER_KERNING; font->dpi= 0; font->size= 0; - font->kerning= 0; + font->kerning= 0.0f; font->cache.first= NULL; font->cache.last= NULL; font->glyph_cache= NULL; diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index d200d910020..60446aa93b2 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -168,7 +168,7 @@ typedef struct FontBLF { int size; /* kerning space, user setting. */ - int kerning; + float kerning; /* max texture size. */ int max_tex_size; |