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 21:18:59 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-06-12 21:18:59 +0400
commit845e9a0e25ab7257005288fe2938a8ca9ca856d2 (patch)
treec27e2064ad29f429b5fe78874388491effc50ca0 /source/blender/blenfont
parent0e170f8e5633ee46c413ab759e9cf3ba1ffb82ea (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')
-rw-r--r--source/blender/blenfont/BLF_api.h2
-rw-r--r--source/blender/blenfont/intern/blf.c2
-rw-r--r--source/blender/blenfont/intern/blf_font.c6
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index d1d802622ea..e871de490f3 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -85,7 +85,7 @@ float BLF_height_default(char *str);
void BLF_rotation(float angle);
void BLF_clipping(float xmin, float ymin, float xmax, float ymax);
void BLF_blur(int size);
-void BLF_kerning(int space);
+void BLF_kerning(float space);
void BLF_enable(int option);
void BLF_disable(int option);
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;