Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Fix descender parameter was ignored on rendering truetype fonts"

This reverts commit 501c5c4.
  • Loading branch information...
commit 558254f02839a0a83fd8ff68e085fa23d21f88b9 1 parent 9488cb1
@saltycrane saltycrane authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 _imagingft.c
View
8 _imagingft.c
@@ -299,7 +299,7 @@ font_render(FontObject* self, PyObject* args)
{
int i, x, y;
Imaging im;
- int index, error, ascender, descender;
+ int index, error, ascender;
int load_flags;
unsigned char *source;
FT_ULong ch;
@@ -349,7 +349,6 @@ font_render(FontObject* self, PyObject* args)
int xx, x0, x1;
source = (unsigned char*) glyph->bitmap.buffer;
ascender = PIXEL(self->face->size->metrics.ascender);
- descender = PIXEL(self->face->size->metrics.descender);
xx = x + glyph->bitmap_left;
x0 = 0;
x1 = glyph->bitmap.width;
@@ -358,7 +357,7 @@ font_render(FontObject* self, PyObject* args)
if (xx + x1 > im->xsize)
x1 = im->xsize - xx;
for (y = 0; y < glyph->bitmap.rows; y++) {
- int yy = y + ascender + descender - glyph->bitmap_top;
+ int yy = y + ascender - glyph->bitmap_top;
if (yy >= 0 && yy < im->ysize) {
/* blend this glyph into the buffer */
unsigned char *target = im->image8[yy] + xx;
@@ -379,7 +378,6 @@ font_render(FontObject* self, PyObject* args)
int xx, x0, x1;
source = (unsigned char*) glyph->bitmap.buffer;
ascender = PIXEL(self->face->size->metrics.ascender);
- descender = PIXEL(self->face->size->metrics.descender);
xx = x + glyph->bitmap_left;
x0 = 0;
x1 = glyph->bitmap.width;
@@ -388,7 +386,7 @@ font_render(FontObject* self, PyObject* args)
if (xx + x1 > im->xsize)
x1 = im->xsize - xx;
for (y = 0; y < glyph->bitmap.rows; y++) {
- int yy = y + ascender + descender - glyph->bitmap_top;
+ int yy = y + ascender - glyph->bitmap_top;
if (yy >= 0 && yy < im->ysize) {
/* blend this glyph into the buffer */
int i;
Please sign in to comment.
Something went wrong with that request. Please try again.