Blame SOURCES/freetype-2.8-2.4.11-API.patch

b3c194
--- freetype-2.8/builds/unix/unix-cc.in.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/builds/unix/unix-cc.in	2018-06-07 19:16:35.881770695 +0200
b3c194
@@ -109,6 +109,6 @@ CCexe        := $(CCraw_build)	# used to
b3c194
 LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
b3c194
                           -rpath $(libdir) -version-info $(version_info) \
b3c194
                           $(LDFLAGS) -no-undefined \
b3c194
-                          -export-symbols $(EXPORTS_LIST)
b3c194
+                          # -export-symbols $(EXPORTS_LIST)
b3c194
 
b3c194
 # EOF
b3c194
--- freetype-2.8/ft2demos-2.8/src/ftview.c.api	2017-05-11 18:31:16.000000000 +0200
b3c194
+++ freetype-2.8/ft2demos-2.8/src/ftview.c	2018-06-04 16:53:29.960331386 +0200
b3c194
@@ -1531,8 +1531,8 @@
b3c194
       case FT_ENCODING_SJIS:
b3c194
         encoding = "SJIS";
b3c194
         break;
b3c194
-      case FT_ENCODING_PRC:
b3c194
-        encoding = "PRC";
b3c194
+      case FT_ENCODING_GB2312:
b3c194
+        encoding = "GB2312";
b3c194
         break;
b3c194
       case FT_ENCODING_BIG5:
b3c194
         encoding = "Big5";
b3c194
--- freetype-2.8/include/freetype/freetype.h.api	2017-05-13 06:28:40.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/freetype.h	2018-06-04 16:53:29.961331388 +0200
b3c194
@@ -766,15 +766,14 @@ FT_BEGIN_HEADER
b3c194
     FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
b3c194
 
b3c194
     FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
b3c194
-    FT_ENC_TAG( FT_ENCODING_PRC,     'g', 'b', ' ', ' ' ),
b3c194
+    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
b3c194
     FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
b3c194
     FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
b3c194
     FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
b3c194
 
b3c194
     /* for backward compatibility */
b3c194
-    FT_ENCODING_GB2312     = FT_ENCODING_PRC,
b3c194
     FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
b3c194
-    FT_ENCODING_MS_GB2312  = FT_ENCODING_PRC,
b3c194
+    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
b3c194
     FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
b3c194
     FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
b3c194
     FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
c7bece
@@ -799,7 +798,7 @@ FT_BEGIN_HEADER
c7bece
 #define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1
c7bece
 #define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2
c7bece
 #define ft_encoding_sjis            FT_ENCODING_SJIS
c7bece
-#define ft_encoding_gb2312          FT_ENCODING_PRC
c7bece
+#define ft_encoding_gb2312          FT_ENCODING_GB2312
c7bece
 #define ft_encoding_big5            FT_ENCODING_BIG5
c7bece
 #define ft_encoding_wansung         FT_ENCODING_WANSUNG
c7bece
 #define ft_encoding_johab           FT_ENCODING_JOHAB
b3c194
--- freetype-2.8/include/freetype/ftcache.h.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/ftcache.h	2018-06-04 16:53:29.961331388 +0200
b3c194
@@ -667,8 +667,8 @@ FT_BEGIN_HEADER
b3c194
   typedef struct  FTC_ImageTypeRec_
b3c194
   {
b3c194
     FTC_FaceID  face_id;
b3c194
-    FT_UInt     width;
b3c194
-    FT_UInt     height;
b3c194
+    FT_Int      width;
b3c194
+    FT_Int      height;
b3c194
     FT_Int32    flags;
b3c194
 
b3c194
   } FTC_ImageTypeRec;
b3c194
--- freetype-2.8/include/freetype/ftimage.h.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/ftimage.h	2018-06-04 16:53:29.962331389 +0200
b3c194
@@ -260,13 +260,13 @@ FT_BEGIN_HEADER
b3c194
   /*                                                                       */
b3c194
   typedef struct  FT_Bitmap_
b3c194
   {
b3c194
-    unsigned int    rows;
b3c194
-    unsigned int    width;
b3c194
+    int             rows;
b3c194
+    int             width;
b3c194
     int             pitch;
b3c194
     unsigned char*  buffer;
b3c194
-    unsigned short  num_grays;
b3c194
-    unsigned char   pixel_mode;
b3c194
-    unsigned char   palette_mode;
b3c194
+    short           num_grays;
b3c194
+    char            pixel_mode;
b3c194
+    char            palette_mode;
b3c194
     void*           palette;
b3c194
 
b3c194
   } FT_Bitmap;
b3c194
--- freetype-2.8/include/freetype/ftmm.h.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/ftmm.h	2018-06-04 16:53:29.962331389 +0200
b3c194
@@ -177,14 +177,10 @@ FT_BEGIN_HEADER
b3c194
   /*                                                                       */
b3c194
   /*    strid  :: The entry in `name' table identifying this instance.     */
b3c194
   /*                                                                       */
b3c194
-  /*    psid   :: The entry in `name' table identifying a PostScript name  */
b3c194
-  /*              for this instance.                                       */
b3c194
-  /*                                                                       */
b3c194
   typedef struct  FT_Var_Named_Style_
b3c194
   {
b3c194
     FT_Fixed*  coords;
b3c194
     FT_UInt    strid;
b3c194
-    FT_UInt    psid;   /* since 2.7.1 */
b3c194
 
b3c194
   } FT_Var_Named_Style;
b3c194
 
b3c194
--- freetype-2.8/include/freetype/ttnameid.h.api	2017-05-03 23:26:45.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/ttnameid.h	2018-06-04 16:53:29.963331391 +0200
b3c194
@@ -1217,9 +1217,9 @@ FT_BEGIN_HEADER
b3c194
   /* */
b3c194
 
b3c194
   /* for backward compatibility with older FreeType versions */
b3c194
-#define TT_UCR_ARABIC_PRESENTATION_A         \
b3c194
+#define TT_UCR_ARABIC_PRESENTATIONS_A         \
b3c194
           TT_UCR_ARABIC_PRESENTATION_FORMS_A
b3c194
-#define TT_UCR_ARABIC_PRESENTATION_B         \
b3c194
+#define TT_UCR_ARABIC_PRESENTATIONS_B         \
b3c194
           TT_UCR_ARABIC_PRESENTATION_FORMS_B
b3c194
 
b3c194
 #define TT_UCR_COMBINING_DIACRITICS          \
b3c194
--- freetype-2.8/include/freetype/tttables.h.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/tttables.h	2018-06-04 17:18:26.699449088 +0200
b3c194
@@ -383,7 +383,7 @@ FT_BEGIN_HEADER
b3c194
     FT_Short   xAvgCharWidth;
b3c194
     FT_UShort  usWeightClass;
b3c194
     FT_UShort  usWidthClass;
b3c194
-    FT_UShort  fsType;
b3c194
+    FT_Short   fsType;
b3c194
     FT_Short   ySubscriptXSize;
b3c194
     FT_Short   ySubscriptYSize;
b3c194
     FT_Short   ySubscriptXOffset;
b3c194
@@ -427,11 +427,6 @@ FT_BEGIN_HEADER
b3c194
     FT_UShort  usBreakChar;
b3c194
     FT_UShort  usMaxContext;
b3c194
 
b3c194
-    /* only version 5 and higher: */
b3c194
-
b3c194
-    FT_UShort  usLowerOpticalPointSize;       /* in twips (1/20th points) */
b3c194
-    FT_UShort  usUpperOpticalPointSize;       /* in twips (1/20th points) */
b3c194
-
b3c194
   } TT_OS2;
b3c194
 
b3c194
 
b3c194
@@ -596,43 +591,41 @@ FT_BEGIN_HEADER
b3c194
   /*    @FT_Get_Sfnt_Table API function.                                   */
b3c194
   /*                                                                       */
b3c194
   /* <Values>                                                              */
b3c194
-  /*    FT_SFNT_HEAD :: To access the font's @TT_Header structure.         */
b3c194
+  /*    ft_sfnt_head :: To access the font's @TT_Header structure.         */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure.     */
b3c194
+  /*    ft_sfnt_maxp :: To access the font's @TT_MaxProfile structure.     */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_OS2  :: To access the font's @TT_OS2 structure.            */
b3c194
+  /*    ft_sfnt_os2  :: To access the font's @TT_OS2 structure.            */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure.     */
b3c194
+  /*    ft_sfnt_hhea :: To access the font's @TT_HoriHeader structure.     */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure.     */
b3c194
+  /*    ft_sfnt_vhea :: To access the font's @TT_VertHeader structure.     */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_POST :: To access the font's @TT_Postscript structure.     */
b3c194
+  /*    ft_sfnt_post :: To access the font's @TT_Postscript structure.     */
b3c194
   /*                                                                       */
b3c194
-  /*    FT_SFNT_PCLT :: To access the font's @TT_PCLT structure.           */
b3c194
+  /*    ft_sfnt_pclt :: To access the font's @TT_PCLT structure.           */
b3c194
   /*                                                                       */
b3c194
   typedef enum  FT_Sfnt_Tag_
b3c194
   {
b3c194
-    FT_SFNT_HEAD,
b3c194
-    FT_SFNT_MAXP,
b3c194
-    FT_SFNT_OS2,
b3c194
-    FT_SFNT_HHEA,
b3c194
-    FT_SFNT_VHEA,
b3c194
-    FT_SFNT_POST,
b3c194
-    FT_SFNT_PCLT,
b3c194
+    ft_sfnt_head = 0,
b3c194
+    ft_sfnt_maxp = 1,
b3c194
+    ft_sfnt_os2  = 2,
b3c194
+    ft_sfnt_hhea = 3,
b3c194
+    ft_sfnt_vhea = 4,
b3c194
+    ft_sfnt_post = 5,
b3c194
+    ft_sfnt_pclt = 6,
b3c194
 
b3c194
-    FT_SFNT_MAX
b3c194
+    sfnt_max
b3c194
 
b3c194
   } FT_Sfnt_Tag;
b3c194
 
b3c194
-  /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
b3c194
-  /* values instead                                                      */
b3c194
-#define ft_sfnt_head  FT_SFNT_HEAD
b3c194
-#define ft_sfnt_maxp  FT_SFNT_MAXP
b3c194
-#define ft_sfnt_os2   FT_SFNT_OS2
b3c194
-#define ft_sfnt_hhea  FT_SFNT_HHEA
b3c194
-#define ft_sfnt_vhea  FT_SFNT_VHEA
b3c194
-#define ft_sfnt_post  FT_SFNT_POST
b3c194
-#define ft_sfnt_pclt  FT_SFNT_PCLT
b3c194
+#define FT_SFNT_HEAD ft_sfnt_head
b3c194
+#define FT_SFNT_MAXP ft_sfnt_maxp
b3c194
+#define FT_SFNT_OS2  ft_sfnt_os2 
b3c194
+#define FT_SFNT_HHEA ft_sfnt_hhea
b3c194
+#define FT_SFNT_VHEA ft_sfnt_vhea
b3c194
+#define FT_SFNT_POST ft_sfnt_post
b3c194
+#define FT_SFNT_PCLT ft_sfnt_pclt
b3c194
 
b3c194
 
b3c194
   /*************************************************************************/
b3c194
--- freetype-2.8/src/sfnt/sfdriver.c.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/sfnt/sfdriver.c	2018-06-04 16:53:29.964331392 +0200
b3c194
@@ -867,16 +867,9 @@
b3c194
       SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
b3c194
 
b3c194
       FT_Long  instance = ( ( face->root.face_index & 0x7FFF0000L ) >> 16 ) - 1;
b3c194
-      FT_UInt  psid     = mm_var->namedstyle[instance].psid;
b3c194
 
b3c194
       char*  ps_name = NULL;
b3c194
 
b3c194
-
b3c194
-      /* try first to load the name string with index `postScriptNameID' */
b3c194
-      if ( psid == 6                      ||
b3c194
-           ( psid > 255 && psid < 32768 ) )
b3c194
-        (void)sfnt->get_name( face, (FT_UShort)psid, &ps_name );
b3c194
-
b3c194
       if ( ps_name )
b3c194
       {
b3c194
         result = ps_name;
b3c194
--- freetype-2.8/src/sfnt/sfobjs.c.api	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/sfnt/sfobjs.c	2018-06-04 16:53:29.964331392 +0200
b3c194
@@ -311,7 +311,7 @@
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UCS_4,      FT_ENCODING_UNICODE },
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE },
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SJIS,       FT_ENCODING_SJIS },
b3c194
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_PRC,        FT_ENCODING_PRC },
b3c194
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_GB2312,     FT_ENCODING_GB2312 },
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_BIG_5,      FT_ENCODING_BIG5 },
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_WANSUNG,    FT_ENCODING_WANSUNG },
b3c194
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_JOHAB,      FT_ENCODING_JOHAB }
b3c194
--- freetype-2.8/src/sfnt/ttload.c.api	2017-04-22 07:39:36.000000000 +0200
b3c194
+++ freetype-2.8/src/sfnt/ttload.c	2018-06-04 16:53:29.965331393 +0200
b3c194
@@ -1164,15 +1164,6 @@
b3c194
       FT_FRAME_END
b3c194
     };
b3c194
 
b3c194
-    /* `OS/2' version 5 and newer */
b3c194
-    static const FT_Frame_Field  os2_fields_extra5[] =
b3c194
-    {
b3c194
-      FT_FRAME_START( 4 ),
b3c194
-        FT_FRAME_USHORT( usLowerOpticalPointSize ),
b3c194
-        FT_FRAME_USHORT( usUpperOpticalPointSize ),
b3c194
-      FT_FRAME_END
b3c194
-    };
b3c194
-
b3c194
 
b3c194
     /* We now support old Mac fonts where the OS/2 table doesn't  */
b3c194
     /* exist.  Simply put, we set the `version' field to 0xFFFF   */
b3c194
@@ -1193,8 +1184,6 @@
b3c194
     os2->usDefaultChar           = 0;
b3c194
     os2->usBreakChar             = 0;
b3c194
     os2->usMaxContext            = 0;
b3c194
-    os2->usLowerOpticalPointSize = 0;
b3c194
-    os2->usUpperOpticalPointSize = 0xFFFF;
b3c194
 
b3c194
     if ( os2->version >= 0x0001 )
b3c194
     {
b3c194
@@ -1207,13 +1196,6 @@
b3c194
         /* only version 2 tables */
b3c194
         if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
b3c194
           goto Exit;
b3c194
-
b3c194
-        if ( os2->version >= 0x0005 )
b3c194
-        {
b3c194
-          /* only version 5 tables */
b3c194
-          if ( FT_STREAM_READ_FIELDS( os2_fields_extra5, os2 ) )
b3c194
-            goto Exit;
b3c194
-        }
b3c194
       }
b3c194
     }
b3c194
 
b3c194
--- freetype-2.8/src/truetype/ttgxvar.c.api	2017-05-02 14:37:55.000000000 +0200
b3c194
+++ freetype-2.8/src/truetype/ttgxvar.c	2018-06-04 16:53:29.966331395 +0200
b3c194
@@ -2155,7 +2155,7 @@
b3c194
           *c = FT_GET_LONG();
b3c194
 
b3c194
         if ( usePsName )
b3c194
-          ns->psid = FT_GET_USHORT();
b3c194
+          (void) FT_GET_USHORT();
b3c194
 
b3c194
         ft_var_to_normalized( face,
b3c194
                               fvar_head.axisCount,
b3c194
@@ -2206,7 +2206,6 @@
b3c194
             ns = &mmvar->namedstyle[fvar_head.instanceCount];
b3c194
 
b3c194
             ns->strid = strid;
b3c194
-            ns->psid  = TT_NAME_ID_PS_NAME;
b3c194
 
b3c194
             a = mmvar->axis;
b3c194
             c = ns->coords;
b3c194
--- freetype-2.8/devel/ftoption.h.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/devel/ftoption.h	2018-06-07 11:30:34.431455285 +0200
b3c194
@@ -903,7 +903,7 @@ FT_BEGIN_HEADER
b3c194
    * This macro is obsolete.  Support has been removed in FreeType
b3c194
    * version 2.5.
b3c194
    */
b3c194
-/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
b3c194
+#define FT_CONFIG_OPTION_OLD_INTERNALS
b3c194
 
b3c194
 
b3c194
   /*
b3c194
--- freetype-2.8/include/freetype/config/ftoption.h.orig	2017-05-01 09:39:06.000000000 +0200
b3c194
+++ freetype-2.8/include/freetype/config/ftoption.h	2018-06-07 11:30:53.662506048 +0200
b3c194
@@ -934,7 +934,7 @@ FT_BEGIN_HEADER
b3c194
    * This macro is obsolete.  Support has been removed in FreeType
b3c194
    * version 2.5.
b3c194
    */
b3c194
-/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
b3c194
+#define FT_CONFIG_OPTION_OLD_INTERNALS
b3c194
 
b3c194
 
b3c194
   /*
b3c194
--- freetype-2.8/include/freetype/ftcache.h.orig	2018-06-07 11:33:07.663882169 +0200
b3c194
+++ freetype-2.8/include/freetype/ftcache.h	2018-06-07 11:33:23.127947502 +0200
b3c194
@@ -1049,6 +1049,54 @@ FT_BEGIN_HEADER
b3c194
   /* */
b3c194
 
b3c194
 
b3c194
+#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
b3c194
+
b3c194
+  /*@***********************************************************************/
b3c194
+  /*                                                                       */
b3c194
+  /* <Struct>                                                              */
b3c194
+  /*    FTC_FontRec                                                        */
b3c194
+  /*                                                                       */
b3c194
+  /* <Description>                                                         */
b3c194
+  /*    A simple structure used to describe a given `font' to the cache    */
b3c194
+  /*    manager.  Note that a `font' is the combination of a given face    */
b3c194
+  /*    with a given character size.                                       */
b3c194
+  /*                                                                       */
b3c194
+  /* <Fields>                                                              */
b3c194
+  /*    face_id    :: The ID of the face to use.                           */
b3c194
+  /*                                                                       */
b3c194
+  /*    pix_width  :: The character width in integer pixels.               */
b3c194
+  /*                                                                       */
b3c194
+  /*    pix_height :: The character height in integer pixels.              */
b3c194
+  /*                                                                       */
b3c194
+  typedef struct  FTC_FontRec_
b3c194
+  {
b3c194
+    FTC_FaceID  face_id;
b3c194
+    FT_UShort   pix_width;
b3c194
+    FT_UShort   pix_height;
b3c194
+
b3c194
+  } FTC_FontRec;
b3c194
+
b3c194
+
b3c194
+  /* */
b3c194
+
b3c194
+
b3c194
+  typedef FTC_FontRec*  FTC_Font;
b3c194
+
b3c194
+
b3c194
+  FT_EXPORT( FT_Error )
b3c194
+  FTC_Manager_Lookup_Face( FTC_Manager  manager,
b3c194
+                           FTC_FaceID   face_id,
b3c194
+                           FT_Face     *aface );
b3c194
+
b3c194
+  FT_EXPORT( FT_Error )
b3c194
+  FTC_Manager_Lookup_Size( FTC_Manager  manager,
b3c194
+                           FTC_Font     font,
b3c194
+                           FT_Face     *aface,
b3c194
+                           FT_Size     *asize );
b3c194
+
b3c194
+#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
b3c194
+
b3c194
+
b3c194
 FT_END_HEADER
b3c194
 
b3c194
 #endif /* FTCACHE_H_ */
b3c194
--- freetype-2.8/src/cache/ftcmanag.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/cache/ftcmanag.c	2018-06-07 11:28:18.663096906 +0200
b3c194
@@ -701,4 +701,55 @@
b3c194
   }
b3c194
 
b3c194
 
b3c194
+#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
b3c194
+
b3c194
+  FT_EXPORT_DEF( FT_Error )
b3c194
+  FTC_Manager_Lookup_Face( FTC_Manager  manager,
b3c194
+                           FTC_FaceID   face_id,
b3c194
+                           FT_Face     *aface )
b3c194
+  {
b3c194
+    return FTC_Manager_LookupFace( manager, face_id, aface );
b3c194
+  }
b3c194
+
b3c194
+
b3c194
+  FT_EXPORT( FT_Error )
b3c194
+  FTC_Manager_Lookup_Size( FTC_Manager  manager,
b3c194
+                           FTC_Font     font,
b3c194
+                           FT_Face     *aface,
b3c194
+                           FT_Size     *asize )
b3c194
+  {
b3c194
+    FTC_ScalerRec  scaler;
b3c194
+    FT_Error       error;
b3c194
+    FT_Size        size;
b3c194
+    FT_Face        face;
b3c194
+
b3c194
+
b3c194
+    scaler.face_id = font->face_id;
b3c194
+    scaler.width   = font->pix_width;
b3c194
+    scaler.height  = font->pix_height;
b3c194
+    scaler.pixel   = TRUE;
b3c194
+    scaler.x_res   = 0;
b3c194
+    scaler.y_res   = 0;
b3c194
+
b3c194
+    error = FTC_Manager_LookupSize( manager, &scaler, &size );
b3c194
+    if ( error )
b3c194
+    {
b3c194
+      face = NULL;
b3c194
+      size = NULL;
b3c194
+    }
b3c194
+    else
b3c194
+      face = size->face;
b3c194
+
b3c194
+    if ( aface )
b3c194
+      *aface = face;
b3c194
+
b3c194
+    if ( asize )
b3c194
+      *asize = size;
b3c194
+
b3c194
+    return error;
b3c194
+  }
b3c194
+
b3c194
+#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
b3c194
+
b3c194
+
b3c194
 /* END */
b3c194
--- freetype-2.8/ft2demos-2.8/graph/x11/grx11.c.orig	2016-10-19 06:55:23.000000000 +0200
b3c194
+++ freetype-2.8/ft2demos-2.8/graph/x11/grx11.c	2018-06-07 16:41:52.626432650 +0200
b3c194
@@ -1404,8 +1404,8 @@ typedef  unsigned long   uint32;
b3c194
                                     RootWindow( display, screen ),
b3c194
                                     0,
b3c194
                                     0,
b3c194
-                                    (unsigned int)bitmap->width,
b3c194
-                                    (unsigned int)bitmap->rows,
b3c194
+                                    bitmap->width,
b3c194
+                                    bitmap->rows,
b3c194
                                     10,
b3c194
                                     format->x_depth,
b3c194
                                     InputOutput,
b3c194
--- freetype-2.8/src/base/ftbitmap.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/base/ftbitmap.c	2018-06-07 18:26:08.488060315 +0200
b3c194
@@ -90,7 +90,7 @@
b3c194
 
b3c194
     if ( pitch < 0 )
b3c194
       pitch = -pitch;
b3c194
-    size = (FT_ULong)pitch * source->rows;
b3c194
+    size = (FT_ULong)( pitch * source->rows );
b3c194
 
b3c194
     if ( target->buffer )
b3c194
     {
b3c194
@@ -100,7 +100,7 @@
b3c194
 
b3c194
       if ( target_pitch < 0 )
b3c194
         target_pitch = -target_pitch;
b3c194
-      target_size = (FT_ULong)target_pitch * target->rows;
b3c194
+      target_size = (FT_ULong)( target_pitch * target->rows );
b3c194
 
b3c194
       if ( target_size != size )
b3c194
         (void)FT_QREALLOC( target->buffer, target_size, size );
b3c194
@@ -156,7 +156,7 @@
b3c194
     int             pitch;
b3c194
     int             new_pitch;
b3c194
     FT_UInt         bpp;
b3c194
-    FT_UInt         i, width, height;
b3c194
+    FT_Int          i, width, height;
b3c194
     unsigned char*  buffer = NULL;
b3c194
 
b3c194
 
b3c194
@@ -194,17 +194,17 @@
b3c194
     if ( ypixels == 0 && new_pitch <= pitch )
b3c194
     {
b3c194
       /* zero the padding */
b3c194
-      FT_UInt  bit_width = (FT_UInt)pitch * 8;
b3c194
-      FT_UInt  bit_last  = ( width + xpixels ) * bpp;
b3c194
+      FT_Int  bit_width = pitch * 8;
b3c194
+      FT_Int  bit_last  = ( width + xpixels ) * bpp;
b3c194
 
b3c194
 
b3c194
       if ( bit_last < bit_width )
b3c194
       {
b3c194
         FT_Byte*  line  = bitmap->buffer + ( bit_last >> 3 );
b3c194
         FT_Byte*  end   = bitmap->buffer + pitch;
b3c194
-        FT_UInt   shift = bit_last & 7;
b3c194
+        FT_Int    shift = bit_last & 7;
b3c194
         FT_UInt   mask  = 0xFF00U >> shift;
b3c194
-        FT_UInt   count = height;
b3c194
+        FT_Int    count = height;
b3c194
 
b3c194
 
b3c194
         for ( ; count > 0; count--, line += pitch, end += pitch )
b3c194
@@ -233,7 +233,7 @@
b3c194
     /* thus take care of the flow direction         */
b3c194
     if ( bitmap->pitch > 0 )
b3c194
     {
b3c194
-      FT_UInt  len = ( width * bpp + 7 ) >> 3;
b3c194
+      FT_Int  len = ( width * bpp + 7 ) >> 3;
b3c194
 
b3c194
 
b3c194
       for ( i = 0; i < bitmap->rows; i++ )
b3c194
@@ -243,7 +243,7 @@
b3c194
     }
b3c194
     else
b3c194
     {
b3c194
-      FT_UInt  len = ( width * bpp + 7 ) >> 3;
b3c194
+      FT_Int  len = ( width * bpp + 7 ) >> 3;
b3c194
 
b3c194
 
b3c194
       for ( i = 0; i < bitmap->rows; i++ )
b3c194
@@ -275,8 +275,7 @@
b3c194
   {
b3c194
     FT_Error        error;
b3c194
     unsigned char*  p;
b3c194
-    FT_Int          i, x, pitch;
b3c194
-    FT_UInt         y;
b3c194
+    FT_Int          i, x, y, pitch;
b3c194
     FT_Int          xstr, ystr;
b3c194
 
b3c194
 
b3c194
@@ -420,8 +419,8 @@
b3c194
       p += bitmap->pitch;
b3c194
     }
b3c194
 
b3c194
-    bitmap->width += (FT_UInt)xstr;
b3c194
-    bitmap->rows += (FT_UInt)ystr;
b3c194
+    bitmap->width += xstr;
b3c194
+    bitmap->rows += ystr;
b3c194
 
b3c194
     return FT_Err_Ok;
b3c194
   }
b3c194
@@ -506,8 +505,8 @@
b3c194
     case FT_PIXEL_MODE_LCD_V:
b3c194
     case FT_PIXEL_MODE_BGRA:
b3c194
       {
b3c194
-        FT_Int    pad, old_target_pitch, target_pitch;
b3c194
-        FT_ULong  old_size;
b3c194
+        FT_Int   pad, old_target_pitch, target_pitch;
b3c194
+        FT_Long  old_size;
b3c194
 
b3c194
 
b3c194
         old_target_pitch = target->pitch;
b3c194
@@ -617,7 +616,7 @@
b3c194
     case FT_PIXEL_MODE_LCD:
b3c194
     case FT_PIXEL_MODE_LCD_V:
b3c194
       {
b3c194
-        FT_UInt  width = source->width;
b3c194
+        FT_Int   width = source->width;
b3c194
         FT_UInt  i;
b3c194
 
b3c194
 
b3c194
--- freetype-2.8/src/pcf/pcfdrivr.c.orig	2018-06-07 11:42:57.757375204 +0200
b3c194
+++ freetype-2.8/src/pcf/pcfdrivr.c	2018-06-07 16:59:25.832896549 +0200
b3c194
@@ -523,10 +523,10 @@ THE SOFTWARE.
b3c194
 
b3c194
     metric = face->metrics + glyph_index;
b3c194
 
b3c194
-    bitmap->rows       = (unsigned int)( metric->ascent +
b3c194
-                                         metric->descent );
b3c194
-    bitmap->width      = (unsigned int)( metric->rightSideBearing -
b3c194
-                                         metric->leftSideBearing );
b3c194
+    bitmap->rows       = ( metric->ascent +
b3c194
+                           metric->descent );
b3c194
+    bitmap->width      = ( metric->rightSideBearing -
b3c194
+                           metric->leftSideBearing );
b3c194
     bitmap->num_grays  = 1;
b3c194
     bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
b3c194
 
b3c194
--- freetype-2.8/src/raster/ftraster.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/raster/ftraster.c	2018-06-07 18:07:14.977278387 +0200
b3c194
@@ -2479,7 +2479,7 @@
b3c194
       {
b3c194
         e1 = TRUNC( e1 );
b3c194
 
b3c194
-        if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
b3c194
+        if ( e1 >= 0 && e1 < ras.target.rows )
b3c194
         {
b3c194
           Byte   f1;
b3c194
           PByte  bits;
b3c194
@@ -2589,7 +2589,7 @@
b3c194
         /* bounding box instead                                           */
b3c194
         if ( pxl < 0 )
b3c194
           pxl = e1;
b3c194
-        else if ( (ULong)( TRUNC( pxl ) ) >= ras.target.rows )
b3c194
+        else if ( ( TRUNC( pxl ) ) >= ras.target.rows )
b3c194
           pxl = e2;
b3c194
 
b3c194
         /* check that the other pixel isn't set */
b3c194
@@ -2604,9 +2604,9 @@
b3c194
         if ( ras.target.pitch > 0 )
b3c194
           bits += (Long)( ras.target.rows - 1 ) * ras.target.pitch;
b3c194
 
b3c194
-        if ( e1 >= 0                     &&
b3c194
-             (ULong)e1 < ras.target.rows &&
b3c194
-             *bits & f1                  )
b3c194
+        if ( e1 >= 0              &&
b3c194
+             e1 < ras.target.rows &&
b3c194
+             *bits & f1           )
b3c194
           goto Exit;
b3c194
       }
b3c194
       else
b3c194
@@ -2615,7 +2615,7 @@
b3c194
 
b3c194
     e1 = TRUNC( pxl );
b3c194
 
b3c194
-    if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
b3c194
+    if ( e1 >= 0 && e1 < ras.target.rows )
b3c194
     {
b3c194
       FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
b3c194
 
b3c194
--- freetype-2.8/src/sfnt/pngshim.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/sfnt/pngshim.c	2018-06-07 18:08:07.825359421 +0200
b3c194
@@ -209,10 +209,10 @@
b3c194
     }
b3c194
 
b3c194
     if ( !populate_map_and_metrics                            &&
b3c194
-         ( (FT_UInt)x_offset + metrics->width  > map->width ||
b3c194
-           (FT_UInt)y_offset + metrics->height > map->rows  ||
b3c194
-           pix_bits != 32                                   ||
b3c194
-           map->pixel_mode != FT_PIXEL_MODE_BGRA            ) )
b3c194
+         ( x_offset + metrics->width  > map->width ||
b3c194
+           y_offset + metrics->height > map->rows  ||
b3c194
+           pix_bits != 32                          ||
b3c194
+           map->pixel_mode != FT_PIXEL_MODE_BGRA   ) )
b3c194
     {
b3c194
       error = FT_THROW( Invalid_Argument );
b3c194
       goto Exit;
b3c194
@@ -270,7 +270,7 @@
b3c194
       map->num_grays  = 256;
b3c194
 
b3c194
       /* reject too large bitmaps similarly to the rasterizer */
b3c194
-      if ( map->rows > 0x7FFF || map->width > 0x7FFF )
b3c194
+      if ( map->rows > 0x4FFF || map->width > 0x4FFF )
b3c194
       {
b3c194
         error = FT_THROW( Array_Too_Large );
b3c194
         goto DestroyExit;
b3c194
@@ -346,7 +346,7 @@
b3c194
 
b3c194
     if ( populate_map_and_metrics )
b3c194
     {
b3c194
-      /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
b3c194
+      /* this doesn't overflow: 0x4FFF * 0x4FFF * 4 < 2^31 */
b3c194
       FT_ULong  size = map->rows * (FT_ULong)map->pitch;
b3c194
 
b3c194
 
b3c194
--- freetype-2.8/src/sfnt/ttsbit.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/sfnt/ttsbit.c	2018-06-07 18:31:57.610612501 +0200
b3c194
@@ -705,7 +705,7 @@
b3c194
     FT_Error    error = FT_Err_Ok;
b3c194
     FT_Byte*    line;
b3c194
     FT_Int      pitch, width, height, line_bits, h;
b3c194
-    FT_UInt     bit_height, bit_width;
b3c194
+    FT_Int      bit_height, bit_width;
b3c194
     FT_Bitmap*  bitmap;
b3c194
 
b3c194
     FT_UNUSED( recurse_count );
b3c194
--- freetype-2.8/src/smooth/ftgrays.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/smooth/ftgrays.c	2018-06-07 17:01:09.008070697 +0200
b3c194
@@ -1880,7 +1880,7 @@ typedef ptrdiff_t  FT_PtrDist;
b3c194
         ras.target.origin = target_map->buffer;
b3c194
       else
b3c194
         ras.target.origin = target_map->buffer
b3c194
-              + ( target_map->rows - 1 ) * (unsigned int)target_map->pitch;
b3c194
+              + (unsigned int) (( target_map->rows - 1 ) * target_map->pitch);
b3c194
 
b3c194
       ras.target.pitch = target_map->pitch;
b3c194
 
b3c194
--- freetype-2.8/src/smooth/ftsmooth.c.orig	2017-05-01 09:35:12.000000000 +0200
b3c194
+++ freetype-2.8/src/smooth/ftsmooth.c	2018-06-07 17:01:51.040141641 +0200
b3c194
@@ -292,8 +292,8 @@
b3c194
 
b3c194
     bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
b3c194
     bitmap->num_grays  = 256;
b3c194
-    bitmap->width      = (unsigned int)width;
b3c194
-    bitmap->rows       = (unsigned int)height;
b3c194
+    bitmap->width      = width;
b3c194
+    bitmap->rows       = height;
b3c194
     bitmap->pitch      = pitch;
b3c194
 
b3c194
     /* translate outline to render it into the bitmap */
b3c194
--- freetype-2.8/src/winfonts/winfnt.c.orig	2017-03-30 12:20:23.000000000 +0200
b3c194
+++ freetype-2.8/src/winfonts/winfnt.c	2018-06-07 18:21:47.809648016 +0200
b3c194
@@ -1038,7 +1038,7 @@
b3c194
 
b3c194
     p = font->fnt_frame + offset;
b3c194
 
b3c194
-    bitmap->width = FT_NEXT_USHORT_LE( p );
b3c194
+    bitmap->width = FT_NEXT_SHORT_LE( p );
b3c194
 
b3c194
     /* jump to glyph entry */
b3c194
     if ( new_format )
b3c194
@@ -1079,7 +1079,7 @@
b3c194
     /* allocate and build bitmap */
b3c194
     {
b3c194
       FT_Memory  memory = FT_FACE_MEMORY( slot->face );
b3c194
-      FT_UInt    pitch  = ( bitmap->width + 7 ) >> 3;
b3c194
+      FT_Int     pitch  = ( bitmap->width + 7 ) >> 3;
b3c194
       FT_Byte*   column;
b3c194
       FT_Byte*   write;
b3c194