shithub: freetype+ttf2subf

Download patch

ref: 464b16ba46c5ce44aa0dae2e67fefe7c2abbd7f1
parent: f4253366f1d90e6b28b4b3e34ed74e24aa7c2c31
author: Werner Lemberg <[email protected]>
date: Fri Jan 27 03:45:46 EST 2017

s/GB2312/PRC/.

* include/freetype/freetype.h (FT_ENCODING_PRC): New enum value.
(FT_ENCODING_GB2312): Deprecated.

* include/freetype/ttnameid.h (TT_MS_ID_PRC): New macro.
(TT_MS_ID_GB2312): Deprecated.

* src/sfnt/sfobjs.c (sfnt_find_encoding): Updated.

* docs/CHANGES: Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2017-01-27  Werner Lemberg  <[email protected]>
+
+	s/GB2312/PRC/.
+
+	* include/freetype/freetype.h (FT_ENCODING_PRC): New enum value.
+	(FT_ENCODING_GB2312): Deprecated.
+
+	* include/freetype/ttnameid.h (TT_MS_ID_PRC): New macro.
+	(TT_MS_ID_GB2312): Deprecated.
+
+	* src/sfnt/sfobjs.c (sfnt_find_encoding): Updated.
+
+	* docs/CHANGES: Updated.
+
 2017-01-26  Werner Lemberg  <[email protected]>
 
 	[base] Add `FT_Get_Sfnt_LangTag' function.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -44,7 +44,7 @@
       . Format  1 `name' tables  are now supported.  Use  new function
         `FT_Get_Sfnt_LangTag' to access associated language tags.
 
-      . Language ID  and name ID values have been  updated to OpenType
+      . Language, encoding, and name IDs have been updated to OpenType
         version 1.8.1.
 
 
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -653,9 +653,10 @@
   /*      `http://en.wikipedia.org/wiki/Shift_JIS'.  See note on           */
   /*      multi-byte encodings below.                                      */
   /*                                                                       */
-  /*    FT_ENCODING_GB2312 ::                                              */
-  /*      Corresponds to an encoding system for Simplified Chinese as      */
-  /*      used in mainland China.                                          */
+  /*    FT_ENCODING_PRC ::                                                 */
+  /*      Corresponds to encoding systems mainly for Simplified Chinese as */
+  /*      used in People's Republic of China (PRC).  The encoding layout   */
+  /*      is based on GB~2312 and its supersets GBK and GB~18030.          */
   /*                                                                       */
   /*    FT_ENCODING_BIG5 ::                                                */
   /*      Corresponds to an encoding system for Traditional Chinese as     */
@@ -701,7 +702,7 @@
   /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */
   /*                                                                       */
   /*    FT_ENCODING_MS_GB2312 ::                                           */
-  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */
+  /*      Same as FT_ENCODING_PRC.  Deprecated.                            */
   /*                                                                       */
   /*    FT_ENCODING_MS_BIG5 ::                                             */
   /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */
@@ -759,14 +760,15 @@
     FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
 
     FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
-    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
+    FT_ENC_TAG( FT_ENCODING_PRC,     'g', 'b', ' ', ' ' ),
     FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
     FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
     FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
 
     /* for backwards compatibility */
+    FT_ENCODING_GB2312     = FT_ENCODING_PRC,
     FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
-    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
+    FT_ENCODING_MS_GB2312  = FT_ENCODING_PRC,
     FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
     FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
     FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
@@ -791,7 +793,7 @@
 #define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1
 #define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2
 #define ft_encoding_sjis            FT_ENCODING_SJIS
-#define ft_encoding_gb2312          FT_ENCODING_GB2312
+#define ft_encoding_gb2312          FT_ENCODING_PRC
 #define ft_encoding_big5            FT_ENCODING_BIG5
 #define ft_encoding_wansung         FT_ENCODING_WANSUNG
 #define ft_encoding_johab           FT_ENCODING_JOHAB
--- a/include/freetype/ttnameid.h
+++ b/include/freetype/ttnameid.h
@@ -225,9 +225,10 @@
    *   TT_MS_ID_SJIS ::
    *     Shift JIS Japanese encoding.  See @FT_ENCODING_SJIS.
    *
-   *   TT_MS_ID_GB2312 ::
-   *     Simplified Chinese as used in Mainland China.  See
-   *     @FT_ENCODING_GB2312.
+   *   TT_MS_ID_PRC ::
+   *     Chinese encodings as used in the People's Republic of China (PRC).
+   *     This means the encodings GB~2312 and its supersets GBK and
+   *     GB~18030.  See @FT_ENCODING_PRC.
    *
    *   TT_MS_ID_BIG_5 ::
    *     Traditional Chinese as used in Taiwan and Hong Kong.  See
@@ -247,11 +248,14 @@
 #define TT_MS_ID_SYMBOL_CS    0
 #define TT_MS_ID_UNICODE_CS   1
 #define TT_MS_ID_SJIS         2
-#define TT_MS_ID_GB2312       3
+#define TT_MS_ID_PRC          3
 #define TT_MS_ID_BIG_5        4
 #define TT_MS_ID_WANSUNG      5
 #define TT_MS_ID_JOHAB        6
 #define TT_MS_ID_UCS_4       10
+
+  /* this value is deprecated */
+#define TT_MS_ID_GB2312  TT_MS_ID_PRC
 
 
   /***********************************************************************
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -311,7 +311,7 @@
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UCS_4,      FT_ENCODING_UNICODE },
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE },
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SJIS,       FT_ENCODING_SJIS },
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_GB2312,     FT_ENCODING_GB2312 },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_PRC,        FT_ENCODING_PRC },
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_BIG_5,      FT_ENCODING_BIG5 },
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_WANSUNG,    FT_ENCODING_WANSUNG },
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_JOHAB,      FT_ENCODING_JOHAB }