From 464b16ba46c5ce44aa0dae2e67fefe7c2abbd7f1 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 27 Jan 2017 08:45:46 +0100 Subject: [PATCH] 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. --- ChangeLog | 14 ++++++++++++++ docs/CHANGES | 2 +- include/freetype/freetype.h | 16 +++++++++------- include/freetype/ttnameid.h | 12 ++++++++---- src/sfnt/sfobjs.c | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2c2ae880..575ca88b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2017-01-27 Werner Lemberg + + 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 [base] Add `FT_Get_Sfnt_LangTag' function. diff --git a/docs/CHANGES b/docs/CHANGES index aaaa588da..6ef2a9d1c 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -44,7 +44,7 @@ CHANGES BETWEEN 2.7.1 and 2.7.2 . 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. diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 9eb20a809..2230d3c1b 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -653,9 +653,10 @@ FT_BEGIN_HEADER /* `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 @@ FT_BEGIN_HEADER /* 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_BEGIN_HEADER 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 @@ FT_BEGIN_HEADER #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 diff --git a/include/freetype/ttnameid.h b/include/freetype/ttnameid.h index 9ddb1093c..ea7f1340e 100644 --- a/include/freetype/ttnameid.h +++ b/include/freetype/ttnameid.h @@ -225,9 +225,10 @@ FT_BEGIN_HEADER * 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,12 +248,15 @@ FT_BEGIN_HEADER #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 + /*********************************************************************** * diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 1ee7a4d61..0854ea068 100644 --- 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 }