From df31b3d53e03f1561eeaab3f039e4f97b7be8c70 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Fri, 24 May 2013 11:19:51 -0600 Subject: [PATCH] Fix msvc compile errors (issue #230) --- _imagingft.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_imagingft.c b/_imagingft.c index 08d38da24..30ca5ffa0 100644 --- a/_imagingft.c +++ b/_imagingft.c @@ -208,6 +208,8 @@ font_getsize(FontObject* self, PyObject* args) for (x = i = 0; font_getchar(string, i, &ch); i++) { int index, error; + FT_BBox bbox; + FT_Glyph glyph; face = self->face; index = FT_Get_Char_Index(face, ch); if (kerning && last_index && index) { @@ -223,8 +225,6 @@ font_getsize(FontObject* self, PyObject* args) xoffset = face->glyph->metrics.horiBearingX; x += face->glyph->metrics.horiAdvance; - FT_BBox bbox; - FT_Glyph glyph; FT_Get_Glyph(face->glyph, &glyph); FT_Glyph_Get_CBox(glyph, FT_GLYPH_BBOX_SUBPIXELS, &bbox); if (bbox.yMax > y_max) @@ -315,6 +315,8 @@ font_render(FontObject* self, PyObject* args) PyObject* string; Py_ssize_t id; int mask = 0; + int temp; + int xx, x0, x1; if (!PyArg_ParseTuple(args, "On|i:render", &string, &id, &mask)) return NULL; @@ -333,7 +335,6 @@ font_render(FontObject* self, PyObject* args) if (mask) load_flags |= FT_LOAD_TARGET_MONO; - int temp; ascender = 0; for (i = 0; font_getchar(string, i, &ch); i++) { index = FT_Get_Char_Index(self->face, ch); @@ -363,7 +364,6 @@ font_render(FontObject* self, PyObject* args) glyph = self->face->glyph; - int xx, x0, x1; source = (unsigned char*) glyph->bitmap.buffer; xx = x + glyph->bitmap_left; x0 = 0;