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-23 22:26:01 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-06-23 22:26:01 +0400
commit483e9479f73dca77fd3b6db7ede72849b1552859 (patch)
treecc16d905377eb8f036933a93a15ee17b88a38cfb /source/blender/blenfont/intern/blf_font.c
parent30d769e2cda8851cbd45ca5ebf074d90b7f9cbc1 (diff)
New Style option: Overlap
If this option is enable, the blenfont check for overlap characters, like one of my previous commit but now it's optional and disable by default. (This fix the "Fi" or other case when the characters are too close) Enable/disable from: Outliner -> User Preferences -> Styles -> Panel Font -> Overlap (also for other styles, Group Label, Widget, Widget Label)
Diffstat (limited to 'source/blender/blenfont/intern/blf_font.c')
-rw-r--r--source/blender/blenfont/intern/blf_font.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index ee4ba0ee71a..a3c5232cc76 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -146,20 +146,22 @@ void blf_font_draw(FontBLF *font, char *str)
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 (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 (pen_x < old_pen_x)
- pen_x= old_pen_x;
-*/
+
+ 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 */
@@ -228,20 +230,22 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box)
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 (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 (pen_x < old_pen_x)
- old_pen_x= pen_x;
-*/
+
+ if (font->flags & BLF_OVERLAP_CHAR) {
+ if (pen_x < old_pen_x)
+ pen_x= old_pen_x;
+ }
}
gbox.xmin= g->box.xmin + pen_x;