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:
authorCampbell Barton <ideasman42@gmail.com>2010-09-10 07:56:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-10 07:56:11 +0400
commit5bf97d7786424a06f912bf90822fd7ec4ebda6ba (patch)
tree0efe1115902b55390c6469cdd7e011b0d40ae3b2 /source/blender/blenfont
parenta7fe586c94edd667d953033d54474e11a3e038b7 (diff)
bugfix [#23607] Render Stamp, incorrect apostrophe Y position.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_font.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index a932682b027..f5de632db47 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -155,7 +155,7 @@ void blf_font_buffer(FontBLF *font, char *str)
FT_Vector delta;
FT_UInt glyph_index;
float a, *fbuf;
- int pen_x, pen_y, y, x, yb, diff;
+ int pen_x, y, x, yb, diff;
int i, has_kerning, st, chx, chy;
if (!font->glyph_cache || (!font->b_fbuf && !font->b_cbuf))
@@ -163,7 +163,6 @@ void blf_font_buffer(FontBLF *font, char *str)
i= 0;
pen_x= (int)font->pos[0];
- pen_y= (int)font->pos[1];
has_kerning= FT_HAS_KERNING(font->face);
g_prev= NULL;
@@ -172,6 +171,7 @@ void blf_font_buffer(FontBLF *font, char *str)
b_col_char[2]= font->b_col[2] * 255;
while (str[i]) {
+ int pen_y;
c= blf_utf8_next((unsigned char *)str, &i);
if (c == 0)
break;
@@ -186,6 +186,8 @@ void blf_font_buffer(FontBLF *font, char *str)
if (!g)
continue;
+ pen_y= (int)font->pos[1];
+
if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
@@ -201,23 +203,15 @@ void blf_font_buffer(FontBLF *font, char *str)
chx= pen_x + ((int)g->pos_x);
diff= g->height - ((int)g->pos_y);
- if (diff > 0) {
- if (g->pitch < 0)
- pen_y += diff;
- else
- pen_y -= diff;
- }
- else if (diff < 0) {
- if (g->pitch < 0)
- pen_y -= diff;
- else
- pen_y += diff;
- }
- if (g->pitch < 0)
+ if (g->pitch < 0) {
+ pen_y += diff;
chy= pen_y - ((int)g->pos_y);
- else
+ }
+ else {
+ pen_y -= diff;
chy= pen_y + ((int)g->pos_y);
+ }
if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
/* dont draw beyond the buffer bounds */