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_font.c')
-rw-r--r--source/blender/blenfont/intern/blf_font.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index a3c5232cc76..989746ca501 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -101,7 +101,7 @@ void blf_font_draw(FontBLF *font, char *str)
GlyphBLF *g, *g_prev;
FT_Vector delta;
FT_UInt glyph_index, g_prev_index;
- float pen_x, pen_y, old_pen_x;
+ int pen_x, pen_y;
int i, has_kerning;
if (!font->glyph_cache)
@@ -139,33 +139,17 @@ void blf_font_draw(FontBLF *font, char *str)
else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data))
g= blf_glyph_add(font, glyph_index, c);
- if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) {
- old_pen_x= pen_x;
+ if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) {
pen_x += delta.x >> 6;
-
- if (font->flags & BLF_OVERLAP_CHAR) {
- if (pen_x < old_pen_x)
- pen_x= old_pen_x;
- }
- }
- }
-
- if (font->flags & BLF_USER_KERNING) {
- old_pen_x= pen_x;
- pen_x += font->kerning;
-
- if (font->flags & BLF_OVERLAP_CHAR) {
- if (pen_x < old_pen_x)
- pen_x= old_pen_x;
}
}
/* do not return this loop if clipped, we want every character tested */
- blf_glyph_render(font, g, pen_x, pen_y);
+ blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
pen_x += g->advance;
g_prev= g;
@@ -180,7 +164,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
FT_Vector delta;
FT_UInt glyph_index, g_prev_index;
rctf gbox;
- float pen_x, pen_y, old_pen_x;
+ int pen_x, pen_y;
int i, has_kerning;
if (!font->glyph_cache)
@@ -223,28 +207,12 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data))
g= blf_glyph_add(font, glyph_index, c);
- if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) {
- old_pen_x= pen_x;
+ if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) {
pen_x += delta.x >> 6;
-
- if (font->flags & BLF_OVERLAP_CHAR) {
- if (pen_x < old_pen_x)
- pen_x= old_pen_x;
- }
- }
- }
-
- if (font->flags & BLF_USER_KERNING) {
- old_pen_x= pen_x;
- pen_x += font->kerning;
-
- if (font->flags & BLF_OVERLAP_CHAR) {
- if (pen_x < old_pen_x)
- pen_x= old_pen_x;
}
}
@@ -329,10 +297,9 @@ void blf_font_fill(FontBLF *font)
font->clip_rec.xmax= 0.0f;
font->clip_rec.ymin= 0.0f;
font->clip_rec.ymax= 0.0f;
- font->flags= BLF_USER_KERNING | BLF_FONT_KERNING;
+ font->flags= 0;
font->dpi= 0;
font->size= 0;
- font->kerning= 0.0f;
font->cache.first= NULL;
font->cache.last= NULL;
font->glyph_cache= NULL;