summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gdft.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gdft.c')
-rw-r--r--ext/gd/libgd/gdft.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 4e1aed436e..746613e438 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -26,6 +26,10 @@ extern int access(const char *pathname, int mode);
#endif
/* number of antialised colors for indexed bitmaps */
+/* overwrite Windows GDI define in case of windows build */
+#ifdef NUMCOLORS
+#undef NUMCOLORS
+#endif
#define NUMCOLORS 8
char *
@@ -880,8 +884,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
if (ch == '\r')
{
penf.x = 0;
- x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
- y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
+ x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
+ y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */
next++;
@@ -890,10 +894,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
/* newlines */
if (ch == '\n')
{
- penf.y -= face->size->metrics.height * linespace;
+ penf.y -= (long)(face->size->metrics.height * linespace);
penf.y = (penf.y - 32) & -64; /* round to next pixel row */
- x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
- y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
+ x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
+ y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
pen.x = pen.y = 0;
previous = 0; /* clear kerning flag */
next++;