[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#352133: gs-gpl: Font rendering on 64bit platforms



Package: gs-gpl
Version: 8.15-4.1
Severity: important


On amd64 certain ps and pdf files (for instance ones created by OpenOffice)
are incorrectly rendered in very small text size, both on screen and printout.

The newest (non-GPL) upstream version fixes this, see also
http://bugs.ghostscript.com/show_bug.cgi?id=688047.

The bug is caused by the implicit assumption that 'long' is 32bit in three headers.
Attached below is a patch to fix this based on my understanding of the issue.

  Arne


--- gs-gpl-8.15-orig/src/ttfoutl.h	2003-12-12 23:08:05.000000000 +0100
+++ gs-gpl-8.15/src/ttfoutl.h	2006-02-09 22:47:05.000000000 +0100
@@ -20,6 +20,8 @@
 #ifndef incl_ttfoutl
 #define incl_ttfoutl
 
+#include "stdint_.h"
+
 #ifndef TFace_defined
 #define TFace_defined
 typedef struct _TFace TFace;
@@ -52,7 +54,7 @@
     double x, y;
 } FloatPoint;
 
-typedef signed long F26Dot6;
+typedef int32_t F26Dot6;
 
 /* Define an abstract class for accessing memory managers from the TT interpreter. */
 typedef struct ttfMemory_s ttfMemory;
--- gs-gpl-8.15-orig/src/tttype.h	2003-12-12 23:08:05.000000000 +0100
+++ gs-gpl-8.15/src/tttype.h	2006-02-09 22:49:05.000000000 +0100
@@ -49,6 +49,8 @@
 #ifndef FREETYPE_H
 #define FREETYPE_H
 
+#include "stdint_.h"
+
 #ifdef __cplusplus
   extern "C" {
 #endif
@@ -62,15 +64,15 @@
   /*                                                                 */
   /*******************************************************************/
 
-  typedef signed long     TT_Fixed;   /* Signed Fixed 16.16 Float */
+  typedef int32_t         TT_Fixed;   /* Signed Fixed 16.16 Float */
 
   typedef signed short    TT_FWord;   /* Distance in FUnits */
   typedef unsigned short  TT_UFWord;  /* Unsigned distance */
 
   typedef signed short    TT_Short;
   typedef unsigned short  TT_UShort;
-  typedef signed long     TT_Long;
-  typedef unsigned long   TT_ULong;
+  typedef int32_t         TT_Long;
+  typedef uint32_t        TT_ULong;
 
   typedef signed short    TT_F2Dot14; /* Signed fixed float 2.14 used for */
                                       /* unary vectors, with layout:      */
@@ -85,10 +87,10 @@
                                       /*  added.                          */
                                       /*                                  */
 
-  typedef signed long     TT_F26Dot6; /* 26.6 fixed float, used for       */
+  typedef int32_t         TT_F26Dot6; /* 26.6 fixed float, used for       */
                                       /* glyph points pixel coordinates.  */
 
-  typedef signed long     TT_Pos;     /* point position, expressed either */
+  typedef int32_t         TT_Pos;     /* point position, expressed either */
                                       /* in fractional pixels or notional */
                                       /* units, depending on context. For */
                                       /* example, glyph coordinates       */
--- gs-gpl-8.15-orig/src/tttypes.h	2003-12-12 23:08:05.000000000 +0100
+++ gs-gpl-8.15/src/tttypes.h	2006-02-09 22:46:09.000000000 +0100
@@ -65,19 +65,7 @@
   typedef unsigned long   ULong;
   typedef signed   long   Long;
 
-#if SIZEOF_INT == 4
-
-  typedef long int        Fixed;    /* signed fixed 16.16 float */
-
-#elif SIZEOF_LONG == 4
-
-  typedef long            Fixed;    /* signed fixed 16.16 float */
-
-#else
-
-#error "no 32bit type found"
-
-#endif
+  typedef int32_t         Fixed;    /* signed fixed 16.16 float */
 
   typedef int             Int;
 
@@ -117,7 +105,7 @@
 #define NULL  (void*)0
 #endif
 
-  typedef long*  PStorage;
+  typedef int32_t*  PStorage;
 
 
 /* Rounding mode constants */






Reply to: