shithub: freetype+ttf2subf

Download patch

ref: ed2a8df000692c0df7ba36ab651a91ab775a0ada
parent: cc823200c1f3359c97d4fbb77e24000e2bc84095
author: Werner Lemberg <[email protected]>
date: Mon Sep 1 03:06:06 EDT 2003

* src/bdf/bdflib.c (_bdf_readstream): Don't use FT_MEM_COPY but
FT_MEM_MOVE.

* include/freetype/freetype.h (FT_ENCODING_SJIS, FT_ENCODING_GB2312,
FT_ENCODING_BIG5, FT_ENCODING_WANSUNG, FT_ENCODING_JOHAB): New
enumerations of FT_Encoding.  The FT_ENCODING_MS_* variants except
FT_ENCODING_MS_SYMBOL are now deprecated.
Updated all users.
* docs/CHANGES: Document it.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003-08-31  Manish Singh  <[email protected]>
+
+	* src/bdf/bdflib.c (_bdf_readstream): Don't use FT_MEM_COPY but
+	FT_MEM_MOVE.
+
+2003-08-30  Werner Lemberg  <[email protected]>
+
+	* include/freetype/freetype.h (FT_ENCODING_SJIS, FT_ENCODING_GB2312,
+	FT_ENCODING_BIG5, FT_ENCODING_WANSUNG, FT_ENCODING_JOHAB): New
+	enumerations of FT_Encoding.  The FT_ENCODING_MS_* variants except
+	FT_ENCODING_MS_SYMBOL are now deprecated.
+	Updated all users.
+	* docs/CHANGES: Document it.
+
 2003-08-27  Werner Lemberg  <[email protected]>
 
 	* src/bdf/bdfdrivr.c (BDF_Face_Init): Accept lowercase characters
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -64,6 +64,10 @@
 
     - ft_module_xxx flags are now deprecated in favour of FT_MODULE_XXX.
 
+    - FT_ENCODING_MS_{SJIS,GB2312,BIG5,WANSUNG,JOHAB} are now deprecated
+      in favour of FT_ENCODING_{SJIS,GB2312,GIB5,WANSONG,JOHAB} -- those
+      encodings are not specific to Microsoft.
+
 
   III. MISCELLANEOUS
 
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -509,30 +509,28 @@
   /*     mathematical symbols in the 32..255 character code range.  For    */
   /*     more information, see `http://www.ceviz.net/symbol.htm'.          */
   /*                                                                       */
-  /*   FT_ENCODING_MS_SJIS ::                                              */
-  /*     Corresponds to Microsoft's Japanese SJIS encoding.  More info     */
+  /*   FT_ENCODING_SJIS ::                                                 */
+  /*     Corresponds to Japanese SJIS encoding.  More info at              */
   /*     at `http://langsupport.japanreference.com/encoding.shtml'.        */
   /*     See note on multi-byte encodings below.                           */
   /*                                                                       */
-  /*   FT_ENCODING_MS_GB2312 ::                                            */
-  /*     Corresponds to the encoding system for Simplified Chinese, as     */
-  /*     used in China.  Only found in some TrueType fonts.                */
+  /*   FT_ENCODING_GB2312 ::                                               */
+  /*     Corresponds to an encoding system for Simplified Chinese as used  */
+  /*     used in mainland China.                                           */
   /*                                                                       */
-  /*   FT_ENCODING_MS_BIG5 ::                                              */
-  /*     Corresponds to the encoding system for Traditional Chinese, as    */
-  /*     used in Taiwan and Hong Kong.  Only found in some TrueType fonts. */
+  /*   FT_ENCODING_BIG5 ::                                                 */
+  /*     Corresponds to an encoding system for Traditional Chinese as used */
+  /*     in Taiwan and Hong Kong.                                          */
   /*                                                                       */
-  /*   FT_ENCODING_MS_WANSUNG ::                                           */
+  /*   FT_ENCODING_WANSUNG ::                                              */
   /*     Corresponds to the Korean encoding system known as Wansung.       */
-  /*     This is a Microsoft encoding that is only found in some TrueType  */
-  /*     fonts.  For more information, see                                 */
+  /*     For more information see                                          */
   /*     `http://www.microsoft.com/typography/unicode/949.txt'.            */
   /*                                                                       */
-  /*   FT_ENCODING_MS_JOHAB ::                                             */
+  /*   FT_ENCODING_JOHAB ::                                                */
   /*     The Korean standard character set (KS C-5601-1992), which         */
-  /*     corresponds to Windows code page 1361.  This character set        */
+  /*     corresponds to MS Windows code page 1361.  This character set     */
   /*     includes all possible Hangeul character combinations.             */
-  /*     Only found on some rare TrueType fonts.                           */
   /*                                                                       */
   /*   FT_ENCODING_ADOBE_LATIN_1 ::                                        */
   /*     Corresponds to a Latin-1 encoding as defined in a Type 1          */
@@ -561,6 +559,21 @@
   /*     This value is deprecated and was never used nor reported by       */
   /*     FreeType.  Don't use or test for it.                              */
   /*                                                                       */
+  /*   FT_ENCODING_MS_SJIS ::                                              */
+  /*     Same as FT_ENCODING_SJIS.  Deprecated.                            */
+  /*                                                                       */
+  /*   FT_ENCODING_MS_GB2312 ::                                            */
+  /*     Same as FT_ENCODING_GB2312.  Deprecated.                          */
+  /*                                                                       */
+  /*   FT_ENCODING_MS_BIG5 ::                                              */
+  /*     Same as FT_ENCODING_BIG5.  Deprecated.                            */
+  /*                                                                       */
+  /*   FT_ENCODING_MS_WANSUNG ::                                           */
+  /*     Same as FT_ENCODING_WANSUNG.  Deprecated.                         */
+  /*                                                                       */
+  /*   FT_ENCODING_MS_JOHAB ::                                             */
+  /*     Same as FT_ENCODING_JOHAB.  Deprecated.                           */
+  /*                                                                       */
   /* <Note>                                                                */
   /*   By default, FreeType automatically synthetizes a Unicode charmap    */
   /*   for Postscript fonts, using their glyph names dictionaries.         */
@@ -575,12 +588,19 @@
     FT_ENC_TAG( FT_ENCODING_MS_SYMBOL,  's', 'y', 'm', 'b' ),
     FT_ENC_TAG( FT_ENCODING_UNICODE,    'u', 'n', 'i', 'c' ),
 
-    FT_ENC_TAG( FT_ENCODING_MS_SJIS,    's', 'j', 'i', 's' ),
-    FT_ENC_TAG( FT_ENCODING_MS_GB2312,  'g', 'b', ' ', ' ' ),
-    FT_ENC_TAG( FT_ENCODING_MS_BIG5,    'b', 'i', 'g', '5' ),
-    FT_ENC_TAG( FT_ENCODING_MS_WANSUNG, 'w', 'a', 'n', 's' ),
-    FT_ENC_TAG( FT_ENCODING_MS_JOHAB,   'j', 'o', 'h', 'a' ),
+    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
+    FT_ENC_TAG( FT_ENCODING_GB2312,  '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_MS_SJIS    = FT_ENCODING_SJIS,
+    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
+    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
+    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
+    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
+
     FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
     FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
     FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
@@ -607,11 +627,11 @@
   /*   ft_encoding_unicode :: see @FT_ENCODING_UNICODE                     */
   /*   ft_encoding_latin_2 :: see @FT_ENCODING_OLD_LATIN_2                 */
   /*   ft_encoding_symbol  :: see @FT_ENCODING_MS_SYMBOL                   */
-  /*   ft_encoding_sjis    :: see @FT_ENCODING_MS_SJIS                     */
-  /*   ft_encoding_gb2312  :: see @FT_ENCODING_MS_GB2312                   */
-  /*   ft_encoding_big5    :: see @FT_ENCODING_MS_BIG5                     */
-  /*   ft_encoding_wansung :: see @FT_ENCODING_MS_WANSUNG                  */
-  /*   ft_encoding_johab   :: see @FT_ENCODING_MS_JOHAB                    */
+  /*   ft_encoding_sjis    :: see @FT_ENCODING_SJIS                        */
+  /*   ft_encoding_gb2312  :: see @FT_ENCODING_GB2312                      */
+  /*   ft_encoding_big5    :: see @FT_ENCODING_BIG5                        */
+  /*   ft_encoding_wansung :: see @FT_ENCODING_WANSUNG                     */
+  /*   ft_encoding_johab   :: see @FT_ENCODING_JOHAB                       */
   /*                                                                       */
   /*   ft_encoding_adobe_standard :: see @FT_ENCODING_ADOBE_STANDARD       */
   /*   ft_encoding_adobe_expert   :: see @FT_ENCODING_ADOBE_EXPERT         */
@@ -625,11 +645,11 @@
 #define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL
 #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_MS_SJIS
-#define ft_encoding_gb2312          FT_ENCODING_MS_GB2312
-#define ft_encoding_big5            FT_ENCODING_MS_BIG5
-#define ft_encoding_wansung         FT_ENCODING_MS_WANSUNG
-#define ft_encoding_johab           FT_ENCODING_MS_JOHAB
+#define ft_encoding_sjis            FT_ENCODING_SJIS
+#define ft_encoding_gb2312          FT_ENCODING_GB2312
+#define ft_encoding_big5            FT_ENCODING_BIG5
+#define ft_encoding_wansung         FT_ENCODING_WANSUNG
+#define ft_encoding_johab           FT_ENCODING_JOHAB
 
 #define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD
 #define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT
--- a/include/freetype/ttnameid.h
+++ b/include/freetype/ttnameid.h
@@ -231,7 +231,8 @@
    *
    * @values:
    *   TT_MS_ID_SYMBOL_CS ::
-   *     Corresponds to symbol encodings. see @FT_ENCODING_MS_SYMBOL.
+   *     Corresponds to Microsoft symbol encoding. See
+   *     @FT_ENCODING_MS_SYMBOL.
    *
    *   TT_MS_ID_UNICODE_CS ::
    *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See
@@ -238,23 +239,21 @@
    *     @FT_ENCODING_UNICODE.
    *
    *   TT_MS_ID_SJIS ::
-   *     Corresponds to Microsoft SJIS Japanese encoding.
-   *     See @FT_ENCODING_MS_SJIS.
+   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.
    *
    *   TT_MS_ID_GB2312 ::
-   *     Corresponds to Microsoft Simplified Chinese as used in Mainland
-   *     China.  See @FT_ENCODING_MS_GB2312.
+   *     Corresponds to Simplified Chinese as used in Mainland China.  See
+   *     @FT_ENCODING_GB2312.
    *
    *   TT_MS_ID_BIG_5 ::
-   *     Corresponds to Microsoft Traditional Chinese as used in Taiwan and
-   *     Hong Kong.  See @FT_ENCODING_MS_BIG5.
+   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.
+   *     See @FT_ENCODING_BIG5.
    *
    *   TT_MS_ID_WANSUNG ::
-   *     Corresponds to Microsoft Korean Wansung encoding.  See
-   *     @FT_ENCODING_MS_WANSUNG.
+   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.
    *
    *   TT_MS_ID_JOHAB ::
-   *     Corresponds to Microsoft Johab encoding.  See @FT_ENCODING_MS_JOHAB.
+   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.
    *
    *   TT_MS_ID_UCS_4 ::
    *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -326,7 +326,7 @@
 
         prop = bdf_get_font_property( font, "POINT_SIZE" );
         if ( prop != NULL )
-          /* convert from 722,7 decipoints to 72 points per inch */
+          /* convert from 722.7 decipoints to 72 points per inch */
           bsize->size =
             (FT_Pos)( ( prop->value.int32 * 64 * 7200 + 36135L ) / 72270L );
 
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -696,7 +696,7 @@
           le -= n;
           n   = pe - pp;
 
-          FT_MEM_COPY( buf, pp, n );
+          FT_MEM_MOVE( buf, pp, n );
 
           pp     = buf + n;
           bytes  = 65536L - n;
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -307,11 +307,11 @@
       { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SYMBOL_CS,  FT_ENCODING_MS_SYMBOL },
       { 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_MS_SJIS },
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_GB2312,     FT_ENCODING_MS_GB2312 },
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_BIG_5,      FT_ENCODING_MS_BIG5 },
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_WANSUNG,    FT_ENCODING_MS_WANSUNG },
-      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_JOHAB,      FT_ENCODING_MS_JOHAB }
+      { 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_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 }
     };
 
     const TEncoding  *cur, *limit;