svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / blender / blenfont / intern / blf_font.c
index ee4ba0ee71a6d3b9ce63488bec8d840cf67239fb..a3c5232cc76f8ac05011a5b55b5b255b906732ef 100644 (file)
@@ -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;