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-13 18:58:39 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-06-13 18:58:39 +0400
commit3a9396c47dcc1083baf5bcbb93556f65b84ba5a0 (patch)
treeb02114b4d46619e13cf382750e322a3436dc3fe1
parentfa01eef27e1a03aeba438e10ae11230f07ff0fb6 (diff)
Restore default value for font kerning.
The user value is 0 by default and the font kerning (the value that come with the font) is enable, like always. (the last was disable by mistake in a previous commit)
-rw-r--r--source/blender/blenfont/intern/blf_font.c23
-rw-r--r--source/blender/editors/interface/interface_style.c8
2 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 5a3b3207e29..921f5cac67c 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <math.h>
#include <ft2build.h>
@@ -143,11 +144,12 @@ void blf_font_draw(FontBLF *font, char *str)
delta.x= 0;
delta.y= 0;
- FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
- pen_x += delta.x >> 6;
+ if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) {
+ pen_x += delta.x >> 6;
- if (pen_x < old_pen_x)
- pen_x= old_pen_x;
+ if (pen_x < old_pen_x)
+ pen_x= old_pen_x;
+ }
}
if (font->flags & BLF_USER_KERNING) {
@@ -174,7 +176,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
FT_Vector delta;
FT_UInt glyph_index, g_prev_index;
rctf gbox;
- int pen_x, pen_y, old_pen_x;
+ float pen_x, pen_y, old_pen_x;
int i, has_kerning;
if (!font->glyph_cache)
@@ -222,11 +224,12 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
delta.x= 0;
delta.y= 0;
- FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta);
- pen_x += delta.x >> 6;
+ if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) {
+ pen_x += delta.x >> 6;
- if (pen_x < old_pen_x)
- old_pen_x= pen_x;
+ if (pen_x < old_pen_x)
+ old_pen_x= pen_x;
+ }
}
if (font->flags & BLF_USER_KERNING) {
@@ -318,7 +321,7 @@ 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;
+ font->flags= BLF_USER_KERNING | BLF_FONT_KERNING;
font->dpi= 0;
font->size= 0;
font->kerning= 0.0f;
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index f1d29ac8688..831a8a5bf6c 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -91,7 +91,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->paneltitle.uifont_id= UIFONT_DEFAULT;
style->paneltitle.points= 13;
- style->paneltitle.kerning= 0.5;
+ style->paneltitle.kerning= 0.0;
style->paneltitle.shadow= 5;
style->paneltitle.shadx= 2;
style->paneltitle.shady= -2;
@@ -100,7 +100,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->grouplabel.uifont_id= UIFONT_DEFAULT;
style->grouplabel.points= 12;
- style->grouplabel.kerning= 0.5;
+ style->grouplabel.kerning= 0.0;
style->grouplabel.shadow= 3;
style->grouplabel.shadx= 1;
style->grouplabel.shady= -1;
@@ -108,7 +108,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widgetlabel.uifont_id= UIFONT_DEFAULT;
style->widgetlabel.points= 11;
- style->widgetlabel.kerning= 0.5;
+ style->widgetlabel.kerning= 0.0;
style->widgetlabel.shadow= 3;
style->widgetlabel.shadx= 1;
style->widgetlabel.shady= -1;
@@ -117,7 +117,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widget.uifont_id= UIFONT_DEFAULT;
style->widget.points= 11;
- style->widget.kerning= 0.5;
+ style->widget.kerning= 0.0;
style->widget.shadowalpha= 0.25f;
style->columnspace= 5;