[FREETYPE] Update to v2.6.4. CORE-11553 CORE-11543

svn path=/trunk/; revision=71866
This commit is contained in:
Amine Khaldi
2016-07-08 21:07:25 +00:00
parent b5bf3c7a1f
commit 834f7edab0
99 changed files with 4900 additions and 1889 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ Used Version: 1.1
Website: http://www.geocities.com/dborca/opengl/tc.html
Title: FreeType
Used Version: 2.6.3
Used Version: 2.6.4
Website: http://www.freetype.org
Title: Mesa3D
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1,4 +1,4 @@
FreeType 2.6.3
FreeType 2.6.4
==============
Homepage: http://www.freetype.org
@@ -24,9 +24,9 @@
and download one of the following files.
freetype-doc-2.6.3.tar.bz2
freetype-doc-2.6.3.tar.gz
ftdoc263.zip
freetype-doc-2.6.4.tar.bz2
freetype-doc-2.6.4.tar.gz
ftdoc264.zip
To view the documentation online, go to
+50 -12
View File
@@ -586,23 +586,53 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
/* replaces the native TrueType hinting mechanism when anything but */
/* FT_RENDER_MODE_MONO is requested. */
/* subpixel hinting support into the TrueType driver. This modifies the */
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
/* requested. */
/* */
/* Enabling this causes the TrueType driver to ignore instructions under */
/* certain conditions. This is done in accordance with the guide here, */
/* with some minor differences: */
/* In particular, it modifies the bytecode interpreter to interpret (or */
/* not) instructions in a certain way so that all TrueType fonts look */
/* like they do in a Windows ClearType (DirectWrite) environment. See */
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* There are three options. */
/* */
/* By undefining this, you only compile the code necessary to hint */
/* TrueType glyphs with native TT hinting. */
/* 1. This option is associated with the `Infinality' moniker. */
/* Contributed by an individual nicknamed Infinality with the goal of */
/* making TrueType fonts render better than on Windows. A high */
/* amount of configurability and flexibility, down to rules for */
/* single glyphs in fonts, but also very slow. Its experimental and */
/* slow nature and the original developer losing interest meant that */
/* this option was never enabled in default builds. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* 2. The new default mode for the TrueType driver. The Infinality code */
/* base was stripped to the bare minimum and all configurability */
/* removed in the name of speed and simplicity. The configurability */
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
/* Courier. Legacy fonts are fonts that modify vertical stems to */
/* achieve clean black-and-white bitmaps. The new mode focuses on */
/* applying a minimal set of rules to all fonts indiscriminately so */
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* 3. Compile both. */
/* */
/* By undefining these, you get rendering behavior like on Windows */
/* without ClearType, i.e., Windows XP without ClearType enabled and */
/* Win9x (interpreter version v35). Or not, depending on how much */
/* hinting blood and testing tears the font designer put into a given */
/* font. If you define one or both subpixel hinting options, you can */
/* switch between between v35 and the ones you define. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
/*************************************************************************/
@@ -811,6 +841,14 @@ FT_BEGIN_HEADER
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
@@ -586,23 +586,53 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
/* replaces the native TrueType hinting mechanism when anything but */
/* FT_RENDER_MODE_MONO is requested. */
/* subpixel hinting support into the TrueType driver. This modifies the */
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
/* requested. */
/* */
/* Enabling this causes the TrueType driver to ignore instructions under */
/* certain conditions. This is done in accordance with the guide here, */
/* with some minor differences: */
/* In particular, it modifies the bytecode interpreter to interpret (or */
/* not) instructions in a certain way so that all TrueType fonts look */
/* like they do in a Windows ClearType (DirectWrite) environment. See */
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* There are three options. */
/* */
/* By undefining this, you only compile the code necessary to hint */
/* TrueType glyphs with native TT hinting. */
/* 1. This option is associated with the `Infinality' moniker. */
/* Contributed by an individual nicknamed Infinality with the goal of */
/* making TrueType fonts render better than on Windows. A high */
/* amount of configurability and flexibility, down to rules for */
/* single glyphs in fonts, but also very slow. Its experimental and */
/* slow nature and the original developer losing interest meant that */
/* this option was never enabled in default builds. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* 2. The new default mode for the TrueType driver. The Infinality code */
/* base was stripped to the bare minimum and all configurability */
/* removed in the name of speed and simplicity. The configurability */
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
/* Courier. Legacy fonts are fonts that modify vertical stems to */
/* achieve clean black-and-white bitmaps. The new mode focuses on */
/* applying a minimal set of rules to all fonts indiscriminately so */
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* 3. Compile both. */
/* */
/* By undefining these, you get rendering behavior like on Windows */
/* without ClearType, i.e., Windows XP without ClearType enabled and */
/* Win9x (interpreter version v35). Or not, depending on how much */
/* hinting blood and testing tears the font designer put into a given */
/* font. If you define one or both subpixel hinting options, you can */
/* switch between between v35 and the ones you define. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
/*************************************************************************/
@@ -811,6 +841,14 @@ FT_BEGIN_HEADER
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
@@ -63,6 +63,7 @@
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
+26 -22
View File
@@ -651,11 +651,11 @@ FT_BEGIN_HEADER
/* */
/* FT_ENCODING_SJIS :: */
/* Corresponds to Japanese SJIS encoding. More info at */
/* at `http://en.wikipedia.org/wiki/Shift_JIS'. */
/* `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 */
/* Corresponds to an encoding system for Simplified Chinese as */
/* used in mainland China. */
/* */
/* FT_ENCODING_BIG5 :: */
@@ -1103,7 +1103,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_SCALABLE :: */
/* Indicates that the face contains outline glyphs. This doesn't */
/* prevent bitmap strikes, i.e., a face can have both this and */
/* and @FT_FACE_FLAG_FIXED_SIZES set. */
/* @FT_FACE_FLAG_FIXED_SIZES set. */
/* */
/* FT_FACE_FLAG_FIXED_SIZES :: */
/* Indicates that the face contains bitmap strikes. See also the */
@@ -1222,7 +1222,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_HORIZONTAL( face ) \
( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL )
/*************************************************************************
@@ -1236,7 +1236,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_VERTICAL( face ) \
( face->face_flags & FT_FACE_FLAG_VERTICAL )
( (face)->face_flags & FT_FACE_FLAG_VERTICAL )
/*************************************************************************
@@ -1250,7 +1250,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_KERNING( face ) \
( face->face_flags & FT_FACE_FLAG_KERNING )
( (face)->face_flags & FT_FACE_FLAG_KERNING )
/*************************************************************************
@@ -1265,7 +1265,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SCALABLE( face ) \
( face->face_flags & FT_FACE_FLAG_SCALABLE )
( (face)->face_flags & FT_FACE_FLAG_SCALABLE )
/*************************************************************************
@@ -1284,7 +1284,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_SFNT( face ) \
( face->face_flags & FT_FACE_FLAG_SFNT )
( (face)->face_flags & FT_FACE_FLAG_SFNT )
/*************************************************************************
@@ -1299,7 +1299,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_FIXED_WIDTH( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
/*************************************************************************
@@ -1314,7 +1314,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES )
/*************************************************************************
@@ -1340,7 +1340,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_GLYPH_NAMES( face ) \
( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
/*************************************************************************
@@ -1355,7 +1355,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_MULTIPLE_MASTERS( face ) \
( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
/*************************************************************************
@@ -1373,7 +1373,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_CID_KEYED( face ) \
( face->face_flags & FT_FACE_FLAG_CID_KEYED )
( (face)->face_flags & FT_FACE_FLAG_CID_KEYED )
/*************************************************************************
@@ -1387,7 +1387,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_IS_TRICKY( face ) \
( face->face_flags & FT_FACE_FLAG_TRICKY )
( (face)->face_flags & FT_FACE_FLAG_TRICKY )
/*************************************************************************
@@ -1401,7 +1401,7 @@ FT_BEGIN_HEADER
*
*/
#define FT_HAS_COLOR( face ) \
( face->face_flags & FT_FACE_FLAG_COLOR )
( (face)->face_flags & FT_FACE_FLAG_COLOR )
/*************************************************************************/
@@ -1941,7 +1941,7 @@ FT_BEGIN_HEADER
/* */
/* If the @FT_OPEN_MEMORY bit is set, assume that this is a */
/* memory file of `memory_size' bytes, located at `memory_address'. */
/* The data are are not copied, and the client is responsible for */
/* The data are not copied, and the client is responsible for */
/* releasing and destroying them _after_ the corresponding call to */
/* @FT_Done_Face. */
/* */
@@ -2339,9 +2339,9 @@ FT_BEGIN_HEADER
/* used to determine both scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
/* The real dimension. The sum of the the `ascender' and (minus */
/* of) the `descender' fields of @FT_FaceRec are used to determine */
/* both scaling values. */
/* The real dimension. The sum of the `ascender' and (minus of) */
/* the `descender' fields of @FT_FaceRec are used to determine both */
/* scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
/* The font bounding box. The width and height of the `bbox' field */
@@ -2578,6 +2578,10 @@ FT_BEGIN_HEADER
/* don't have a corresponding glyph in the font). See the discussion */
/* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
/* */
/* If you receive `FT_Err_Glyph_Too_Big', try getting the glyph */
/* outline at EM size, then scale it manually and fill it as a */
/* graphics operation. */
/* */
FT_EXPORT( FT_Error )
FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
@@ -2855,7 +2859,7 @@ FT_BEGIN_HEADER
*
* If @FT_LOAD_RENDER is also set, the glyph is rendered in the
* corresponding mode (i.e., the mode that matches the used algorithm
* best). An exeption is FT_LOAD_TARGET_MONO since it implies
* best). An exception is FT_LOAD_TARGET_MONO since it implies
* @FT_LOAD_MONOCHROME.
*
* You can use a hinting algorithm that doesn't correspond to the same
@@ -3273,7 +3277,7 @@ FT_BEGIN_HEADER
/* `.notdef'). */
/* */
/* This function always returns an error if the config macro */
/* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */
/* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoption.h'. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph_Name( FT_Face face,
@@ -4172,7 +4176,7 @@ FT_BEGIN_HEADER
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 6
#define FREETYPE_PATCH 3
#define FREETYPE_PATCH 4
/*************************************************************************/
@@ -219,8 +219,8 @@ FT_BEGIN_HEADER
* U+0F00 - U+0FFF // Tibetan
* U+1900 - U+194F // Limbu
* U+1B80 - U+1BBF // Sundanese
* U+1C80 - U+1CDF // Meetei Mayak
* U+A800 - U+A82F // Syloti Nagri
* U+ABC0 - U+ABFF // Meetei Mayek
* U+11800 - U+118DF // Sharada
* }
*
@@ -749,7 +749,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@@ -802,7 +802,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@@ -957,7 +957,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@@ -1012,7 +1012,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
* features preserve the design's weight and spacing much better than
* aliased type would.
*
* 2) Aligment in the vertical direction: Weights and spacing along the
* 2) Alignment in the vertical direction: Weights and spacing along the
* y~axis are less critical; what is much more important is the visual
* alignment of related features (like cap-height and x-height). The
* sense of alignment for these is enhanced by the sharpness of grid-fit
@@ -110,7 +110,7 @@ FT_BEGIN_HEADER
* to minimize distortion.
*
* @order:
* hinting-engine
* hinting-engine[cff]
* no-stem-darkening[cff]
* darkening-parameters[cff]
*
@@ -120,7 +120,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @property:
* hinting-engine
* hinting-engine[cff]
*
* @description:
* Thanks to Adobe, which contributed a new hinting (and parsing)
@@ -157,8 +157,8 @@ FT_BEGIN_HEADER
* FT_CFF_HINTING_XXX
*
* @description:
* A list of constants used for the @hinting-engine property to select
* the hinting engine for CFF fonts.
* A list of constants used for the @hinting-engine[cff] property to
* select the hinting engine for CFF fonts.
*
* @values:
* FT_CFF_HINTING_FREETYPE ::
+2 -2
View File
@@ -97,8 +97,8 @@ FT_BEGIN_HEADER
*
* @description:
* Retrieve the type of the input face, CID keyed or not. In
* constrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SNFT wrapper.
* contrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SFNT wrapper.
*
* @input:
* face ::
@@ -117,11 +117,11 @@ FT_BEGIN_HEADER
*
* @inout:
* output_len ::
* Before calling the function, this is the the total size of the
* output buffer, which must be large enough to hold the entire
* uncompressed data (so the size of the uncompressed data must be
* known in advance). After calling the function, `output_len' is the
* size of the used data in `output'.
* Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len' is the size of
* the used data in `output'.
*
* @return:
* FreeType error code. 0~means success.
@@ -747,7 +747,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* A raster is a scan converter, in charge of rendering an outline into */
/* a a bitmap. This section contains the public API for rasters. */
/* a bitmap. This section contains the public API for rasters. */
/* */
/* Note that in FreeType 2, all rasters are now encapsulated within */
/* specific modules called `renderers'. See `ftrender.h' for more */
@@ -106,12 +106,12 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**********************************************************************
*
@@ -290,7 +290,7 @@ FT_BEGIN_HEADER
* The stream size in bytes.
*
* In case of compressed streams where the size is unknown before
* actually doing the decompression, the value is set to 0x7FFFFFFF.
* actually doing the decompression, the value is set to 0x7FFFFFFF.
* (Note that this size value can occur for normal streams also; it is
* thus just a hint.)
*
+39 -22
View File
@@ -138,31 +138,37 @@ FT_BEGIN_HEADER
* interpreter-version
*
* @description:
* Currently, two versions are available, representing the bytecode
* interpreter with and without subpixel hinting support,
* respectively. The default is subpixel support if
* TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
* support otherwise (since it isn't available then).
* Currently, three versions are available, two representing the
* bytecode interpreter with subpixel hinting support (old `Infinality'
* code and new stripped-down and higher performance `minimal' code) and
* one without, respectively. The default is subpixel support if
* TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support
* otherwise (since it isn't available then).
*
* If subpixel hinting is on, many TrueType bytecode instructions behave
* differently compared to B/W or grayscale rendering (except if `native
* ClearType' is selected by the font). The main idea is to render at a
* much increased horizontal resolution, then sampling down the created
* output to subpixel precision. However, many older fonts are not
* suited to this and must be specially taken care of by applying
* (hardcoded) font-specific tweaks.
* ClearType' is selected by the font). Microsoft's main idea is to
* render at a much increased horizontal resolution, then sampling down
* the created output to subpixel precision. However, many older fonts
* are not suited to this and must be specially taken care of by
* applying (hardcoded) tweaks in Microsoft's interpreter.
*
* Details on subpixel hinting and some of the necessary tweaks can be
* found in Greg Hitchcock's whitepaper at
* `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
* `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
* Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2,
* or 6x5 supersampling) like discussed in the paper. Depending on the
* chosen interpreter, it simply ignores instructions on vertical stems
* to arrive at very similar results.
*
* The following example code demonstrates how to activate subpixel
* The following example code demonstrates how to deactivate subpixel
* hinting (omitting the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
*
*
* FT_Init_FreeType( &library );
@@ -197,9 +203,19 @@ FT_BEGIN_HEADER
*
* TT_INTERPRETER_VERSION_38 ::
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
* equivalent to the hinting provided by DirectWrite ClearType (as
* can be found, for example, in the Internet Explorer~9 running on
* Windows~7).
* equivalent to the hinting provided by DirectWrite ClearType (as can
* be found, for example, in the Internet Explorer~9 running on
* Windows~7). It is used in FreeType to select the `Infinality'
* subpixel hinting code. The code may be removed in a future
* version.
*
* TT_INTERPRETER_VERSION_40 ::
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
* equivalent to the hinting provided by DirectWrite ClearType (as can
* be found, for example, in Microsoft's Edge Browser on Windows~10).
* It is used in FreeType to select the `minimal' subpixel hinting
* code, a stripped-down and higher performance version of the
* `Infinality' code.
*
* @note:
* This property controls the behaviour of the bytecode interpreter
@@ -207,9 +223,9 @@ FT_BEGIN_HEADER
* get rasterized! In particular, it does not control subpixel color
* filtering.
*
* If FreeType has not been compiled with configuration option
* FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
* `FT_Err_Unimplemented_Feature' error.
* If FreeType has not been compiled with the configuration option
* FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
* an `FT_Err_Unimplemented_Feature' error.
*
* Depending on the graphics framework, Microsoft uses different
* bytecode and rendering engines. As a consequence, the version
@@ -290,13 +306,14 @@ FT_BEGIN_HEADER
* the version~1 gasp table exclusively (like Color ClearType), while
* v1.6 only respects the values of version~0 (bits 0 and~1).
*
* FreeType doesn't provide all capabilities of the most recent
* ClearType incarnation, thus we identify our subpixel support as
* version~38.
* Keep in mind that the features of the above interpreter versions
* might not map exactly to FreeType features or behavior because it is
* a fundamentally different library with different internals.
*
*/
#define TT_INTERPRETER_VERSION_35 35
#define TT_INTERPRETER_VERSION_38 38
#define TT_INTERPRETER_VERSION_40 40
/* */
@@ -213,7 +213,7 @@ FT_BEGIN_HEADER
/* And when it is no longer needed a `destroy' function needs to be */
/* called to release that allocation. */
/* */
/* `fcinit.c' (ft_create_default_module_classes) already contains a */
/* `ftinit.c' (ft_create_default_module_classes) already contains a */
/* mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
@@ -65,13 +65,15 @@ FT_BEGIN_HEADER
#ifdef __cplusplus
extern "C++"
extern "C++"
{
template <typename T> inline T*
cplusplus_typeof( T*,
void *v )
{
return static_cast <T*> ( v );
}
}
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
@@ -833,7 +833,7 @@ FT_BEGIN_HEADER
/* filtering callback function. */
/* */
/* pic_container :: Contains global structs and tables, instead */
/* of defining them globallly. */
/* of defining them globally. */
/* */
/* refcount :: A counter initialized to~1 at the time an */
/* @FT_Library structure is created. */
@@ -971,8 +971,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Outline_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@@ -1030,8 +1030,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Raster_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@@ -1090,8 +1090,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Glyph_Class struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated stcture to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@@ -1164,11 +1164,11 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of FT_Renderer_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
/* to be called with a pointer where the allocated structure is */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function will */
/* need to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `fcinit.c' (ft_create_default_module_classes) already contains */
/* `ftinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
@@ -1368,11 +1368,11 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of an FT_Module_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
/* be called with a pointer where the allocated structure is */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs */
/* to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `fcinit.c' (ft_create_default_module_classes) already contains */
/* `ftinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
@@ -227,7 +227,7 @@ FT_BEGIN_HEADER
/* sort_by_res_id :: */
/* A Boolean to sort the fragmented resource by their ids. */
/* The fragmented resources for `POST' resource should be sorted */
/* to restore Type1 font properly. For `snft' resources, sorting */
/* to restore Type1 font properly. For `sfnt' resources, sorting */
/* may induce a different order of the faces in comparison to that */
/* by QuickDraw API. */
/* */
@@ -44,7 +44,6 @@
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
@@ -185,7 +185,7 @@ FT_BEGIN_HEADER
/* */
/* CompLength :: Compressed table length (in bytes). */
/* */
/* OrigLength :: Unompressed table length (in bytes). */
/* OrigLength :: Uncompressed table length (in bytes). */
/* */
/* CheckSum :: The table checksum. This value can be ignored. */
/* */
@@ -1386,12 +1386,12 @@ FT_BEGIN_HEADER
FT_ULong horz_metrics_offset;
FT_ULong vert_metrics_offset;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/* since 2.4.12 */
FT_ULong sph_found_func_flags; /* special functions found */
/* for this face */
FT_Bool sph_compatibility_mode;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
} TT_FaceRec;
@@ -587,7 +587,7 @@ FT_BEGIN_HEADER
/* */
/* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
/* */
/* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */
/* FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure. */
/* */
/* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
/* */
+151 -14
View File
@@ -32,12 +32,32 @@
'\0',
'\xD9', '\x80', /* ـ */
'\0',
'\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x93', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ա Մ Ւ Փ Բ Գ Դ Օ */
'\0',
'\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD5', '\x93', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ւ Ո Փ Ճ Շ Ս Տ Օ */
'\0',
'\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x83', ' ', '\xD6', '\x86', ' ', '\xD6', '\x83', /* ե է ի մ վ փ ֆ փ */
'\0',
'\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xBB', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* ա յ ւ ս գ ջ ր օ */
'\0',
'\xD5', '\xB0', ' ', '\xD5', '\xB8', ' ', '\xD5', '\xB3', ' ', '\xD5', '\xA1', ' ', '\xD5', '\xA5', ' ', '\xD5', '\xAE', ' ', '\xD5', '\xBD', ' ', '\xD6', '\x85', /* հ ո ճ ա ե ծ ս օ */
'\0',
'\xD5', '\xA2', ' ', '\xD5', '\xA8', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xAC', ' ', '\xD5', '\xB2', ' ', '\xD5', '\xBA', ' ', '\xD6', '\x83', ' ', '\xD6', '\x81', /* բ ը ի լ ղ պ փ ց */
'\0',
'\xE0', '\xA6', '\x85', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xAD', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* অ ড ত ন ব ভ ল ক */
'\0',
'\xE0', '\xA6', '\x87', ' ', '\xE0', '\xA6', '\x9F', ' ', '\xE0', '\xA6', '\xA0', ' ', '\xE0', '\xA6', '\xBF', ' ', '\xE0', '\xA7', '\x80', ' ', '\xE0', '\xA7', '\x88', ' ', '\xE0', '\xA7', '\x97', /* ই ট ঠ ি ী ৈ ৗ */
'\0',
'\xE0', '\xA6', '\x93', ' ', '\xE0', '\xA6', '\x8F', ' ', '\xE0', '\xA6', '\xA1', ' ', '\xE0', '\xA6', '\xA4', ' ', '\xE0', '\xA6', '\xA8', ' ', '\xE0', '\xA6', '\xAC', ' ', '\xE0', '\xA6', '\xB2', ' ', '\xE0', '\xA6', '\x95', /* ও এ ড ত ন ব ল ক */
'\0',
'\xE1', '\x8F', '\x86', ' ', '\xE1', '\x8E', '\xBB', ' ', '\xE1', '\x8E', '\xAC', ' ', '\xE1', '\x8F', '\x83', ' ', '\xE1', '\x8E', '\xA4', ' ', '\xE1', '\x8F', '\xA3', ' ', '\xE1', '\x8E', '\xA6', ' ', '\xE1', '\x8F', '\x95', /* Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ */
'\0',
'\xEA', '\xAE', '\x92', ' ', '\xEA', '\xAE', '\xA4', ' ', '\xEA', '\xAE', '\xB6', ' ', '\xEA', '\xAD', '\xB4', ' ', '\xEA', '\xAD', '\xBE', ' ', '\xEA', '\xAE', '\x97', ' ', '\xEA', '\xAE', '\x9D', ' ', '\xEA', '\xAE', '\xBF', /* ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ */
'\0',
'\xEA', '\xAE', '\x96', ' ', '\xEA', '\xAD', '\xBC', ' ', '\xEA', '\xAE', '\x93', ' ', '\xEA', '\xAE', '\xA0', ' ', '\xEA', '\xAE', '\xB3', ' ', '\xEA', '\xAD', '\xB6', ' ', '\xEA', '\xAE', '\xA5', ' ', '\xEA', '\xAE', '\xBB', /* ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ */
'\0',
'\xE1', '\x8F', '\xB8', ' ', '\xEA', '\xAE', '\x90', ' ', '\xEA', '\xAD', '\xB9', ' ', '\xEA', '\xAD', '\xBB', /* ᏸ ꮐ ꭹ ꭻ */
'\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\x9F', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е П З О С Э */
'\0',
'\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\xA8', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е Ш З О С Э */
@@ -54,6 +74,30 @@
'\0',
'\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* ु ृ */
'\0',
'\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\x83', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x8D', '\x90', ' ', '\xE1', '\x88', '\x9B', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x8B', ' ', '\xE1', '\x8B', '\x90', /* ሀ ሃ ዘ ፐ ማ በ ዋ ዐ */
'\0',
'\xE1', '\x88', '\x88', ' ', '\xE1', '\x88', '\x90', ' ', '\xE1', '\x89', '\xA0', ' ', '\xE1', '\x8B', '\x98', ' ', '\xE1', '\x88', '\x80', ' ', '\xE1', '\x88', '\xAA', ' ', '\xE1', '\x8B', '\x90', ' ', '\xE1', '\x8C', '\xA8', /* ለ ሐ በ ዘ ሀ ሪ ዐ ጨ */
'\0',
'\xE1', '\x83', '\x92', ' ', '\xE1', '\x83', '\x93', ' ', '\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x97', ' ', '\xE1', '\x83', '\x98', ' ', '\xE1', '\x83', '\x9D', ' ', '\xE1', '\x83', '\xA6', /* გ დ ე ვ თ ი ო ღ */
'\0',
'\xE1', '\x83', '\x90', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xAB', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\x9E', /* ა ზ მ ს შ ძ ხ პ */
'\0',
'\xE1', '\x83', '\xA1', ' ', '\xE1', '\x83', '\xAE', ' ', '\xE1', '\x83', '\xA5', ' ', '\xE1', '\x83', '\x96', ' ', '\xE1', '\x83', '\x9B', ' ', '\xE1', '\x83', '\xA8', ' ', '\xE1', '\x83', '\xA9', ' ', '\xE1', '\x83', '\xAC', /* ს ხ ქ ზ მ შ ჩ წ */
'\0',
'\xE1', '\x83', '\x94', ' ', '\xE1', '\x83', '\x95', ' ', '\xE1', '\x83', '\x9F', ' ', '\xE1', '\x83', '\xA2', ' ', '\xE1', '\x83', '\xA3', ' ', '\xE1', '\x83', '\xA4', ' ', '\xE1', '\x83', '\xA5', ' ', '\xE1', '\x83', '\xA7', /* ე ვ ჟ ტ უ ფ ქ ყ */
'\0',
'\xE1', '\x82', '\xB1', ' ', '\xE1', '\x82', '\xA7', ' ', '\xE1', '\x82', '\xB9', ' ', '\xE1', '\x82', '\xBC', ' ', '\xE1', '\x82', '\xA4', ' ', '\xE1', '\x82', '\xA5', ' ', '\xE1', '\x82', '\xB3', ' ', '\xE1', '\x82', '\xBA', /* Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ */
'\0',
'\xE1', '\x82', '\xA4', ' ', '\xE1', '\x82', '\xA5', ' ', '\xE1', '\x82', '\xA7', ' ', '\xE1', '\x82', '\xA8', ' ', '\xE1', '\x82', '\xA6', ' ', '\xE1', '\x82', '\xB1', ' ', '\xE1', '\x82', '\xAA', ' ', '\xE1', '\x82', '\xAB', /* Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ */
'\0',
'\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x97', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x87', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x96', /* ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ */
'\0',
'\xE2', '\xB4', '\x88', ' ', '\xE2', '\xB4', '\x8C', ' ', '\xE2', '\xB4', '\x96', ' ', '\xE2', '\xB4', '\x8E', ' ', '\xE2', '\xB4', '\x83', ' ', '\xE2', '\xB4', '\x86', ' ', '\xE2', '\xB4', '\x8B', ' ', '\xE2', '\xB4', '\xA2', /* ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ */
'\0',
'\xE2', '\xB4', '\x90', ' ', '\xE2', '\xB4', '\x91', ' ', '\xE2', '\xB4', '\x93', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x99', ' ', '\xE2', '\xB4', '\x9B', ' ', '\xE2', '\xB4', '\xA1', ' ', '\xE2', '\xB4', '\xA3', /* ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ */
'\0',
'\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ */
'\0',
'\xCE', '\x93', ' ', '\xCE', '\x92', ' ', '\xCE', '\x95', ' ', '\xCE', '\x96', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', ' ', '\xCE', '\xA9', /* Γ Β Ε Ζ Θ Ο Ω */
'\0',
'\xCE', '\x92', ' ', '\xCE', '\x94', ' ', '\xCE', '\x96', ' ', '\xCE', '\x9E', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', /* Β Δ Ζ Ξ Θ Ο */
@@ -64,6 +108,26 @@
'\0',
'\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ ρ φ χ ψ */
'\0',
'\xE0', '\xAA', '\xA4', ' ', '\xE0', '\xAA', '\xA8', ' ', '\xE0', '\xAA', '\x8B', ' ', '\xE0', '\xAA', '\x8C', ' ', '\xE0', '\xAA', '\x9B', ' ', '\xE0', '\xAA', '\x9F', ' ', '\xE0', '\xAA', '\xB0', ' ', '\xE0', '\xAB', '\xA6', /* ત ન ઋ ઌ છ ટ ર ૦ */
'\0',
'\xE0', '\xAA', '\x96', ' ', '\xE0', '\xAA', '\x97', ' ', '\xE0', '\xAA', '\x98', ' ', '\xE0', '\xAA', '\x9E', ' ', '\xE0', '\xAA', '\x87', ' ', '\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\xA0', ' ', '\xE0', '\xAA', '\x9C', /* ખ ગ ઘ ઞ ઇ ઈ ઠ જ */
'\0',
'\xE0', '\xAA', '\x88', ' ', '\xE0', '\xAA', '\x8A', ' ', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB2', '\xE0', '\xAB', '\x80', ' ', '\xE0', '\xAA', '\xB6', '\xE0', '\xAB', '\x8D', '\xE0', '\xAA', '\x9A', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\x9C', '\xE0', '\xAA', '\xBF', ' ', '\xE0', '\xAA', '\xB8', '\xE0', '\xAB', '\x80', /* ઈ ઊ િ ી લી શ્ચિ જિ સી */
'\0',
'\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAB', '\x84', ' ', '\xE0', '\xAA', '\x96', '\xE0', '\xAB', '\x81', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x83', ' ', '\xE0', '\xAA', '\x9B', '\xE0', '\xAB', '\x84', /* ુ ૃ ૄ ખુ છૃ છૄ */
'\0',
'\xE0', '\xAB', '\xA6', ' ', '\xE0', '\xAB', '\xA7', ' ', '\xE0', '\xAB', '\xA8', ' ', '\xE0', '\xAB', '\xA9', ' ', '\xE0', '\xAB', '\xAD', /* ૧ ૨ ૩ ૭ */
'\0',
'\xE0', '\xA8', '\x95', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x99', ' ', '\xE0', '\xA8', '\x9A', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA4', ' ', '\xE0', '\xA8', '\xA7', ' ', '\xE0', '\xA8', '\xB8', /* ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ */
'\0',
'\xE0', '\xA8', '\x95', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x99', ' ', '\xE0', '\xA8', '\x9A', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA4', ' ', '\xE0', '\xA8', '\xA7', ' ', '\xE0', '\xA8', '\xB8', /* ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ */
'\0',
'\xE0', '\xA8', '\x87', ' ', '\xE0', '\xA8', '\x88', ' ', '\xE0', '\xA8', '\x89', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA9', '\xB3', ' ', '\xE0', '\xA8', '\xBF', ' ', '\xE0', '\xA9', '\x80', /* ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ */
'\0',
'\xE0', '\xA8', '\x85', ' ', '\xE0', '\xA8', '\x8F', ' ', '\xE0', '\xA8', '\x93', ' ', '\xE0', '\xA8', '\x97', ' ', '\xE0', '\xA8', '\x9C', ' ', '\xE0', '\xA8', '\xA0', ' ', '\xE0', '\xA8', '\xB0', ' ', '\xE0', '\xA8', '\xB8', /* ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ */
'\0',
'\xE0', '\xA9', '\xA6', ' ', '\xE0', '\xA9', '\xA7', ' ', '\xE0', '\xA9', '\xA8', ' ', '\xE0', '\xA9', '\xA9', ' ', '\xE0', '\xA9', '\xAD', /* ੨ ੩ ੭ */
'\0',
'\xD7', '\x91', ' ', '\xD7', '\x93', ' ', '\xD7', '\x94', ' ', '\xD7', '\x97', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', /* ב ד ה ח ך כ ם ס */
'\0',
'\xD7', '\x91', ' ', '\xD7', '\x98', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', ' ', '\xD7', '\xA6', /* ב ט כ ם ס צ */
@@ -128,6 +192,10 @@
'\0',
'\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ ᵍ */
'\0',
'\xE0', '\xB4', '\x92', ' ', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xB1', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', ' ', '\xE0', '\xB4', '\x9A', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xAA', '\xE0', '\xB5', '\x8D', '\xE0', '\xB4', '\xAA', /* ഒ ട ഠ റ ച പ ച്ച പ്പ */
'\0',
'\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* ട ഠ ധ ശ ഘ ച ഥ ല */
'\0',
'\xE1', '\x80', '\x81', ' ', '\xE1', '\x80', '\x82', ' ', '\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\xA5', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* ခ ဂ င ဒ ဝ ၥ ၊ ။ */
'\0',
'\xE1', '\x80', '\x84', ' ', '\xE1', '\x80', '\x8E', ' ', '\xE1', '\x80', '\x92', ' ', '\xE1', '\x80', '\x95', ' ', '\xE1', '\x80', '\x97', ' ', '\xE1', '\x80', '\x9D', ' ', '\xE1', '\x81', '\x8A', ' ', '\xE1', '\x81', '\x8B', /* င ဎ ဒ ပ ဗ ဝ ၊ ။ */
@@ -136,6 +204,16 @@
'\0',
'\xE1', '\x80', '\x89', ' ', '\xE1', '\x80', '\x8A', ' ', '\xE1', '\x80', '\xA5', ' ', '\xE1', '\x80', '\xA9', ' ', '\xE1', '\x80', '\xA8', ' ', '\xE1', '\x81', '\x82', ' ', '\xE1', '\x81', '\x85', ' ', '\xE1', '\x81', '\x89', /* ဉ ည ဥ ဩ ဨ ၂ ၅ ၉ */
'\0',
'\xE0', '\xB6', '\x89', ' ', '\xE0', '\xB6', '\x9A', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\xB4', ' ', '\xE0', '\xB6', '\xBA', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB7', '\x86', /* ඉ ක ඝ ඳ ප ය ල ෆ */
'\0',
'\xE0', '\xB6', '\x91', ' ', '\xE0', '\xB6', '\x94', ' ', '\xE0', '\xB6', '\x9D', ' ', '\xE0', '\xB6', '\xA2', ' ', '\xE0', '\xB6', '\xA7', ' ', '\xE0', '\xB6', '\xAE', ' ', '\xE0', '\xB6', '\xB0', ' ', '\xE0', '\xB6', '\xBB', /* එ ඔ ඝ ජ ට ථ ධ ර */
'\0',
'\xE0', '\xB6', '\xAF', ' ', '\xE0', '\xB6', '\xB3', ' ', '\xE0', '\xB6', '\x8B', ' ', '\xE0', '\xB6', '\xBD', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x96', ' ', '\xE0', '\xB6', '\xAD', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xB6', '\xE0', '\xB7', '\x94', ' ', '\xE0', '\xB6', '\xAF', '\xE0', '\xB7', '\x94', /* ද ඳ උ ල තූ තු බු දු */
'\0',
'\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x92', ' ', '\xE0', '\xAE', '\x93', ' ', '\xE0', '\xAE', '\xB1', ' ', '\xE0', '\xAE', '\x88', ' ', '\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9A', /* உ ஒ ஓ ற ஈ க ங ச */
'\0',
'\xE0', '\xAE', '\x95', ' ', '\xE0', '\xAE', '\x9A', ' ', '\xE0', '\xAE', '\xB2', ' ', '\xE0', '\xAE', '\xB6', ' ', '\xE0', '\xAE', '\x89', ' ', '\xE0', '\xAE', '\x99', ' ', '\xE0', '\xAE', '\x9F', ' ', '\xE0', '\xAE', '\xAA', /* க ச ல ஶ உ ங ட ப */
'\0',
'\xE0', '\xB0', '\x87', ' ', '\xE0', '\xB0', '\x8C', ' ', '\xE0', '\xB0', '\x99', ' ', '\xE0', '\xB0', '\x9E', ' ', '\xE0', '\xB0', '\xA3', ' ', '\xE0', '\xB0', '\xB1', ' ', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */
'\0',
'\xE0', '\xB0', '\x85', ' ', '\xE0', '\xB0', '\x95', ' ', '\xE0', '\xB0', '\x9A', ' ', '\xE0', '\xB0', '\xB0', ' ', '\xE0', '\xB0', '\xBD', ' ', '\xE0', '\xB1', '\xA8', ' ', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */
@@ -207,13 +285,29 @@
{ AF_BLUE_STRING_ARABIC_BOTTOM, 0 },
{ AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_BENGALI_BASE, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 },
{ AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_BENGALI_BASE, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 },
{ AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_CHEROKEE_SMALL, 0 },
{ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -229,6 +323,23 @@
{ AF_BLUE_STRING_DEVANAGARI_BASE, 0 },
{ AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -237,6 +348,21 @@
{ AF_BLUE_STRING_GREEK_SMALL, 0 },
{ AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_GUJARATI_BOTTOM, 0 },
{ AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GUJARATI_DESCENDER, 0 },
{ AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 },
{ AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_LONG },
{ AF_BLUE_STRING_HEBREW_BOTTOM, 0 },
@@ -256,13 +382,13 @@
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_LAO_BOTTOM, 0 },
{ AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LAO_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_LAO_BOTTOM, 0 },
{ AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LAO_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
@@ -287,12 +413,23 @@
{ AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 },
{ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_MYANMAR_BOTTOM, 0 },
{ AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MYANMAR_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_SINHALA_BOTTOM, 0 },
{ AF_BLUE_STRING_SINHALA_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_TAMIL_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
+187 -16
View File
@@ -65,8 +65,8 @@
// values; this essentially means that the maximum values can easily be too
// large. Given that the purpose of those values is to create local
// fixed-size arrays at compile time for further processing of the blue zone
// data, this isn't a problem. Note the the final zero byte of a string is
// not counted. Note also that the count holds the number of UTF-8 encoded
// data, this isn't a problem. Note the final zero byte of a string is not
// counted. Note also that the count holds the number of UTF-8 encoded
// characters, not bytes.
@@ -86,6 +86,19 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_ARABIC_JOIN
"ـ"
AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP
"Ա Մ Ւ Փ Բ Գ Դ Օ"
AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM
"Ւ Ո Փ Ճ Շ Ս Տ Օ"
AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER
"ե է ի մ վ փ ֆ փ"
AF_BLUE_STRING_ARMENIAN_SMALL_TOP
"ա յ ւ ս գ ջ ր օ"
AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM
"հ ո ճ ա ե ծ ս օ"
AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER
"բ ը ի լ ղ պ փ ց"
AF_BLUE_STRING_BENGALI_BASE
"অ ড ত ন ব ভ ল ক"
AF_BLUE_STRING_BENGALI_TOP
@@ -93,6 +106,15 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_BENGALI_HEAD
"ও এ ড ত ন ব ল ক"
AF_BLUE_STRING_CHEROKEE_CAPITAL
"Ꮖ Ꭴ Ꮳ Ꭶ "
AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER
"ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ"
AF_BLUE_STRING_CHEROKEE_SMALL
"ꮖ ꭼ ꮠ ꮳ ꭶ ꮥ ꮻ"
AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER
"ᏸ ꮐ ꭹ ꭻ"
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
В Е П З О С Э"
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
@@ -114,6 +136,34 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_DEVANAGARI_BOTTOM
"ु ृ"
AF_BLUE_STRING_ETHIOPIC_TOP
" ሃ ዘ ፐ ማ በ ዋ "
AF_BLUE_STRING_ETHIOPIC_BOTTOM
"ለ ሐ በ ዘ ጨ"
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP
"გ დ ე ვ თ ი ო ღ"
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM
"ა ზ მ ს შ ძ ხ პ"
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER
"ს ხ ქ ზ მ შ ჩ წ"
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER
"ე ვ ჟ ტ უ ფ ქ "
AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP
"Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ"
AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM
"Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ"
AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP
"ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ"
AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM
"ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ"
AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER
"ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ"
AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER
"ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ"
AF_BLUE_STRING_GREEK_CAPITAL_TOP
Β Ε Ζ Θ Ο Ω"
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
@@ -125,6 +175,28 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_GREEK_SMALL_DESCENDER
γ η μ ρ φ χ ψ"
AF_BLUE_STRING_GUJARATI_TOP
"ત ન ઋ ઌ છ ટ ર "
AF_BLUE_STRING_GUJARATI_BOTTOM
"ખ ગ ઘ ઞ ઇ ઈ ઠ જ"
AF_BLUE_STRING_GUJARATI_ASCENDER
"ઈ ઊ િ ી લી શ્ચિ જિ સી"
AF_BLUE_STRING_GUJARATI_DESCENDER
"ુ ૃ ૄ ખુ છૃ છૄ"
AF_BLUE_STRING_GUJARATI_DIGIT_TOP
" ૧ ૨ ૩ ૭"
AF_BLUE_STRING_GURMUKHI_BASE
"ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ"
AF_BLUE_STRING_GURMUKHI_HEAD
"ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ"
AF_BLUE_STRING_GURMUKHI_TOP
"ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ"
AF_BLUE_STRING_GURMUKHI_BOTTOM
"ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ"
AF_BLUE_STRING_GURMUKHI_DIGIT_TOP
" ੨ ੩ ੭"
AF_BLUE_STRING_HEBREW_TOP
"ב ד ה ח ך כ ם ס"
AF_BLUE_STRING_HEBREW_BOTTOM
@@ -200,6 +272,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
"ᵖ ʸ ᵍ"
AF_BLUE_STRING_MALAYALAM_TOP
"ഒ ട ഠ റ ച പ ച്ച പ്പ"
AF_BLUE_STRING_MALAYALAM_BOTTOM
"ട ധ ശ ഘ ച ഥ ല"
AF_BLUE_STRING_MYANMAR_TOP
"ခ ဂ င ဒ ၥ ၊ ။"
AF_BLUE_STRING_MYANMAR_BOTTOM
@@ -209,6 +286,18 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_MYANMAR_DESCENDER
"ဉ ည ဥ ဩ ဨ ၂ ၅ ၉"
AF_BLUE_STRING_SINHALA_TOP
"ඉ ක ඝ ඳ ප ය ල ෆ"
AF_BLUE_STRING_SINHALA_BOTTOM
"එ ඔ ඝ ජ ට ථ ධ ර"
AF_BLUE_STRING_SINHALA_DESCENDER
"ද ඳ උ ල තූ තු බු දු"
AF_BLUE_STRING_TAMIL_TOP
"உ ஒ ஓ ற ஈ க ங ச"
AF_BLUE_STRING_TAMIL_BOTTOM
"க ச ல ஶ உ ங ட ப"
AF_BLUE_STRING_TELUGU_TOP
"ఇ ఌ ఙ ఞ ణ ఱ ౯"
AF_BLUE_STRING_TELUGU_BOTTOM
@@ -400,14 +489,34 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_ARMN
{ AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 }
{ AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_BENG
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_BENGALI_BASE, 0 }
{ AF_BLUE_STRING_MAX, 0 }
{ AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_BENGALI_BASE, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CHER
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 }
{ AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_CHEROKEE_SMALL, 0 }
{ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CYRL
{ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -428,6 +537,30 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_ETHI
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
// blue zones for Mtavruli are missing (not yet defined in Unicode)
AF_BLUE_STRINGSET_GEOR
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GEOK
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 }
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 }
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GREK
{ AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
@@ -438,6 +571,25 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GUJR
{ AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_GUJARATI_BOTTOM, 0 }
{ AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GUJARATI_DESCENDER, 0 }
{ AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GURU
{ AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_NEUTRAL |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 }
{ AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_HEBR
{ AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_LONG }
@@ -466,13 +618,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LAO
{ AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_LAO_BOTTOM, 0 }
{ AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LAO_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
{ AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_LAO_BOTTOM, 0 }
{ AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LAO_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LATN
{ AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -504,6 +656,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_MLYM
{ AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_MYMR
{ AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
@@ -512,6 +669,20 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MYANMAR_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_NONE
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_SINH
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_SINHALA_BOTTOM, 0 }
{ AF_BLUE_STRING_SINHALA_DESCENDER, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_TAML
{ AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_TAMIL_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_TELU
{ AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_TELUGU_BOTTOM, 0 }
+128 -78
View File
@@ -80,68 +80,107 @@ FT_BEGIN_HEADER
AF_BLUE_STRING_ARABIC_TOP = 0,
AF_BLUE_STRING_ARABIC_BOTTOM = 18,
AF_BLUE_STRING_ARABIC_JOIN = 33,
AF_BLUE_STRING_BENGALI_BASE = 36,
AF_BLUE_STRING_BENGALI_TOP = 68,
AF_BLUE_STRING_BENGALI_HEAD = 96,
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 128,
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 152,
AF_BLUE_STRING_CYRILLIC_SMALL = 176,
AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 200,
AF_BLUE_STRING_DEVANAGARI_BASE = 209,
AF_BLUE_STRING_DEVANAGARI_TOP = 241,
AF_BLUE_STRING_DEVANAGARI_HEAD = 273,
AF_BLUE_STRING_DEVANAGARI_BOTTOM = 305,
AF_BLUE_STRING_GREEK_CAPITAL_TOP = 313,
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 334,
AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 352,
AF_BLUE_STRING_GREEK_SMALL = 370,
AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 394,
AF_BLUE_STRING_HEBREW_TOP = 418,
AF_BLUE_STRING_HEBREW_BOTTOM = 442,
AF_BLUE_STRING_HEBREW_DESCENDER = 460,
AF_BLUE_STRING_KANNADA_TOP = 475,
AF_BLUE_STRING_KANNADA_BOTTOM = 519,
AF_BLUE_STRING_KHMER_TOP = 551,
AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 575,
AF_BLUE_STRING_KHMER_BOTTOM = 615,
AF_BLUE_STRING_KHMER_DESCENDER = 647,
AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 681,
AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 768,
AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 776,
AF_BLUE_STRING_LAO_TOP = 784,
AF_BLUE_STRING_LAO_BOTTOM = 816,
AF_BLUE_STRING_LAO_ASCENDER = 848,
AF_BLUE_STRING_LAO_LARGE_ASCENDER = 864,
AF_BLUE_STRING_LAO_DESCENDER = 876,
AF_BLUE_STRING_LATIN_CAPITAL_TOP = 900,
AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 916,
AF_BLUE_STRING_LATIN_SMALL_F_TOP = 932,
AF_BLUE_STRING_LATIN_SMALL = 946,
AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 960,
AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 970,
AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 990,
AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1010,
AF_BLUE_STRING_LATIN_SUBS_SMALL = 1030,
AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 1066,
AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 1086,
AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 1117,
AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 1146,
AF_BLUE_STRING_LATIN_SUPS_SMALL = 1172,
AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 1197,
AF_BLUE_STRING_MYANMAR_TOP = 1208,
AF_BLUE_STRING_MYANMAR_BOTTOM = 1240,
AF_BLUE_STRING_MYANMAR_ASCENDER = 1272,
AF_BLUE_STRING_MYANMAR_DESCENDER = 1300,
AF_BLUE_STRING_TELUGU_TOP = 1332,
AF_BLUE_STRING_TELUGU_BOTTOM = 1360,
AF_BLUE_STRING_THAI_TOP = 1388,
AF_BLUE_STRING_THAI_BOTTOM = 1412,
AF_BLUE_STRING_THAI_ASCENDER = 1440,
AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1452,
AF_BLUE_STRING_THAI_DESCENDER = 1464,
AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1480,
AF_BLUE_STRING_THAI_DIGIT_TOP = 1488,
af_blue_1_1 = 1499,
AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP = 36,
AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 60,
AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 84,
AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 108,
AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 132,
AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 156,
AF_BLUE_STRING_BENGALI_BASE = 180,
AF_BLUE_STRING_BENGALI_TOP = 212,
AF_BLUE_STRING_BENGALI_HEAD = 240,
AF_BLUE_STRING_CHEROKEE_CAPITAL = 272,
AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 304,
AF_BLUE_STRING_CHEROKEE_SMALL = 336,
AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 368,
AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 384,
AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 408,
AF_BLUE_STRING_CYRILLIC_SMALL = 432,
AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 456,
AF_BLUE_STRING_DEVANAGARI_BASE = 465,
AF_BLUE_STRING_DEVANAGARI_TOP = 497,
AF_BLUE_STRING_DEVANAGARI_HEAD = 529,
AF_BLUE_STRING_DEVANAGARI_BOTTOM = 561,
AF_BLUE_STRING_ETHIOPIC_TOP = 569,
AF_BLUE_STRING_ETHIOPIC_BOTTOM = 601,
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 633,
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 665,
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 697,
AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 729,
AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 761,
AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 793,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 825,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 857,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 889,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 921,
AF_BLUE_STRING_GREEK_CAPITAL_TOP = 953,
AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 974,
AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 992,
AF_BLUE_STRING_GREEK_SMALL = 1010,
AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1034,
AF_BLUE_STRING_GUJARATI_TOP = 1058,
AF_BLUE_STRING_GUJARATI_BOTTOM = 1090,
AF_BLUE_STRING_GUJARATI_ASCENDER = 1122,
AF_BLUE_STRING_GUJARATI_DESCENDER = 1172,
AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1205,
AF_BLUE_STRING_GURMUKHI_BASE = 1225,
AF_BLUE_STRING_GURMUKHI_HEAD = 1257,
AF_BLUE_STRING_GURMUKHI_TOP = 1289,
AF_BLUE_STRING_GURMUKHI_BOTTOM = 1321,
AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1353,
AF_BLUE_STRING_HEBREW_TOP = 1373,
AF_BLUE_STRING_HEBREW_BOTTOM = 1397,
AF_BLUE_STRING_HEBREW_DESCENDER = 1415,
AF_BLUE_STRING_KANNADA_TOP = 1430,
AF_BLUE_STRING_KANNADA_BOTTOM = 1474,
AF_BLUE_STRING_KHMER_TOP = 1506,
AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1530,
AF_BLUE_STRING_KHMER_BOTTOM = 1570,
AF_BLUE_STRING_KHMER_DESCENDER = 1602,
AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1636,
AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1723,
AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1731,
AF_BLUE_STRING_LAO_TOP = 1739,
AF_BLUE_STRING_LAO_BOTTOM = 1771,
AF_BLUE_STRING_LAO_ASCENDER = 1803,
AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1819,
AF_BLUE_STRING_LAO_DESCENDER = 1831,
AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1855,
AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1871,
AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1887,
AF_BLUE_STRING_LATIN_SMALL = 1901,
AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1915,
AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1925,
AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1945,
AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1965,
AF_BLUE_STRING_LATIN_SUBS_SMALL = 1985,
AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2021,
AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2041,
AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2072,
AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2101,
AF_BLUE_STRING_LATIN_SUPS_SMALL = 2127,
AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2152,
AF_BLUE_STRING_MALAYALAM_TOP = 2163,
AF_BLUE_STRING_MALAYALAM_BOTTOM = 2207,
AF_BLUE_STRING_MYANMAR_TOP = 2239,
AF_BLUE_STRING_MYANMAR_BOTTOM = 2271,
AF_BLUE_STRING_MYANMAR_ASCENDER = 2303,
AF_BLUE_STRING_MYANMAR_DESCENDER = 2331,
AF_BLUE_STRING_SINHALA_TOP = 2363,
AF_BLUE_STRING_SINHALA_BOTTOM = 2395,
AF_BLUE_STRING_SINHALA_DESCENDER = 2427,
AF_BLUE_STRING_TAMIL_TOP = 2471,
AF_BLUE_STRING_TAMIL_BOTTOM = 2503,
AF_BLUE_STRING_TELUGU_TOP = 2535,
AF_BLUE_STRING_TELUGU_BOTTOM = 2563,
AF_BLUE_STRING_THAI_TOP = 2591,
AF_BLUE_STRING_THAI_BOTTOM = 2615,
AF_BLUE_STRING_THAI_ASCENDER = 2643,
AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2655,
AF_BLUE_STRING_THAI_DESCENDER = 2667,
AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2683,
AF_BLUE_STRING_THAI_DIGIT_TOP = 2691,
af_blue_1_1 = 2702,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
@@ -201,22 +240,33 @@ FT_BEGIN_HEADER
typedef enum AF_Blue_Stringset_
{
AF_BLUE_STRINGSET_ARAB = 0,
AF_BLUE_STRINGSET_BENG = 4,
AF_BLUE_STRINGSET_CYRL = 9,
AF_BLUE_STRINGSET_DEVA = 15,
AF_BLUE_STRINGSET_GREK = 21,
AF_BLUE_STRINGSET_HEBR = 28,
AF_BLUE_STRINGSET_KNDA = 32,
AF_BLUE_STRINGSET_KHMR = 35,
AF_BLUE_STRINGSET_KHMS = 41,
AF_BLUE_STRINGSET_LAO = 44,
AF_BLUE_STRINGSET_LATN = 50,
AF_BLUE_STRINGSET_LATB = 57,
AF_BLUE_STRINGSET_LATP = 64,
AF_BLUE_STRINGSET_MYMR = 71,
AF_BLUE_STRINGSET_TELU = 76,
AF_BLUE_STRINGSET_THAI = 79,
af_blue_2_1 = 87,
AF_BLUE_STRINGSET_ARMN = 4,
AF_BLUE_STRINGSET_BENG = 11,
AF_BLUE_STRINGSET_CHER = 16,
AF_BLUE_STRINGSET_CYRL = 23,
AF_BLUE_STRINGSET_DEVA = 29,
AF_BLUE_STRINGSET_ETHI = 35,
AF_BLUE_STRINGSET_GEOR = 38,
AF_BLUE_STRINGSET_GEOK = 43,
AF_BLUE_STRINGSET_GREK = 50,
AF_BLUE_STRINGSET_GUJR = 57,
AF_BLUE_STRINGSET_GURU = 63,
AF_BLUE_STRINGSET_HEBR = 69,
AF_BLUE_STRINGSET_KNDA = 73,
AF_BLUE_STRINGSET_KHMR = 76,
AF_BLUE_STRINGSET_KHMS = 82,
AF_BLUE_STRINGSET_LAO = 85,
AF_BLUE_STRINGSET_LATN = 91,
AF_BLUE_STRINGSET_LATB = 98,
AF_BLUE_STRINGSET_LATP = 105,
AF_BLUE_STRINGSET_MLYM = 112,
AF_BLUE_STRINGSET_MYMR = 115,
AF_BLUE_STRINGSET_NONE = 120,
AF_BLUE_STRINGSET_SINH = 121,
AF_BLUE_STRINGSET_TAML = 125,
AF_BLUE_STRINGSET_TELU = 128,
AF_BLUE_STRINGSET_THAI = 131,
af_blue_2_1 = 139,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 2,
+1 -4
View File
@@ -981,15 +981,12 @@
if ( seg2 )
{
seg2->num_linked++;
if ( seg2->link != seg1 )
{
seg1->link = NULL;
if ( seg2->score < dist_threshold || seg1->score < seg2->score * 4 )
seg1->serif = seg2->link;
else
seg2->num_linked--;
}
}
}
@@ -1543,7 +1540,7 @@
}
if ( dist < 54 )
dist += ( 54 - dist ) / 2 ;
dist += ( 54 - dist ) / 2;
else if ( dist < 3 * 64 )
{
FT_Pos delta;
+36 -17
View File
@@ -314,7 +314,7 @@
AF_DUMP(( "Table of points:\n" ));
if ( hints->num_points )
AF_DUMP(( " index hedge hseg vedge vseg flags"
AF_DUMP(( " index hedge hseg vedge vseg flags "
" xorg yorg xscale yscale xfit yfit" ));
else
AF_DUMP(( " (none)\n" ));
@@ -335,7 +335,7 @@
contour++;
}
AF_DUMP(( " %5d %5s %5s %5s %5s %s "
AF_DUMP(( " %5d %5s %5s %5s %5s %s"
" %5d %5d %7.2f %7.2f %7.2f %7.2f\n",
point_idx,
af_print_idx( buf1,
@@ -344,8 +344,11 @@
af_print_idx( buf3,
af_get_edge_index( hints, segment_idx_0, 0 ) ),
af_print_idx( buf4, segment_idx_0 ),
( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? "weak"
: " -- ",
( point->flags & AF_FLAG_NEAR )
? " near "
: ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
? " weak "
: "strong",
point->fx,
point->fy,
@@ -813,18 +816,26 @@
AF_Point point;
AF_Point point_limit = points + hints->num_points;
/* value 20 in `near_limit' is heuristic */
FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM;
FT_Int near_limit = 20 * units_per_em / 2048;
/* compute coordinates & Bezier flags, next and prev */
{
FT_Vector* vec = outline->points;
char* tag = outline->tags;
AF_Point end = points + outline->contours[0];
FT_Short endpoint = outline->contours[0];
AF_Point end = points + endpoint;
AF_Point prev = end;
FT_Int contour_index = 0;
for ( point = points; point < point_limit; point++, vec++, tag++ )
{
FT_Pos out_x, out_y;
point->in_dir = (FT_Char)AF_DIR_NONE;
point->out_dir = (FT_Char)AF_DIR_NONE;
@@ -833,6 +844,9 @@
point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta;
point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta;
end->fx = (FT_Short)outline->points[endpoint].x;
end->fy = (FT_Short)outline->points[endpoint].y;
switch ( FT_CURVE_TAG( *tag ) )
{
case FT_CURVE_TAG_CONIC:
@@ -845,6 +859,12 @@
point->flags = AF_FLAG_NONE;
}
out_x = point->fx - prev->fx;
out_y = point->fy - prev->fy;
if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit )
prev->flags |= AF_FLAG_NEAR;
point->prev = prev;
prev->next = point;
prev = point;
@@ -853,8 +873,9 @@
{
if ( ++contour_index < outline->n_contours )
{
end = points + outline->contours[contour_index];
prev = end;
endpoint = outline->contours[contour_index];
end = points + endpoint;
prev = end;
}
}
}
@@ -880,17 +901,15 @@
* Compute directions of `in' and `out' vectors.
*
* Note that distances between points that are very near to each
* other are accumulated. In other words, the auto-hinter
* other are accumulated. In other words, the auto-hinter either
* prepends the small vectors between near points to the first
* non-near vector. All intermediate points are tagged as
* weak; the directions are adjusted also to be equal to the
* accumulated one.
* non-near vector, or the sum of small vector lengths exceeds a
* threshold, thus `grouping' the small vectors. All intermediate
* points are tagged as weak; the directions are adjusted also to
* be equal to the accumulated one.
*/
/* value 20 in `near_limit' is heuristic */
FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM;
FT_Int near_limit = 20 * units_per_em / 2048;
FT_Int near_limit2 = 2 * near_limit - 1;
FT_Int near_limit2 = 2 * near_limit - 1;
AF_Point* contour;
AF_Point* contour_limit = hints->contours + hints->num_contours;
@@ -937,7 +956,7 @@
/* now loop over all points of the contour to get */
/* `in' and `out' vector directions */
curr = first;
curr = first;
/*
* We abuse the `u' and `v' fields to store index deltas to the
@@ -960,7 +979,7 @@
point = next;
next = point->next;
next = point->next;
out_x += next->fx - point->fx;
out_y += next->fy - point->fy;
+3 -2
View File
@@ -221,6 +221,9 @@ FT_BEGIN_HEADER
/* candidates for weak interpolation have this flag set */
#define AF_FLAG_WEAK_INTERPOLATION ( 1U << 4 )
/* the distance to the next point is very small */
#define AF_FLAG_NEAR ( 1U << 5 )
/* edge hint flags */
#define AF_EDGE_NORMAL 0
@@ -266,7 +269,6 @@ FT_BEGIN_HEADER
AF_Segment link; /* (stem) link segment */
AF_Segment serif; /* primary segment for serifs */
FT_Pos num_linked; /* number of linked segments */
FT_Pos score; /* used during stem matching */
FT_Pos len; /* used during stem matching */
@@ -289,7 +291,6 @@ FT_BEGIN_HEADER
AF_Width blue_edge; /* non-NULL if this is a blue edge */
AF_Edge link; /* link edge */
AF_Edge serif; /* primary edge for serifs */
FT_Short num_linked; /* number of linked edges */
FT_Int score; /* used during stem matching */
AF_Segment first; /* first segment in edge */
+342 -61
View File
@@ -1452,18 +1452,35 @@
/* do each contour separately */
for ( ; contour < contour_limit; contour++ )
{
AF_Point point = contour[0];
AF_Point last = point->prev;
int on_edge = 0;
FT_Pos min_pos = 32000; /* minimum segment pos != min_coord */
FT_Pos max_pos = -32000; /* maximum segment pos != max_coord */
FT_Pos min_on_pos = 32000;
FT_Pos max_on_pos = -32000;
FT_Bool passed;
AF_Point point = contour[0];
AF_Point last = point->prev;
int on_edge = 0;
/* we call values measured along a segment (point->v) */
/* `coordinates', and values orthogonal to it (point->u) */
/* `positions' */
FT_Pos min_pos = 32000;
FT_Pos max_pos = -32000;
FT_Pos min_coord = 32000;
FT_Pos max_coord = -32000;
FT_UShort min_flags = AF_FLAG_NONE;
FT_UShort max_flags = AF_FLAG_NONE;
FT_Pos min_on_coord = 32000;
FT_Pos max_on_coord = -32000;
FT_Bool passed;
AF_Segment prev_segment = NULL;
FT_Pos prev_min_pos = min_pos;
FT_Pos prev_max_pos = max_pos;
FT_Pos prev_min_coord = min_coord;
FT_Pos prev_max_coord = max_coord;
FT_UShort prev_min_flags = min_flags;
FT_UShort prev_max_flags = max_flags;
FT_Pos prev_min_on_coord = min_on_coord;
FT_Pos prev_max_on_coord = max_on_coord;
if ( point == last ) /* skip singletons -- just in case */
continue;
if ( FT_ABS( last->out_dir ) == major_dir &&
FT_ABS( point->out_dir ) == major_dir )
@@ -1494,51 +1511,181 @@
if ( on_edge )
{
/* get minimum and maximum position */
u = point->u;
if ( u < min_pos )
min_pos = u;
if ( u > max_pos )
max_pos = u;
/* get minimum and maximum coordinate of on points */
/* get minimum and maximum coordinate together with flags */
v = point->v;
if ( v < min_coord )
{
min_coord = v;
min_flags = point->flags;
}
if ( v > max_coord )
{
max_coord = v;
max_flags = point->flags;
}
/* get minimum and maximum coordinate of `on' points */
if ( !( point->flags & AF_FLAG_CONTROL ) )
{
v = point->v;
if ( v < min_on_pos )
min_on_pos = v;
if ( v > max_on_pos )
max_on_pos = v;
if ( v < min_on_coord )
min_on_coord = v;
if ( v > max_on_coord )
max_on_coord = v;
}
if ( point->out_dir != segment_dir || point == last )
{
/* we are just leaving an edge; record a new segment! */
segment->last = point;
segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
/* check whether the new segment's start point is identical to */
/* the previous segment's end point; for example, this might */
/* happen for spikes */
/* a segment is round if either its first or last point */
/* is a control point, and the length of the on points */
/* inbetween doesn't exceed a heuristic limit */
if ( ( segment->first->flags | point->flags ) & AF_FLAG_CONTROL &&
( max_on_pos - min_on_pos ) < flat_threshold )
segment->flags |= AF_EDGE_ROUND;
if ( !prev_segment || segment->first != prev_segment->last )
{
/* points are different: we are just leaving an edge, thus */
/* record a new segment */
/* compute segment size */
min_pos = max_pos = point->v;
segment->last = point;
segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
v = segment->first->v;
if ( v < min_pos )
min_pos = v;
if ( v > max_pos )
max_pos = v;
/* a segment is round if either its first or last point */
/* is a control point, and the length of the on points */
/* inbetween doesn't exceed a heuristic limit */
if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL &&
( max_on_coord - min_on_coord ) < flat_threshold )
segment->flags |= AF_EDGE_ROUND;
segment->min_coord = (FT_Short)min_pos;
segment->max_coord = (FT_Short)max_pos;
segment->height = (FT_Short)( segment->max_coord -
segment->min_coord );
segment->min_coord = (FT_Short)min_coord;
segment->max_coord = (FT_Short)max_coord;
segment->height = segment->max_coord - segment->min_coord;
prev_segment = segment;
prev_min_pos = min_pos;
prev_max_pos = max_pos;
prev_min_coord = min_coord;
prev_max_coord = max_coord;
prev_min_flags = min_flags;
prev_max_flags = max_flags;
prev_min_on_coord = min_on_coord;
prev_max_on_coord = max_on_coord;
}
else
{
/* points are the same: we don't create a new segment but */
/* merge the current segment with the previous one */
if ( prev_segment->last->in_dir == point->in_dir )
{
/* we have identical directions (this can happen for */
/* degenerate outlines that move zig-zag along the main */
/* axis without changing the coordinate value of the other */
/* axis, and where the segments have just been merged): */
/* unify segments */
/* update constraints */
if ( prev_min_pos < min_pos )
min_pos = prev_min_pos;
if ( prev_max_pos > max_pos )
max_pos = prev_max_pos;
if ( prev_min_coord < min_coord )
{
min_coord = prev_min_coord;
min_flags = prev_min_flags;
}
if ( prev_max_coord > max_coord )
{
max_coord = prev_max_coord;
max_flags = prev_max_flags;
}
if ( prev_min_on_coord < min_on_coord )
min_on_coord = prev_min_on_coord;
if ( prev_max_on_coord > max_on_coord )
max_on_coord = prev_max_on_coord;
prev_segment->last = point;
prev_segment->pos = (FT_Short)( ( min_pos +
max_pos ) >> 1 );
if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL &&
( max_on_coord - min_on_coord ) < flat_threshold )
prev_segment->flags |= AF_EDGE_ROUND;
else
prev_segment->flags &= ~AF_EDGE_ROUND;
prev_segment->min_coord = (FT_Short)min_coord;
prev_segment->max_coord = (FT_Short)max_coord;
prev_segment->height = prev_segment->max_coord -
prev_segment->min_coord;
}
else
{
/* we have different directions; use the properties of the */
/* longer segment and discard the other one */
if ( FT_ABS( prev_max_coord - prev_min_coord ) >
FT_ABS( max_coord - min_coord ) )
{
/* discard current segment */
if ( min_pos < prev_min_pos )
prev_min_pos = min_pos;
if ( max_pos > prev_max_pos )
prev_max_pos = max_pos;
prev_segment->last = point;
prev_segment->pos = (FT_Short)( ( prev_min_pos +
prev_max_pos ) >> 1 );
}
else
{
/* discard previous segment */
if ( prev_min_pos < min_pos )
min_pos = prev_min_pos;
if ( prev_max_pos > max_pos )
max_pos = prev_max_pos;
segment->last = point;
segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 );
if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL &&
( max_on_coord - min_on_coord ) < flat_threshold )
segment->flags |= AF_EDGE_ROUND;
segment->min_coord = (FT_Short)min_coord;
segment->max_coord = (FT_Short)max_coord;
segment->height = segment->max_coord -
segment->min_coord;
*prev_segment = *segment;
prev_min_pos = min_pos;
prev_max_pos = max_pos;
prev_min_coord = min_coord;
prev_max_coord = max_coord;
prev_min_flags = min_flags;
prev_max_flags = max_flags;
prev_min_on_coord = min_on_coord;
prev_max_on_coord = max_on_coord;
}
}
axis->num_segments--;
}
on_edge = 0;
segment = NULL;
/* fall through */
}
}
@@ -1551,7 +1698,12 @@
passed = 1;
}
if ( !on_edge && FT_ABS( point->out_dir ) == major_dir )
/* if we are not on an edge, check whether the major direction */
/* coincides with the current point's `out' direction, or */
/* whether we have a single-point contour */
if ( !on_edge &&
( FT_ABS( point->out_dir ) == major_dir ||
point == point->prev ) )
{
/* this is the start of a new segment! */
segment_dir = (AF_Direction)point->out_dir;
@@ -1567,17 +1719,42 @@
segment->first = point;
segment->last = point;
min_pos = max_pos = point->u;
/* `af_axis_hints_new_segment' reallocates memory, */
/* thus we have to refresh the `prev_segment' pointer */
if ( prev_segment )
prev_segment = segment - 1;
min_pos = max_pos = point->u;
min_coord = max_coord = point->v;
min_flags = max_flags = point->flags;
if ( point->flags & AF_FLAG_CONTROL )
{
min_on_pos = 32000;
max_on_pos = -32000;
min_on_coord = 32000;
max_on_coord = -32000;
}
else
min_on_pos = max_on_pos = point->v;
min_on_coord = max_on_coord = point->v;
on_edge = 1;
if ( point == point->prev )
{
/* we have a one-point segment: this is a one-point */
/* contour with `in' and `out' direction set to */
/* AF_DIR_NONE */
segment->pos = (FT_Short)min_pos;
if (point->flags & AF_FLAG_CONTROL)
segment->flags |= AF_EDGE_ROUND;
segment->min_coord = (FT_Short)point->v;
segment->max_coord = (FT_Short)point->v;
segment->height = 0;
on_edge = 0;
segment = NULL;
}
}
point = point->next;
@@ -1861,7 +2038,10 @@
FT_Int ee;
if ( seg->height < segment_length_threshold )
/* ignore too short segments and, in this loop, */
/* one-point segments without a direction */
if ( seg->height < segment_length_threshold ||
seg->dir == AF_DIR_NONE )
continue;
/* A special case for serif edges: If they are smaller than */
@@ -1923,6 +2103,44 @@
}
}
/* we loop again over all segments to catch one-point segments */
/* without a direction: if possible, link them to existing edges */
for ( seg = segments; seg < segment_limit; seg++ )
{
AF_Edge found = NULL;
FT_Int ee;
if ( seg->dir != AF_DIR_NONE )
continue;
/* look for an edge corresponding to the segment */
for ( ee = 0; ee < axis->num_edges; ee++ )
{
AF_Edge edge = axis->edges + ee;
FT_Pos dist;
dist = seg->pos - edge->fpos;
if ( dist < 0 )
dist = -dist;
if ( dist < edge_distance_threshold )
{
found = edge;
break;
}
}
/* one-point segments without a match are ignored */
if ( found )
{
seg->edge_next = found->first;
found->last->edge_next = seg;
found->last = seg;
}
}
/******************************************************************/
/* */
@@ -2363,6 +2581,7 @@
af_latin_compute_stem_width( AF_GlyphHints hints,
AF_Dimension dim,
FT_Pos width,
FT_Pos base_delta,
FT_UInt base_flags,
FT_UInt stem_flags )
{
@@ -2440,7 +2659,39 @@
dist += delta;
}
else
dist = ( dist + 32 ) & ~63;
{
/* A stem's end position depends on two values: the start */
/* position and the stem length. The former gets usually */
/* rounded to the grid, while the latter gets rounded also if it */
/* exceeds a certain length (see below in this function). This */
/* `double rounding' can lead to a great difference to the */
/* original, unhinted position; this normally doesn't matter for */
/* large PPEM values, but for small sizes it can easily make */
/* outlines collide. For this reason, we adjust the stem length */
/* by a small amount depending on the PPEM value in case the */
/* former and latter rounding both point into the same */
/* direction. */
FT_Pos bdelta = 0;
if ( ( ( width > 0 ) && ( base_delta > 0 ) ) ||
( ( width < 0 ) && ( base_delta < 0 ) ) )
{
FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem;
if ( ppem < 10 )
bdelta = base_delta;
else if ( ppem < 30 )
bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20;
if ( bdelta < 0 )
bdelta = -bdelta;
}
dist = ( dist - bdelta + 32 ) & ~63;
}
}
}
else
@@ -2529,11 +2780,17 @@
AF_Edge base_edge,
AF_Edge stem_edge )
{
FT_Pos dist = stem_edge->opos - base_edge->opos;
FT_Pos dist, base_delta;
FT_Pos fitted_width;
FT_Pos fitted_width = af_latin_compute_stem_width( hints, dim, dist,
base_edge->flags,
stem_edge->flags );
dist = stem_edge->opos - base_edge->opos;
base_delta = base_edge->pos - base_edge->opos;
fitted_width = af_latin_compute_stem_width( hints, dim,
dist, base_delta,
base_edge->flags,
stem_edge->flags );
stem_edge->pos = base_edge->pos + fitted_width;
@@ -2737,7 +2994,8 @@
org_len = edge2->opos - edge->opos;
cur_len = af_latin_compute_stem_width( hints, dim, org_len,
cur_len = af_latin_compute_stem_width( hints, dim,
org_len, 0,
edge->flags,
edge2->flags );
@@ -2806,7 +3064,8 @@
org_len = edge2->opos - edge->opos;
org_center = org_pos + ( org_len >> 1 );
cur_len = af_latin_compute_stem_width( hints, dim, org_len,
cur_len = af_latin_compute_stem_width( hints, dim,
org_len, 0,
edge->flags,
edge2->flags );
@@ -2866,7 +3125,8 @@
org_len = edge2->opos - edge->opos;
org_center = org_pos + ( org_len >> 1 );
cur_len = af_latin_compute_stem_width( hints, dim, org_len,
cur_len = af_latin_compute_stem_width( hints, dim,
org_len, 0,
edge->flags,
edge2->flags );
@@ -2901,14 +3161,21 @@
( top_to_bottom_hinting ? ( edge->pos > edge[-1].pos )
: ( edge->pos < edge[-1].pos ) ) )
{
/* don't move if stem would (almost) disappear otherwise; */
/* the ad-hoc value 16 corresponds to 1/4px */
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[-1].pos / 64.0 ));
num_actions++;
num_actions++;
#endif
edge->pos = edge[-1].pos;
edge->pos = edge[-1].pos;
}
}
}
}
@@ -3064,13 +3331,20 @@
( top_to_bottom_hinting ? ( edge->pos > edge[-1].pos )
: ( edge->pos < edge[-1].pos ) ) )
{
/* don't move if stem would (almost) disappear otherwise; */
/* the ad-hoc value 16 corresponds to 1/4px */
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[-1].pos / 64.0 ));
num_actions++;
num_actions++;
#endif
edge->pos = edge[-1].pos;
edge->pos = edge[-1].pos;
}
}
if ( edge + 1 < edge_limit &&
@@ -3078,14 +3352,21 @@
( top_to_bottom_hinting ? ( edge->pos < edge[1].pos )
: ( edge->pos > edge[1].pos ) ) )
{
/* don't move if stem would (almost) disappear otherwise; */
/* the ad-hoc value 16 corresponds to 1/4px */
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges, edge->pos / 64.0, edge[1].pos / 64.0 ));
FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[1].pos / 64.0 ));
num_actions++;
num_actions++;
#endif
edge->pos = edge[1].pos;
edge->pos = edge[1].pos;
}
}
}
}
@@ -1,3 +1,8 @@
/* ATTENTION: This file doesn't compile. It is only here as a reference */
/* of an alternative latin hinting algorithm that was always */
/* marked as experimental. */
/***************************************************************************/
/* */
/* aflatin2.c */
@@ -1,3 +1,8 @@
/* ATTENTION: This file doesn't compile. It is only here as a reference */
/* of an alternative latin hinting algorithm that was always */
/* marked as experimental. */
/***************************************************************************/
/* */
/* aflatin2.h */
File diff suppressed because it is too large Load Diff
+62 -31
View File
@@ -36,12 +36,24 @@
HINTING_BOTTOM_TO_TOP,
"\xD9\x84 \xD8\xAD \xD9\x80" ) /* ل ح ـ */
SCRIPT( armn, ARMN,
"Armenian",
HB_SCRIPT_ARMENIAN,
HINTING_BOTTOM_TO_TOP,
"\xD6\x85 \xD5\x95" ) /* օ Օ */
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( beng, BENG,
"Bengali",
HB_SCRIPT_BENGALI,
HINTING_TOP_TO_BOTTOM,
"\xE0\xA7\xA6 \xE0\xA7\xAA" ) /* */
"\xE0\xA7\xA6 \xE0\xA7\xAA" ) /* */
SCRIPT( cher, CHER,
"Cherokee",
HB_SCRIPT_CHEROKEE,
HINTING_BOTTOM_TO_TOP,
"\xE1\x8E\xA4 \xE1\x8F\x85 \xEA\xAE\x95" ) /* Ꭴ Ꮕ ꮕ */
SCRIPT( cyrl, CYRL,
"Cyrillic",
@@ -55,12 +67,42 @@
HINTING_TOP_TO_BOTTOM,
"\xE0\xA4\xA0 \xE0\xA4\xB5 \xE0\xA4\x9F" ) /* ठ व ट */
SCRIPT( ethi, ETHI,
"Ethiopic",
HB_SCRIPT_ETHIOPIC,
HINTING_BOTTOM_TO_TOP,
"\xE1\x8B\x90" ) /* */
SCRIPT( geor, GEOR,
"Georgian (Mkhedruli)",
HB_SCRIPT_GEORGIAN,
HINTING_BOTTOM_TO_TOP,
"\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90" ) /* ი ე ა */
SCRIPT( geok, GEOK,
"Georgian (Khutsuri)",
HB_SCRIPT_INVALID,
HINTING_BOTTOM_TO_TOP,
"\xE1\x82\xB6 \xE1\x82\xB1 \xE2\xB4\x99" ) /* Ⴖ Ⴑ ⴙ */
SCRIPT( grek, GREK,
"Greek",
HB_SCRIPT_GREEK,
HINTING_BOTTOM_TO_TOP,
"\xCE\xBF \xCE\x9F" ) /* ο Ο */
SCRIPT( gujr, GUJR,
"Gujarati",
HB_SCRIPT_GUJARATI,
HINTING_BOTTOM_TO_TOP,
"\xE0\xAA\x9F \xE0\xAB\xA6" ) /* ટ */
SCRIPT( guru, GURU,
"Gurmukhi",
HB_SCRIPT_GURMUKHI,
HINTING_TOP_TO_BOTTOM,
"\xE0\xA8\xA0 \xE0\xA8\xB0 \xE0\xA9\xA6" ) /* ਠ ਰ */
SCRIPT( hebr, HEBR,
"Hebrew",
HB_SCRIPT_HEBREW,
@@ -111,6 +153,12 @@
HINTING_BOTTOM_TO_TOP,
"\xE1\xB5\x92 \xE1\xB4\xBC \xE2\x81\xB0" ) /* ᵒ ᴼ ⁰ */
SCRIPT( mlym, MLYM,
"Malayalam",
HB_SCRIPT_MALAYALAM,
HINTING_BOTTOM_TO_TOP,
"\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* റ */
SCRIPT( mymr, MYMR,
"Myanmar",
HB_SCRIPT_MYANMAR,
@@ -123,6 +171,19 @@
HINTING_BOTTOM_TO_TOP,
"" )
SCRIPT( sinh, SINH,
"Sinhala",
HB_SCRIPT_SINHALA,
HINTING_BOTTOM_TO_TOP,
"\xE0\xB6\xA7" ) /* ට */
/* only digit zero has a simple (round) shape in the Tamil script */
SCRIPT( taml, TAML,
"Tamil",
HB_SCRIPT_TAMIL,
HINTING_BOTTOM_TO_TOP,
"\xE0\xAF\xA6" ) /* */
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( telu, TELU,
"Telugu",
@@ -138,42 +199,18 @@
#ifdef AF_CONFIG_OPTION_INDIC
SCRIPT( gujr, GUJR,
"Gujarati",
HB_SCRIPT_GUJARATI,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( guru, GURU,
"Gurmukhi",
HB_SCRIPT_GURMUKHI,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( limb, LIMB,
"Limbu",
HB_SCRIPT_LIMBU,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( mlym, MLYM,
"Malayalam",
HB_SCRIPT_MALAYALAM,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( orya, ORYA,
"Oriya",
HB_SCRIPT_ORIYA,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( sinh, SINH,
"Sinhala",
HB_SCRIPT_SINHALA,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( sund, SUND,
"Sundanese",
HB_SCRIPT_SUNDANESE,
@@ -186,12 +223,6 @@
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( taml, TAML,
"Tamil",
HB_SCRIPT_TAMIL,
HINTING_BOTTOM_TO_TOP,
"o" ) /* XXX */
SCRIPT( tibt, TIBT,
"Tibetan",
HB_SCRIPT_TIBETAN,
+73 -8
View File
@@ -52,10 +52,10 @@
#undef META_STYLE_LATIN
#define META_STYLE_LATIN( s, S, ds ) \
STYLE_LATIN( s, S, c2cp, C2CP, ds, \
"petite capticals from capitals", \
"petite capitals from capitals", \
PETITE_CAPITALS_FROM_CAPITALS ) \
STYLE_LATIN( s, S, c2sc, C2SC, ds, \
"small capticals from capitals", \
"small capitals from capitals", \
SMALL_CAPITALS_FROM_CAPITALS ) \
STYLE_LATIN( s, S, ordn, ORDN, ds, \
"ordinals", \
@@ -90,6 +90,13 @@
AF_BLUE_STRINGSET_ARAB,
AF_COVERAGE_DEFAULT )
STYLE( armn_dflt, ARMN_DFLT,
"Armenian default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_ARMN,
AF_BLUE_STRINGSET_ARMN,
AF_COVERAGE_DEFAULT )
STYLE( beng_dflt, BENG_DFLT,
"Bengali default style",
AF_WRITING_SYSTEM_LATIN,
@@ -97,6 +104,13 @@
AF_BLUE_STRINGSET_BENG,
AF_COVERAGE_DEFAULT )
STYLE( cher_dflt, CHER_DFLT,
"Cherokee default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_CHER,
AF_BLUE_STRINGSET_CHER,
AF_COVERAGE_DEFAULT )
META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" )
STYLE( deva_dflt, DEVA_DFLT,
@@ -106,8 +120,43 @@
AF_BLUE_STRINGSET_DEVA,
AF_COVERAGE_DEFAULT )
STYLE( ethi_dflt, ETHI_DFLT,
"Ethiopic default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_ETHI,
AF_BLUE_STRINGSET_ETHI,
AF_COVERAGE_DEFAULT )
STYLE( geor_dflt, GEOR_DFLT,
"Georgian (Mkhedruli) default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_GEOR,
AF_BLUE_STRINGSET_GEOR,
AF_COVERAGE_DEFAULT )
STYLE( geok_dflt, GEOK_DFLT,
"Georgian (Khutsuri) default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_GEOK,
AF_BLUE_STRINGSET_GEOK,
AF_COVERAGE_DEFAULT )
META_STYLE_LATIN( grek, GREK, "Greek" )
STYLE( gujr_dflt, GUJR_DFLT,
"Gujarati default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_GUJR,
AF_BLUE_STRINGSET_GUJR,
AF_COVERAGE_DEFAULT )
STYLE( guru_dflt, GURU_DFLT,
"Gurmukhi default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_GURU,
AF_BLUE_STRINGSET_GURU,
AF_COVERAGE_DEFAULT )
STYLE( hebr_dflt, HEBR_DFLT,
"Hebrew default style",
AF_WRITING_SYSTEM_LATIN,
@@ -168,6 +217,13 @@
AF_COVERAGE_DEFAULT )
#endif
STYLE( mlym_dflt, MLYM_DFLT,
"Malayalam default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_MLYM,
AF_BLUE_STRINGSET_MLYM,
AF_COVERAGE_DEFAULT )
STYLE( mymr_dflt, MYMR_DFLT,
"Myanmar default style",
AF_WRITING_SYSTEM_LATIN,
@@ -179,7 +235,21 @@
"no style",
AF_WRITING_SYSTEM_DUMMY,
AF_SCRIPT_NONE,
(AF_Blue_Stringset)0,
AF_BLUE_STRINGSET_NONE,
AF_COVERAGE_DEFAULT )
STYLE( sinh_dflt, SINH_DFLT,
"Sinhala default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_SINH,
AF_BLUE_STRINGSET_SINH,
AF_COVERAGE_DEFAULT )
STYLE( taml_dflt, TAML_DFLT,
"Tamil default style",
AF_WRITING_SYSTEM_LATIN,
AF_SCRIPT_TAML,
AF_BLUE_STRINGSET_TAML,
AF_COVERAGE_DEFAULT )
STYLE( telu_dflt, TELU_DFLT,
@@ -208,15 +278,10 @@
(AF_Blue_Stringset)0, \
AF_COVERAGE_DEFAULT )
STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" )
STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" )
STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" )
STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" )
STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" )
STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" )
STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" )
STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" )
STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" )
STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" )
#endif /* AF_CONFIG_OPTION_INDIC */
+1 -1
View File
@@ -22,7 +22,7 @@
* Its main feature is the ability to differentiate between different
* writing systems and scripts in order to apply specific rules.
*
* The code has also been compartmentized into several entities that
* The code has also been compartmentalized into several entities that
* should make algorithmic experimentation easier than with the old
* code.
*
+2 -2
View File
@@ -159,8 +159,8 @@
/* scale from 26.6 to 16.16 */
padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? face->glyph->advance.y << 10
: face->glyph->advance.x << 10;
? face->glyph->advance.y * 1024
: face->glyph->advance.x * 1024;
}
return error;
+1 -1
View File
@@ -351,7 +351,7 @@
}
/* for each row */
for ( y = 0; y < bitmap->rows ; y++ )
for ( y = 0; y < bitmap->rows; y++ )
{
/*
* Horizontally:
+1 -1
View File
@@ -228,7 +228,7 @@
if ( !fontName || !face_index )
return FT_THROW( Invalid_Argument) ;
return FT_THROW( Invalid_Argument);
err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );
if ( err )
+20 -5
View File
@@ -1418,7 +1418,7 @@
/* Type 1 and CID-keyed font drivers should recognize sfnt-wrapped */
/* format too. Here, since we can't expect that the TrueType font */
/* driver is loaded unconditially, we must parse the font by */
/* driver is loaded unconditionally, we must parse the font by */
/* ourselves. We are only interested in the name of the table and */
/* the offset. */
@@ -1483,6 +1483,7 @@
if ( face_index >= 0 && pstable_index == face_index )
return FT_Err_Ok;
}
return FT_THROW( Table_Missing );
}
@@ -1520,6 +1521,19 @@
if ( error )
goto Exit;
if ( offset > stream->size )
{
FT_TRACE2(( "open_face_PS_from_sfnt_stream: invalid table offset\n" ));
error = FT_THROW( Invalid_Table );
goto Exit;
}
else if ( length > stream->size - offset )
{
FT_TRACE2(( "open_face_PS_from_sfnt_stream: invalid table length\n" ));
error = FT_THROW( Invalid_Table );
goto Exit;
}
error = FT_Stream_Seek( stream, pos + offset );
if ( error )
goto Exit;
@@ -1528,7 +1542,8 @@
goto Exit;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_ps, length );
if ( error ) {
if ( error )
{
FT_FREE( sfnt_ps );
goto Exit;
}
@@ -1776,8 +1791,8 @@
FT_Long face_index_in_resource = 0;
if ( face_index == -1 )
face_index = 0;
if ( face_index < 0 )
face_index = -face_index - 1;
if ( face_index >= resource_cnt )
return FT_THROW( Cannot_Open_Resource );
@@ -4308,7 +4323,7 @@
{
FT_Error error;
FT_Memory memory;
FT_Module module;
FT_Module module = NULL;
FT_UInt nn;
+1 -1
View File
@@ -42,7 +42,7 @@
static
const FT_Outline null_outline = { 0, 0, 0, 0, 0, 0 };
const FT_Outline null_outline = { 0, 0, NULL, NULL, NULL, 0 };
/* documentation is in ftoutln.h */
+1 -1
View File
@@ -403,7 +403,7 @@
errors[i] = FT_Err_Ok;
if ( errors[i] )
continue ;
continue;
errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,
stream, base_name,
+1 -1
View File
@@ -778,7 +778,7 @@
case ft_frame_short_be:
case ft_frame_ushort_be: /* read a 2-byte big-endian short */
value = FT_NEXT_USHORT( cursor) ;
value = FT_NEXT_USHORT( cursor );
sign_shift = 16;
break;
+26 -31
View File
@@ -63,12 +63,19 @@
(a) += (b);
/*
* SET reads 4 input bytes in little-endian byte order and stores them
* in a properly aligned word in host byte order.
* SET reads 4 input bytes in little-endian byte order and stores them in a
* properly aligned word in host byte order.
*
* The check for little-endian architectures that tolerate unaligned
* memory accesses is just an optimization. Nothing will break if it
* doesn't work.
* The check for little-endian architectures that tolerate unaligned memory
* accesses is just an optimization. Nothing will break if it fails to detect
* a suitable architecture.
*
* Unfortunately, this optimization may be a C strict aliasing rules violation
* if the caller's data buffer has effective type that cannot be aliased by
* MD5_u32plus. In practice, this problem may occur if these MD5 routines are
* inlined into a calling function, or with future and dangerously advanced
* link-time optimizations. For the time being, keeping these MD5 routines in
* their own translation unit avoids the problem.
*/
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
#define SET(n) \
@@ -87,8 +94,8 @@
#endif
/*
* This processes one or more 64-byte data blocks, but does NOT update
* the bit counters. There are no alignment requirements.
* This processes one or more 64-byte data blocks, but does NOT update the bit
* counters. There are no alignment requirements.
*/
static const void *body(MD5_CTX *ctx, const void *data, unsigned long size)
{
@@ -242,6 +249,12 @@ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)
memcpy(ctx->buffer, data, size);
}
#define OUT(dst, src) \
(dst)[0] = (unsigned char)(src); \
(dst)[1] = (unsigned char)((src) >> 8); \
(dst)[2] = (unsigned char)((src) >> 16); \
(dst)[3] = (unsigned char)((src) >> 24);
void MD5_Final(unsigned char *result, MD5_CTX *ctx)
{
unsigned long used, available;
@@ -262,33 +275,15 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx)
memset(&ctx->buffer[used], 0, available - 8);
ctx->lo <<= 3;
ctx->buffer[56] = ctx->lo;
ctx->buffer[57] = ctx->lo >> 8;
ctx->buffer[58] = ctx->lo >> 16;
ctx->buffer[59] = ctx->lo >> 24;
ctx->buffer[60] = ctx->hi;
ctx->buffer[61] = ctx->hi >> 8;
ctx->buffer[62] = ctx->hi >> 16;
ctx->buffer[63] = ctx->hi >> 24;
OUT(&ctx->buffer[56], ctx->lo)
OUT(&ctx->buffer[60], ctx->hi)
body(ctx, ctx->buffer, 64);
result[0] = ctx->a;
result[1] = ctx->a >> 8;
result[2] = ctx->a >> 16;
result[3] = ctx->a >> 24;
result[4] = ctx->b;
result[5] = ctx->b >> 8;
result[6] = ctx->b >> 16;
result[7] = ctx->b >> 24;
result[8] = ctx->c;
result[9] = ctx->c >> 8;
result[10] = ctx->c >> 16;
result[11] = ctx->c >> 24;
result[12] = ctx->d;
result[13] = ctx->d >> 8;
result[14] = ctx->d >> 16;
result[15] = ctx->d >> 24;
OUT(&result[0], ctx->a)
OUT(&result[4], ctx->b)
OUT(&result[8], ctx->c)
OUT(&result[12], ctx->d)
memset(ctx, 0, sizeof(*ctx));
}
+11 -1
View File
@@ -1127,7 +1127,7 @@
propid = ft_hash_str_lookup( name, &(font->proptbl) );
}
/* Allocate another property if this is overflow. */
/* Allocate another property if this is overflowing. */
if ( font->props_used == font->props_size )
{
if ( font->props_size == 0 )
@@ -1976,8 +1976,18 @@
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
if ( error )
goto Exit;
/* at this point, `p->font' can't be NULL */
p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1] );
/* We need at least 4 bytes per property. */
if ( p->cnt > p->size / 4 )
{
p->font->props_size = 0;
FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG5, lineno, "STARTPROPERTIES" ));
error = FT_THROW( Invalid_Argument );
goto Exit;
}
if ( FT_NEW_ARRAY( p->font->props, p->cnt ) )
{
+1 -1
View File
@@ -325,7 +325,7 @@ FT_BEGIN_HEADER
break; \
\
_try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
if ( _try_done > 0 && ( list_changed ) ) \
if ( _try_done > 0 && ( list_changed != NULL ) ) \
*(FT_Bool*)( list_changed ) = TRUE; \
\
if ( _try_done == 0 ) \
-3
View File
@@ -259,9 +259,6 @@
return 0;
}
if ( !face_id )
return 0;
query.face_id = face_id;
query.cmap_index = (FT_UInt)cmap_index;
query.char_code = char_code;
+2 -2
View File
@@ -314,7 +314,7 @@
FTC_MruNode mrunode;
if ( !aface || !face_id )
if ( !aface )
return FT_THROW( Invalid_Argument );
*aface = NULL;
@@ -672,7 +672,7 @@
FT_UInt nn;
if ( !manager || !face_id )
if ( !manager )
return;
/* this will remove all FTC_SizeNode that correspond to
+1 -1
View File
@@ -185,7 +185,7 @@ FT_BEGIN_HEADER
} \
_node = _node->next; \
\
} while ( _node != _first) ; \
} while ( _node != _first); \
} \
\
error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \
+1 -1
View File
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
* Upon a function call if the error code is anything other than
* `FT_Err_Ok', which is guaranteed to be zero, we
* will return without altering that error. This will allow the
* error to propogate and be handled at the appropriate location in
* error to propagate and be handled at the appropriate location in
* the code.
*
* This allows a style of code where the error code is initialized
+1 -1
View File
@@ -220,7 +220,7 @@ FT_BEGIN_HEADER
/* character space miter limit threshold */
CF2_Fixed miterLimit;
/* vertical/horzizontal snap distance in character space */
/* vertical/horizontal snap distance in character space */
CF2_Fixed snapThreshold;
FT_Vector offsetStart0; /* first and second points of first */
+6 -4
View File
@@ -701,12 +701,14 @@
FT_UInt* hinting_engine = (FT_UInt*)value;
#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
if ( *hinting_engine != FT_CFF_HINTING_ADOBE )
error = FT_ERR( Unimplemented_Feature );
else
if ( *hinting_engine == FT_CFF_HINTING_ADOBE
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|| *hinting_engine == FT_CFF_HINTING_FREETYPE
#endif
)
driver->hinting_engine = *hinting_engine;
else
error = FT_ERR( Unimplemented_Feature );
return error;
}
+119 -14
View File
@@ -680,7 +680,7 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
CFF_Font cff = (CFF_Font)(face->extra.data);
CFF_Font cff = (CFF_Font)(face->extra.data);
return cff_index_access_element( &cff->charstrings_index, glyph_index,
@@ -826,7 +826,7 @@
/* the seac operator must not be nested */
decoder->seac = TRUE;
error = cff_decoder_parse_charstrings( decoder, charstring,
charstring_len );
charstring_len, 0 );
decoder->seac = FALSE;
cff_free_glyph_data( face, &charstring, charstring_len );
@@ -856,7 +856,7 @@
/* the seac operator must not be nested */
decoder->seac = TRUE;
error = cff_decoder_parse_charstrings( decoder, charstring,
charstring_len );
charstring_len, 0 );
decoder->seac = FALSE;
cff_free_glyph_data( face, &charstring, charstring_len );
@@ -895,13 +895,17 @@
/* */
/* charstring_len :: The length in bytes of the charstring stream. */
/* */
/* in_dict :: Set to 1 if function is called from top or */
/* private DICT (needed for Multiple Master CFFs). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len )
FT_ULong charstring_len,
FT_Bool in_dict )
{
FT_Error error;
CFF_Decoder_Zone* zone;
@@ -913,6 +917,10 @@
FT_Fixed* stack;
FT_Int charstring_type =
decoder->cff->top_font.font_dict.charstring_type;
FT_UShort num_designs =
decoder->cff->top_font.font_dict.num_designs;
FT_UShort num_axes =
decoder->cff->top_font.font_dict.num_axes;
T2_Hints_Funcs hinter;
@@ -1241,6 +1249,44 @@
if ( op == cff_op_unknown )
continue;
/* in Multiple Master CFFs, T2 charstrings can appear in */
/* dictionaries, but some operators are prohibited */
if ( in_dict )
{
switch ( op )
{
case cff_op_hstem:
case cff_op_vstem:
case cff_op_vmoveto:
case cff_op_rlineto:
case cff_op_hlineto:
case cff_op_vlineto:
case cff_op_rrcurveto:
case cff_op_hstemhm:
case cff_op_hintmask:
case cff_op_cntrmask:
case cff_op_rmoveto:
case cff_op_hmoveto:
case cff_op_vstemhm:
case cff_op_rcurveline:
case cff_op_rlinecurve:
case cff_op_vvcurveto:
case cff_op_hhcurveto:
case cff_op_vhcurveto:
case cff_op_hvcurveto:
case cff_op_hflex:
case cff_op_flex:
case cff_op_hflex1:
case cff_op_flex1:
case cff_op_callsubr:
case cff_op_callgsubr:
goto MM_Error;
default:
break;
}
}
/* check arguments */
req_args = cff_argument_counts[op];
if ( req_args & CFF_COUNT_CHECK_WIDTH )
@@ -1278,7 +1324,9 @@
case cff_op_endchar:
/* If there is a width specified for endchar, we either have */
/* 1 argument or 5 arguments. We like to argue. */
set_width_ok = ( num_args == 5 ) || ( num_args == 1 );
set_width_ok = in_dict
? 0
: ( ( num_args == 5 ) || ( num_args == 1 ) );
break;
default:
@@ -1971,6 +2019,10 @@
return error;
case cff_op_endchar:
/* in dictionaries, `endchar' simply indicates end of data */
if ( in_dict )
return error;
FT_TRACE4(( " endchar\n" ));
/* We are going to emulate the seac operator. */
@@ -2198,6 +2250,10 @@
FT_TRACE4(( " put\n" ));
/* the Type2 specification before version 16-March-2000 */
/* didn't give a hard-coded size limit of the temporary */
/* storage array; instead, an argument of the */
/* `MultipleMaster' operator set the size */
if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
decoder->buildchar[idx] = val;
}
@@ -2222,23 +2278,66 @@
case cff_op_store:
/* this operator was removed from the Type2 specification */
/* in version 16-March-2000 */
FT_TRACE4(( " store\n"));
goto Unimplemented;
/* since we currently don't handle interpolation of multiple */
/* master fonts, this is a no-op */
FT_TRACE4(( " store\n"));
break;
case cff_op_load:
/* this operator was removed from the Type2 specification */
/* in version 16-March-2000 */
FT_TRACE4(( " load\n" ));
{
FT_Int reg_idx = (FT_Int)args[0];
FT_Int idx = (FT_Int)args[1];
FT_Int count = (FT_Int)args[2];
goto Unimplemented;
FT_TRACE4(( " load\n" ));
/* since we currently don't handle interpolation of multiple */
/* master fonts, we store a vector [1 0 0 ...] in the */
/* temporary storage array regardless of the Registry index */
if ( reg_idx >= 0 && reg_idx <= 2 &&
idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS &&
count >= 0 && count <= num_axes )
{
FT_Int end, i;
end = FT_MIN( idx + count, CFF_MAX_TRANS_ELEMENTS );
if ( idx < end )
decoder->buildchar[idx] = 1 << 16;
for ( i = idx + 1; i < end; i++ )
decoder->buildchar[i] = 0;
}
}
break;
case cff_op_blend:
/* this operator was removed from the Type2 specification */
/* in version 16-March-2000 */
FT_TRACE4(( " blend\n" ));
{
FT_Int num_results = (FT_Int)( args[0] >> 16 );
goto Unimplemented;
FT_TRACE4(( " blend\n" ));
if ( num_results < 0 )
goto Syntax_Error;
if ( num_results * (FT_Int)num_designs > num_args )
goto Stack_Underflow;
/* since we currently don't handle interpolation of multiple */
/* master fonts, return the `num_results' values of the */
/* first master */
args -= num_results * ( num_designs - 1 );
num_args -= num_results * ( num_designs - 1 );
}
break;
case cff_op_dotsection:
/* this operator is deprecated and ignored by the parser */
@@ -2511,7 +2610,6 @@
break;
default:
Unimplemented:
FT_ERROR(( "Unimplemented opcode: %d", ip[-1] ));
if ( ip[-1] == 12 )
@@ -2535,6 +2633,11 @@
Fail:
return error;
MM_Error:
FT_TRACE4(( "cff_decoder_parse_charstrings:"
" invalid opcode found in top DICT charstring\n"));
return FT_THROW( Invalid_File_Format );
Syntax_Error:
FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error\n" ));
return FT_THROW( Invalid_File_Format );
@@ -2608,7 +2711,8 @@
if ( !error )
error = cff_decoder_parse_charstrings( &decoder,
charstring,
charstring_len );
charstring_len,
0 );
cff_free_glyph_data( face, &charstring, &charstring_len );
}
@@ -2859,7 +2963,8 @@
if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )
error = cff_decoder_parse_charstrings( &decoder,
charstring,
charstring_len );
charstring_len,
0 );
else
#endif
{
+2 -1
View File
@@ -227,7 +227,8 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len );
FT_ULong charstring_len,
FT_Bool in_dict );
#endif
FT_LOCAL( FT_Error )
+33 -17
View File
@@ -382,13 +382,15 @@
static FT_Error
cff_index_get_pointers( CFF_Index idx,
FT_Byte*** table,
FT_Byte** pool )
FT_Byte** pool,
FT_ULong* pool_size )
{
FT_Error error = FT_Err_Ok;
FT_Memory memory = idx->stream->memory;
FT_Byte** t = NULL;
FT_Byte* new_bytes = NULL;
FT_ULong new_size;
*table = NULL;
@@ -400,10 +402,11 @@
goto Exit;
}
if ( idx->count > 0 &&
!FT_NEW_ARRAY( t, idx->count + 1 ) &&
( !pool || !FT_ALLOC( new_bytes,
idx->data_size + idx->count ) ) )
new_size = idx->data_size + idx->count;
if ( idx->count > 0 &&
!FT_NEW_ARRAY( t, idx->count + 1 ) &&
( !pool || !FT_ALLOC( new_bytes, new_size ) ) )
{
FT_ULong n, cur_offset;
FT_ULong extra = 0;
@@ -459,6 +462,8 @@
if ( pool )
*pool = new_bytes;
if ( pool_size )
*pool_size = new_size;
}
Exit:
@@ -809,7 +814,7 @@
/* When multiple GIDs map to the same CID, we choose the lowest */
/* GID. This is not described in any spec, but it matches the */
/* behaviour of recent Acroread versions. */
for ( j = (FT_Long)num_glyphs - 1; j >= 0 ; j-- )
for ( j = (FT_Long)num_glyphs - 1; j >= 0; j-- )
charset->cids[charset->sids[j]] = (FT_UShort)j;
charset->max_cid = max_cid;
@@ -871,8 +876,8 @@
FT_UShort glyph_sid;
/* If the the offset is greater than 2, we have to parse the */
/* charset table. */
/* If the offset is greater than 2, we have to parse the charset */
/* table. */
if ( offset > 2 )
{
FT_UInt j;
@@ -1316,7 +1321,12 @@
CFF_Private priv = &font->private_dict;
cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict, library );
cff_parser_init( &parser,
CFF_CODE_TOPDICT,
&font->font_dict,
library,
0,
0 );
/* set defaults */
FT_MEM_ZERO( top, sizeof ( *top ) );
@@ -1370,7 +1380,12 @@
priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );
cff_parser_init( &parser, CFF_CODE_PRIVATE, priv, library );
cff_parser_init( &parser,
CFF_CODE_PRIVATE,
priv,
library,
top->num_designs,
top->num_axes );
if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||
FT_FRAME_ENTER( font->font_dict.private_size ) )
@@ -1400,7 +1415,7 @@
goto Exit;
error = cff_index_get_pointers( &font->local_subrs_index,
&font->local_subrs, NULL );
&font->local_subrs, NULL, NULL );
if ( error )
goto Exit;
}
@@ -1478,16 +1493,17 @@
/* read the name, top dict, string and global subrs index */
if ( FT_SET_ERROR( cff_index_init( &font->name_index,
stream, 0 ) ) ||
stream, 0 ) ) ||
FT_SET_ERROR( cff_index_init( &font->font_dict_index,
stream, 0 ) ) ||
stream, 0 ) ) ||
FT_SET_ERROR( cff_index_init( &string_index,
stream, 1 ) ) ||
stream, 1 ) ) ||
FT_SET_ERROR( cff_index_init( &font->global_subrs_index,
stream, 1 ) ) ||
stream, 1 ) ) ||
FT_SET_ERROR( cff_index_get_pointers( &string_index,
&font->strings,
&font->string_pool ) ) )
&font->string_pool,
&font->string_pool_size ) ) )
goto Exit;
font->num_strings = string_index.count;
@@ -1614,7 +1630,7 @@
font->num_glyphs = font->charstrings_index.count;
error = cff_index_get_pointers( &font->global_subrs_index,
&font->global_subrs, NULL );
&font->global_subrs, NULL, NULL );
if ( error )
goto Exit;
+48 -8
View File
@@ -625,11 +625,44 @@
FT_TRACE4(( "SIDs\n" ));
/* dump string index, including default strings for convenience */
for ( idx = 0; idx < cff->num_strings + 390; idx++ )
for ( idx = 0; idx <= 390; idx++ )
{
s = cff_index_get_sid_string( cff, idx );
if ( s )
FT_TRACE4((" %5d %s\n", idx, s ));
FT_TRACE4(( " %5d %s\n", idx, s ));
}
/* In Multiple Master CFFs, two SIDs hold the Normalize Design */
/* Vector (NDV) and Convert Design Vector (CDV) charstrings, */
/* which may contain NULL bytes in the middle of the data, too. */
/* We thus access `cff->strings' directly. */
for ( idx = 1; idx < cff->num_strings; idx++ )
{
FT_Byte* s1 = cff->strings[idx - 1];
FT_Byte* s2 = cff->strings[idx];
FT_PtrDist s1len = s2 - s1 - 1; /* without the final NULL byte */
FT_PtrDist l;
FT_TRACE4(( " %5d ", idx + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));
}
/* print last element */
if ( cff->num_strings )
{
FT_Byte* s1 = cff->strings[cff->num_strings - 1];
FT_Byte* s2 = cff->string_pool + cff->string_pool_size;
FT_PtrDist s1len = s2 - s1 - 1;
FT_PtrDist l;
FT_TRACE4(( " %5d ", cff->num_strings + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));
}
}
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -637,10 +670,11 @@
if ( !dict->has_font_matrix )
dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
/* Normalize the font matrix so that `matrix->yy' is 1; the */
/* scaling is done with `units_per_em' then (at this point, */
/* it already contains the scaling factor, but without */
/* normalization of the matrix). */
/* Normalize the font matrix so that `matrix->yy' is 1; if */
/* it is zero, we use `matrix->yx' instead. The scaling is */
/* done with `units_per_em' then (at this point, it already */
/* contains the scaling factor, but without normalization */
/* of the matrix). */
/* */
/* Note that the offsets must be expressed in integer font */
/* units. */
@@ -649,9 +683,12 @@
FT_Matrix* matrix = &dict->font_matrix;
FT_Vector* offset = &dict->font_offset;
FT_ULong* upm = &dict->units_per_em;
FT_Fixed temp = FT_ABS( matrix->yy );
FT_Fixed temp;
temp = matrix->yy ? FT_ABS( matrix->yy )
: FT_ABS( matrix->yx );
if ( temp != 0x10000L )
{
*upm = (FT_ULong)FT_DivFix( (FT_Long)*upm, temp );
@@ -719,7 +756,10 @@
matrix = &sub->font_matrix;
offset = &sub->font_offset;
upm = &sub->units_per_em;
temp = FT_ABS( matrix->yy );
temp = matrix->yy ? FT_ABS( matrix->yy )
: FT_ABS( matrix->yx );
if ( temp != 0x10000L )
{
+249 -17
View File
@@ -23,6 +23,7 @@
#include "cfferrs.h"
#include "cffpic.h"
#include "cffgload.h"
/*************************************************************************/
@@ -39,7 +40,9 @@
cff_parser_init( CFF_Parser parser,
FT_UInt code,
void* object,
FT_Library library)
FT_Library library,
FT_UShort num_designs,
FT_UShort num_axes )
{
FT_MEM_ZERO( parser, sizeof ( *parser ) );
@@ -47,6 +50,8 @@
parser->object_code = code;
parser->object = object;
parser->library = library;
parser->num_designs = num_designs;
parser->num_axes = num_axes;
}
@@ -516,7 +521,11 @@
if ( parser->top >= parser->stack + 6 )
{
FT_Long scaling;
FT_Fixed values[6];
FT_Long scalings[6];
FT_Long min_scaling, max_scaling;
int i;
error = FT_Err_Ok;
@@ -525,22 +534,36 @@
/* We expect a well-formed font matrix, this is, the matrix elements */
/* `xx' and `yy' are of approximately the same magnitude. To avoid */
/* loss of precision, we use the magnitude of element `xx' to scale */
/* all other elements. The scaling factor is then contained in the */
/* `units_per_em' value. */
/* loss of precision, we use the magnitude of the largest matrix */
/* element to scale all other elements. The scaling factor is then */
/* contained in the `units_per_em' value. */
matrix->xx = cff_parse_fixed_dynamic( data++, &scaling );
max_scaling = FT_LONG_MIN;
min_scaling = FT_LONG_MAX;
scaling = -scaling;
for ( i = 0; i < 6; i++ )
{
values[i] = cff_parse_fixed_dynamic( data++, &scalings[i] );
if ( values[i] )
{
if ( scalings[i] > max_scaling )
max_scaling = scalings[i];
if ( scalings[i] < min_scaling )
min_scaling = scalings[i];
}
}
if ( scaling < 0 || scaling > 9 )
if ( max_scaling < -9 ||
max_scaling > 0 ||
( max_scaling - min_scaling ) < 0 ||
( max_scaling - min_scaling ) > 9 )
{
/* Return default matrix in case of unlikely values. */
FT_TRACE1(( "cff_parse_font_matrix:"
" strange scaling value for xx element (%d),\n"
" strange scaling values (minimum %d, maximum %d),\n"
" "
" using default matrix\n", scaling ));
" using default matrix\n", min_scaling, max_scaling ));
matrix->xx = 0x10000L;
matrix->yx = 0;
@@ -553,13 +576,42 @@
goto Exit;
}
matrix->yx = cff_parse_fixed_scaled( data++, scaling );
matrix->xy = cff_parse_fixed_scaled( data++, scaling );
matrix->yy = cff_parse_fixed_scaled( data++, scaling );
offset->x = cff_parse_fixed_scaled( data++, scaling );
offset->y = cff_parse_fixed_scaled( data, scaling );
for ( i = 0; i < 6; i++ )
{
FT_Fixed value = values[i];
FT_Long divisor, half_divisor;
*upm = (FT_ULong)power_tens[scaling];
if ( !value )
continue;
divisor = power_tens[max_scaling - scalings[i]];
half_divisor = divisor >> 1;
if ( value < 0 )
{
if ( FT_LONG_MIN + half_divisor < value )
values[i] = ( value - half_divisor ) / divisor;
else
values[i] = FT_LONG_MIN / divisor;
}
else
{
if ( FT_LONG_MAX - half_divisor > value )
values[i] = ( value + half_divisor ) / divisor;
else
values[i] = FT_LONG_MAX / divisor;
}
}
matrix->xx = values[0];
matrix->yx = values[1];
matrix->xy = values[2];
matrix->yy = values[3];
offset->x = values[4];
offset->y = values[5];
*upm = (FT_ULong)power_tens[-max_scaling];
FT_TRACE4(( " [%f %f %f %f %f %f]\n",
(double)matrix->xx / *upm / 65536,
@@ -649,6 +701,56 @@
}
/* The `MultipleMaster' operator comes before any */
/* top DICT operators that contain T2 charstrings. */
static FT_Error
cff_parse_multiple_master( CFF_Parser parser )
{
CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
FT_Error error;
#ifdef FT_DEBUG_LEVEL_TRACE
/* beautify tracing message */
if ( ft_trace_levels[FT_COMPONENT] < 4 )
FT_TRACE1(( "Multiple Master CFFs not supported yet,"
" handling first master design only\n" ));
else
FT_TRACE1(( " (not supported yet,"
" handling first master design only)\n" ));
#endif
error = FT_ERR( Stack_Underflow );
/* currently, we handle only the first argument */
if ( parser->top >= parser->stack + 5 )
{
FT_Long num_designs = cff_parse_num( parser->stack );
if ( num_designs > 16 || num_designs < 2 )
{
FT_ERROR(( "cff_parse_multiple_master:"
" Invalid number of designs\n" ));
error = FT_THROW( Invalid_File_Format );
}
else
{
dict->num_designs = (FT_UShort)num_designs;
dict->num_axes = (FT_UShort)( parser->top - parser->stack - 4 );
parser->num_designs = dict->num_designs;
parser->num_axes = dict->num_axes;
error = FT_Err_Ok;
}
}
return error;
}
static FT_Error
cff_parse_cid_ros( CFF_Parser parser )
{
@@ -972,7 +1074,7 @@
if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH )
goto Stack_Overflow;
*parser->top ++ = p;
*parser->top++ = p;
/* now, skip it */
if ( v == 30 )
@@ -1001,6 +1103,136 @@
else if ( v > 246 )
p += 1;
}
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
else if ( v == 31 )
{
/* a Type 2 charstring */
CFF_Decoder decoder;
CFF_FontRec cff_rec;
FT_Byte* charstring_base;
FT_ULong charstring_len;
FT_Fixed* stack;
FT_Byte* q;
charstring_base = ++p;
/* search `endchar' operator */
for (;;)
{
if ( p >= limit )
goto Exit;
if ( *p == 14 )
break;
p++;
}
charstring_len = (FT_ULong)( p - charstring_base ) + 1;
/* construct CFF_Decoder object */
FT_MEM_ZERO( &decoder, sizeof ( decoder ) );
FT_MEM_ZERO( &cff_rec, sizeof ( cff_rec ) );
cff_rec.top_font.font_dict.num_designs = parser->num_designs;
cff_rec.top_font.font_dict.num_axes = parser->num_axes;
decoder.cff = &cff_rec;
error = cff_decoder_parse_charstrings( &decoder,
charstring_base,
charstring_len,
1 );
/* Now copy the stack data in the temporary decoder object, */
/* converting it back to charstring number representations */
/* (this is ugly, I know). */
/* */
/* We overwrite the original top DICT charstring under the */
/* assumption that the charstring representation of the result */
/* of `cff_decoder_parse_charstrings' is shorter, which should */
/* be always true. */
q = charstring_base - 1;
stack = decoder.stack;
while ( stack < decoder.top )
{
FT_ULong num;
FT_Bool neg;
if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH )
goto Stack_Overflow;
*parser->top++ = q;
if ( *stack < 0 )
{
num = (FT_ULong)-*stack;
neg = 1;
}
else
{
num = (FT_ULong)*stack;
neg = 0;
}
if ( num & 0xFFFFU )
{
if ( neg )
num = (FT_ULong)-num;
*q++ = 255;
*q++ = ( num & 0xFF000000U ) >> 24;
*q++ = ( num & 0x00FF0000U ) >> 16;
*q++ = ( num & 0x0000FF00U ) >> 8;
*q++ = num & 0x000000FFU;
}
else
{
num >>= 16;
if ( neg )
{
if ( num <= 107 )
*q++ = (FT_Byte)( 139 - num );
else if ( num <= 1131 )
{
*q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 251 );
*q++ = (FT_Byte)( ( num - 108 ) & 0xFF );
}
else
{
num = (FT_ULong)-num;
*q++ = 28;
*q++ = (FT_Byte)( num >> 8 );
*q++ = (FT_Byte)( num & 0xFF );
}
}
else
{
if ( num <= 107 )
*q++ = (FT_Byte)( num + 139 );
else if ( num <= 1131 )
{
*q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 );
*q++ = (FT_Byte)( ( num - 108 ) & 0xFF );
}
else
{
*q++ = 28;
*q++ = (FT_Byte)( num >> 8 );
*q++ = (FT_Byte)( num & 0xFF );
}
}
}
stack++;
}
}
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
else
{
/* This is not a number, hence it's an operator. Compute its code */
+14 -9
View File
@@ -36,16 +36,19 @@ FT_BEGIN_HEADER
typedef struct CFF_ParserRec_
{
FT_Library library;
FT_Byte* start;
FT_Byte* limit;
FT_Byte* cursor;
FT_Library library;
FT_Byte* start;
FT_Byte* limit;
FT_Byte* cursor;
FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1];
FT_Byte** top;
FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1];
FT_Byte** top;
FT_UInt object_code;
void* object;
FT_UInt object_code;
void* object;
FT_UShort num_designs; /* a copy of `CFF_FontRecDict->num_designs' */
FT_UShort num_axes; /* a copy of `CFF_FontRecDict->num_axes' */
} CFF_ParserRec, *CFF_Parser;
@@ -54,7 +57,9 @@ FT_BEGIN_HEADER
cff_parser_init( CFF_Parser parser,
FT_UInt code,
void* object,
FT_Library library);
FT_Library library,
FT_UShort num_designs,
FT_UShort num_axes );
FT_LOCAL( FT_Error )
cff_parser_run( CFF_Parser parser,
+9 -1
View File
@@ -38,6 +38,9 @@
CFF_FIELD_NUM ( 13, unique_id, "UniqueID" )
CFF_FIELD_CALLBACK( 5, font_bbox, "FontBBox" )
CFF_FIELD_NUM ( 0x108, stroke_width, "StrokeWidth" )
#if 0
CFF_FIELD_DELTA ( 14, xuid, 16, "XUID" )
#endif
CFF_FIELD_NUM ( 15, charset_offset, "charset" )
CFF_FIELD_NUM ( 16, encoding_offset, "Encoding" )
CFF_FIELD_NUM ( 17, charstrings_offset, "CharStrings" )
@@ -48,8 +51,13 @@
#if 0
CFF_FIELD_STRING ( 0x116, base_font_name, "BaseFontName" )
CFF_FIELD_DELTA ( 0x117, base_font_blend, 16, "BaseFontBlend" )
#endif
/* the next two operators were removed from the Type2 specification */
/* in version 16-March-2000 */
CFF_FIELD_CALLBACK( 0x118, multiple_master, "MultipleMaster" )
CFF_FIELD_CALLBACK( 0x119, blend_axis_types, "BlendAxisTypes" )
#if 0
CFF_FIELD_CALLBACK( 0x11A, blend_axis_types, "BlendAxisTypes" )
#endif
CFF_FIELD_CALLBACK( 0x11E, cid_ros, "ROS" )
+7
View File
@@ -145,6 +145,12 @@ FT_BEGIN_HEADER
FT_ULong cid_fd_select_offset;
FT_UInt cid_font_name;
/* the next fields come from the data of the deprecated */
/* `MultipleMaster' operator; they are needed to parse the (also */
/* deprecated) `blend' operator in Type 2 charstrings */
FT_UShort num_designs;
FT_UShort num_axes;
} CFF_FontRecDictRec, *CFF_FontRecDict;
@@ -250,6 +256,7 @@ FT_BEGIN_HEADER
FT_UInt num_strings;
FT_Byte** strings;
FT_Byte* string_pool;
FT_ULong string_pool_size;
CFF_SubFontRec top_font;
FT_UInt num_subfonts;
+76 -33
View File
@@ -47,6 +47,12 @@
/*************************************************************************/
#define STARTDATA "StartData"
#define STARTDATA_LEN ( sizeof ( STARTDATA ) - 1 )
#define SFNTS "/sfnts"
#define SFNTS_LEN ( sizeof ( SFNTS ) - 1 )
FT_LOCAL_DEF( FT_Error )
cid_parser_new( CID_Parser* parser,
FT_Stream stream,
@@ -85,9 +91,29 @@
/* now, read the rest of the file until we find */
/* `StartData' or `/sfnts' */
{
FT_Byte buffer[256 + 10];
FT_ULong read_len = 256 + 10;
FT_Byte* p = buffer;
/*
* The algorithm is as follows (omitting the case with less than 256
* bytes to fill for simplicity).
*
* 1. Fill the buffer with 256 + STARTDATA_LEN bytes.
*
* 2. Search for the STARTDATA and SFNTS strings at positions
* buffer[0], buffer[1], ...,
* buffer[255 + STARTDATA_LEN - SFNTS_LEN].
*
* 3. Move the last STARTDATA_LEN bytes to buffer[0].
*
* 4. Fill the buffer with 256 bytes, starting at STARTDATA_LEN.
*
* 5. Repeat with step 2.
*
*/
FT_Byte buffer[256 + STARTDATA_LEN + 1];
/* values for the first loop */
FT_ULong read_len = 256 + STARTDATA_LEN;
FT_ULong read_offset = 0;
FT_Byte* p = buffer;
for ( offset = FT_STREAM_POS(); ; offset += 256 )
@@ -96,40 +122,48 @@
stream_len = stream->size - FT_STREAM_POS();
if ( stream_len == 0 )
read_len = FT_MIN( read_len, stream_len );
if ( FT_STREAM_READ( p, read_len ) )
goto Exit;
/* ensure that we do not compare with data beyond the buffer */
p[read_len] = '\0';
limit = p + read_len - SFNTS_LEN;
for ( p = buffer; p < limit; p++ )
{
if ( p[0] == 'S' &&
ft_strncmp( (char*)p, STARTDATA, STARTDATA_LEN ) == 0 )
{
/* save offset of binary data after `StartData' */
offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN;
goto Found;
}
else if ( p[1] == 's' &&
ft_strncmp( (char*)p, SFNTS, SFNTS_LEN ) == 0 )
{
offset += (FT_ULong)( p - buffer ) + SFNTS_LEN;
goto Found;
}
}
if ( read_offset + read_len < STARTDATA_LEN )
{
FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
read_len = FT_MIN( read_len, stream_len );
if ( FT_STREAM_READ( p, read_len ) )
goto Exit;
FT_MEM_MOVE( buffer,
buffer + read_offset + read_len - STARTDATA_LEN,
STARTDATA_LEN );
if ( read_len < 256 )
p[read_len] = '\0';
limit = p + read_len - 10;
for ( p = buffer; p < limit; p++ )
{
if ( p[0] == 'S' && ft_strncmp( (char*)p, "StartData", 9 ) == 0 )
{
/* save offset of binary data after `StartData' */
offset += (FT_ULong)( p - buffer + 10 );
goto Found;
}
else if ( p[1] == 's' && ft_strncmp( (char*)p, "/sfnts", 6 ) == 0 )
{
offset += (FT_ULong)( p - buffer + 7 );
goto Found;
}
}
FT_MEM_MOVE( buffer, p, 10 );
read_len = 256;
p = buffer + 10;
/* values for the next loop */
read_len = 256;
read_offset = STARTDATA_LEN;
p = buffer + read_offset;
}
}
@@ -165,7 +199,7 @@
limit = parser->root.limit;
cur = parser->root.cursor;
while ( cur < limit )
while ( cur < limit - SFNTS_LEN )
{
if ( parser->root.error )
{
@@ -173,7 +207,9 @@
goto Exit;
}
if ( cur[0] == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 )
if ( cur[0] == 'S' &&
cur < limit - STARTDATA_LEN &&
ft_strncmp( (char*)cur, STARTDATA, STARTDATA_LEN ) == 0 )
{
if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 )
{
@@ -191,7 +227,8 @@
goto Exit;
}
else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 )
else if ( cur[1] == 's' &&
ft_strncmp( (char*)cur, SFNTS, SFNTS_LEN ) == 0 )
{
FT_TRACE2(( "cid_parser_new: cannot handle Type 11 fonts\n" ));
error = FT_THROW( Unknown_File_Format );
@@ -216,6 +253,12 @@
}
#undef STARTDATA
#undef STARTDATA_LEN
#undef SFNTS
#undef SFNTS_LEN
FT_LOCAL_DEF( void )
cid_parser_done( CID_Parser* parser )
{
+2 -2
View File
@@ -900,7 +900,7 @@
for ( i = 0; i < nnames; i++ )
{
if ( FT_Get_Sfnt_Name( gxvalid->face, i, &name ) != FT_Err_Ok )
continue ;
continue;
if ( name.name_id == name_index )
goto Out;
@@ -1472,7 +1472,7 @@
if ( ( p + ( maxEntry + 1 ) * entrySize ) > limit )
FT_INVALID_TOO_SHORT;
for (entry = 0; entry <= maxEntry ; entry++ )
for (entry = 0; entry <= maxEntry; entry++ )
{
FT_UShort newState_idx;
FT_UShort flags;
+3 -3
View File
@@ -338,7 +338,7 @@ FT_BEGIN_HEADER
\
\
for ( b = p; b < (FT_Bytes)p + len; b++ ) \
FT_TRACE1(("\\x%02x", *b)) ; \
FT_TRACE1(("\\x%02x", *b)); \
} \
FT_END_STMNT
@@ -350,9 +350,9 @@ FT_BEGIN_HEADER
\
for ( b = p; b < (FT_Bytes)p + len; b++ ) \
if ( 0x40 < *b && *b < 0x7E ) \
FT_TRACE1(("%c", *b)) ; \
FT_TRACE1(("%c", *b)); \
else \
FT_TRACE1(("\\x%02x", *b)) ; \
FT_TRACE1(("\\x%02x", *b)); \
} \
FT_END_STMNT
+1 -1
View File
@@ -152,7 +152,7 @@
FT_Bytes limit,
GXV_Validator gxvalid )
{
FT_Bytes p = table ;
FT_Bytes p = table;
FT_Bytes wdc_end = table + GXV_JUST_DATA( wdc_offset_max );
FT_UInt i;
+2 -2
View File
@@ -693,7 +693,7 @@
GXV_NAME_ENTER( "validating coverage" );
GXV_TRACE(( "interprete coverage 0x%04x by Apple style\n", coverage ));
GXV_TRACE(( "interpret coverage 0x%04x by Apple style\n", coverage ));
if ( KERN_IS_NEW( gxvalid ) )
{
@@ -728,7 +728,7 @@
}
}
GXV_TRACE(( "cannot interprete coverage, broken kern subtable\n" ));
GXV_TRACE(( "cannot interpret coverage, broken kern subtable\n" ));
Exit:
GXV_EXIT;
+1 -1
View File
@@ -114,7 +114,7 @@
+------ lcar --------------------+
| |
| +===============+ |
| | looup header | |
| | lookup header | |
| +===============+ |
| | BinSrchHeader | |
| +===============+ |
+1 -1
View File
@@ -192,7 +192,7 @@
GXV_NAME_ENTER( "validating contents of substitutionTable" );
for ( i = 0; i < num_gids ; i ++ )
for ( i = 0; i < num_gids; i++ )
{
FT_UShort dst_gid;
+2 -2
View File
@@ -111,7 +111,7 @@
GXV_LIMIT_CHECK( nTracks * ( 4 + 2 + 2 ) );
for ( i = 0; i < nTracks; i ++ )
for ( i = 0; i < nTracks; i++ )
{
p = table + i * ( 4 + 2 + 2 );
track = FT_NEXT_LONG( p );
@@ -125,7 +125,7 @@
gxv_sfntName_validate( nameIndex, 256, 32767, gxvalid );
for ( j = i; j < nTracks; j ++ )
for ( j = i; j < nTracks; j++ )
{
p = table + j * ( 4 + 2 + 2 );
t = FT_NEXT_LONG( p );
+1 -1
View File
@@ -59,7 +59,7 @@
/* original ZLib. */
#ifndef USE_ZLIB_ZCALLOC
#define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutils.c */
#define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutil.c */
#endif
#include "zlib.h"
+1 -1
View File
@@ -560,7 +560,7 @@ ZEXTERN(int) inflateInit2 OF((z_streamp strm,
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no flush point has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
case, the application may save the current value of total_in which
indicates where valid compressed data was found. In the error case, the
application may repeatedly call inflateSync, providing more input each time,
until success or end of the input data.
+1 -1
View File
@@ -88,7 +88,7 @@
FT_Int isItalic )
{
FT_Bytes p = table;
FT_UInt i, cnt, table_size ;
FT_UInt i, cnt, table_size;
OTV_OPTIONAL_TABLE( Coverage );
OTV_OPTIONAL_TABLE( DeviceTableOffset );
+10 -6
View File
@@ -442,7 +442,7 @@ THE SOFTWARE.
int i;
for ( i = 0 ; i < face->nprops && !found; i++ )
for ( i = 0; i < face->nprops && !found; i++ )
{
if ( !ft_strcmp( properties[i].name, prop ) )
found = 1;
@@ -849,7 +849,7 @@ THE SOFTWARE.
int firstCol, lastCol;
int firstRow, lastRow;
FT_ULong nencoding;
int encodingOffset;
FT_UShort encodingOffset;
int i, j;
FT_ULong k;
PCF_Encoding encoding = NULL;
@@ -921,15 +921,19 @@ THE SOFTWARE.
{
for ( j = firstCol; j <= lastCol; j++ )
{
/* X11's reference implementation uses the equivalent to */
/* `FT_GET_SHORT', however PCF fonts with more than 32768 */
/* characters (e.g. `unifont.pcf') clearly show that an */
/* unsigned value is needed. */
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
encodingOffset = FT_GET_SHORT();
encodingOffset = FT_GET_USHORT();
else
encodingOffset = FT_GET_SHORT_LE();
encodingOffset = FT_GET_USHORT_LE();
if ( encodingOffset > -1 )
if ( encodingOffset != 0xFFFFU )
{
encoding[k].enc = i * 256 + j;
encoding[k].glyph = (FT_UShort)encodingOffset;
encoding[k].glyph = encodingOffset;
FT_TRACE5(( " code %d (0x%04X): idx %d\n",
encoding[k].enc, encoding[k].enc, encoding[k].glyph ));
+2 -2
View File
@@ -336,7 +336,7 @@
/* XXX: we ignore the secondary stroke and edge definitions */
/* since we don't support native PFR hinting */
/* */
if ( flags & PFR_GLYPH_EXTRA_ITEMS )
if ( flags & PFR_GLYPH_SINGLE_EXTRA_ITEMS )
{
error = pfr_extra_items_skip( &p, limit );
if ( error )
@@ -579,7 +579,7 @@
/* ignore extra items when present */
/* */
if ( flags & PFR_GLYPH_EXTRA_ITEMS )
if ( flags & PFR_GLYPH_COMPOUND_EXTRA_ITEMS )
{
error = pfr_extra_items_skip( &p, limit );
if ( error )
+16 -7
View File
@@ -299,9 +299,15 @@
FT_READ_USHORT( count ) )
goto Exit;
/* check maximum value and a rough minimum size */
/* check maximum value and a rough minimum size: */
/* - no more than 13106 log fonts */
/* - we need 5 bytes for a log header record */
/* - we need at least 18 bytes for a log font record */
/* - the overall size is at least 95 bytes plus the */
/* log header and log font records */
if ( count > ( ( 1 << 16 ) - 2 ) / 5 ||
2 + count * 5 >= stream->size - section_offset )
2 + count * 5 >= stream->size - section_offset ||
95 + count * ( 5 + 18 ) >= stream->size )
{
FT_ERROR(( "pfr_log_font_count:"
" invalid number of logical fonts\n" ));
@@ -377,7 +383,7 @@
if ( flags & PFR_LOG_2BYTE_STROKE )
local++;
if ( (flags & PFR_LINE_JOIN_MASK) == PFR_LINE_JOIN_MITER )
if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER )
local += 3;
}
if ( flags & PFR_LOG_BOLD )
@@ -609,7 +615,7 @@
Too_Short:
error = FT_THROW( Invalid_Table );
FT_ERROR(( "pfr_exta_item_load_stem_snaps:"
FT_ERROR(( "pfr_extra_item_load_stem_snaps:"
" invalid stem snaps table\n" ));
goto Exit;
}
@@ -737,12 +743,14 @@
FT_UInt n, ok;
if ( *astring )
FT_FREE( *astring );
if ( len > 0 && p[len - 1] == 0 )
len--;
/* check that each character is ASCII for making sure not to
load garbage
*/
/* check that each character is ASCII */
/* for making sure not to load garbage */
ok = ( len > 0 );
for ( n = 0; n < len; n++ )
if ( p[n] < 32 || p[n] > 127 )
@@ -759,6 +767,7 @@
FT_MEM_COPY( result, p, len );
result[len] = 0;
}
Exit:
*astring = result;
return error;
+2 -2
View File
@@ -524,8 +524,8 @@
FT_UInt probe = power * size;
FT_UInt extra = count - power;
FT_Byte* base = stream->cursor;
FT_Bool twobytes = FT_BOOL( item->flags & 1 );
FT_Bool twobyte_adj = FT_BOOL( item->flags & 2 );
FT_Bool twobytes = FT_BOOL( item->flags & PFR_KERN_2BYTE_CHAR );
FT_Bool twobyte_adj = FT_BOOL( item->flags & PFR_KERN_2BYTE_ADJ );
FT_Byte* p;
FT_UInt32 cpair;
+94 -38
View File
@@ -277,49 +277,99 @@
pfr_lookup_bitmap_data( FT_Byte* base,
FT_Byte* limit,
FT_UInt count,
FT_UInt flags,
FT_UInt* flags,
FT_UInt char_code,
FT_ULong* found_offset,
FT_ULong* found_size )
{
FT_UInt left, right, char_len;
FT_Bool two = FT_BOOL( flags & 1 );
FT_UInt min, max, char_len;
FT_Bool two = FT_BOOL( *flags & PFR_BITMAP_2BYTE_CHARCODE );
FT_Byte* buff;
char_len = 4;
if ( two ) char_len += 1;
if ( flags & 2 ) char_len += 1;
if ( flags & 4 ) char_len += 1;
if ( two )
char_len += 1;
if ( *flags & PFR_BITMAP_2BYTE_SIZE )
char_len += 1;
if ( *flags & PFR_BITMAP_3BYTE_OFFSET )
char_len += 1;
left = 0;
right = count;
while ( left < right )
if ( !( *flags & PFR_BITMAP_CHARCODES_VALIDATED ) )
{
FT_UInt middle, code;
FT_Byte* p;
FT_Byte* lim;
FT_UInt code;
FT_Long prev_code;
middle = ( left + right ) >> 1;
buff = base + middle * char_len;
*flags |= PFR_BITMAP_VALID_CHARCODES;
prev_code = -1;
lim = base + count * char_len;
/* check that we are not outside of the table -- */
/* this is possible with broken fonts... */
if ( buff + char_len > limit )
goto Fail;
if ( lim > limit )
{
FT_TRACE0(( "pfr_lookup_bitmap_data:"
" number of bitmap records too large,\n"
" "
" thus ignoring all bitmaps in this strike\n" ));
*flags &= ~PFR_BITMAP_VALID_CHARCODES;
}
else
{
/* check whether records are sorted by code */
for ( p = base; p < lim; p += char_len )
{
if ( two )
code = FT_PEEK_USHORT( p );
else
code = *p;
if ( (FT_Long)code <= prev_code )
{
FT_TRACE0(( "pfr_lookup_bitmap_data:"
" bitmap records are not sorted,\n"
" "
" thus ignoring all bitmaps in this strike\n" ));
*flags &= ~PFR_BITMAP_VALID_CHARCODES;
break;
}
prev_code = code;
}
}
*flags |= PFR_BITMAP_CHARCODES_VALIDATED;
}
/* ignore bitmaps in case table is not valid */
/* (this might be sanitized, but PFR is dead...) */
if ( !( *flags & PFR_BITMAP_VALID_CHARCODES ) )
goto Fail;
min = 0;
max = count;
/* binary search */
while ( min < max )
{
FT_UInt mid, code;
mid = ( min + max ) >> 1;
buff = base + mid * char_len;
if ( two )
code = PFR_NEXT_USHORT( buff );
else
code = PFR_NEXT_BYTE( buff );
if ( code == char_code )
goto Found_It;
if ( code < char_code )
left = middle;
if ( char_code < code )
max = mid;
else if ( char_code > code )
min = mid + 1;
else
right = middle;
goto Found_It;
}
Fail:
@@ -329,12 +379,12 @@
return;
Found_It:
if ( flags & 2 )
if ( *flags & PFR_BITMAP_2BYTE_SIZE )
*found_size = PFR_NEXT_USHORT( buff );
else
*found_size = PFR_NEXT_BYTE( buff );
if ( flags & 4 )
if ( *flags & PFR_BITMAP_3BYTE_OFFSET )
*found_offset = PFR_NEXT_ULONG( buff );
else
*found_offset = PFR_NEXT_USHORT( buff );
@@ -357,7 +407,6 @@
{
FT_Error error = FT_Err_Ok;
FT_Byte flags;
FT_Char c;
FT_Byte b;
FT_Byte* p = *pdata;
FT_Long xpos, ypos, advance;
@@ -377,9 +426,9 @@
{
case 0:
PFR_CHECK( 1 );
c = PFR_NEXT_INT8( p );
xpos = c >> 4;
ypos = ( (FT_Char)( c << 4 ) ) >> 4;
b = PFR_NEXT_BYTE( p );
xpos = (FT_Char)b >> 4;
ypos = ( (FT_Char)( b << 4 ) ) >> 4;
break;
case 1:
@@ -445,7 +494,7 @@
case 1:
PFR_CHECK( 1 );
advance = PFR_NEXT_INT8( p ) << 8;
advance = PFR_NEXT_INT8( p ) * 256;
break;
case 2:
@@ -571,9 +620,12 @@
char_len = 4;
if ( strike->flags & 1 ) char_len += 1;
if ( strike->flags & 2 ) char_len += 1;
if ( strike->flags & 4 ) char_len += 1;
if ( strike->flags & PFR_BITMAP_2BYTE_CHARCODE )
char_len += 1;
if ( strike->flags & PFR_BITMAP_2BYTE_SIZE )
char_len += 1;
if ( strike->flags & PFR_BITMAP_3BYTE_OFFSET )
char_len += 1;
/* access data directly in the frame to speed lookups */
if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) ||
@@ -583,7 +635,7 @@
pfr_lookup_bitmap_data( stream->cursor,
stream->limit,
strike->num_bitmaps,
strike->flags,
&strike->flags,
character->char_code,
&gps_offset,
&gps_size );
@@ -630,6 +682,8 @@
&xpos, &ypos,
&xsize, &ysize,
&advance, &format );
if ( error )
goto Exit1;
/*
* Before allocating the target bitmap, we check whether the given
@@ -675,7 +729,7 @@
{
if ( FT_ERR_EQ( error, Invalid_Table ) )
FT_ERROR(( "pfr_slot_load_bitmap: invalid bitmap dimensions\n" ));
goto Exit;
goto Exit1;
}
/*
@@ -710,8 +764,8 @@
/* XXX: needs casts to fit FT_Glyph_Metrics.{width|height} */
glyph->root.metrics.width = (FT_Pos)xsize << 6;
glyph->root.metrics.height = (FT_Pos)ysize << 6;
glyph->root.metrics.horiBearingX = xpos << 6;
glyph->root.metrics.horiBearingY = ypos << 6;
glyph->root.metrics.horiBearingX = xpos * 64;
glyph->root.metrics.horiBearingY = ypos * 64;
glyph->root.metrics.horiAdvance = FT_PIX_ROUND( ( advance >> 2 ) );
glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1;
glyph->root.metrics.vertBearingY = 0;
@@ -732,11 +786,13 @@
p,
stream->limit,
format,
FT_BOOL(face->header.color_flags & 2),
FT_BOOL( face->header.color_flags &
PFR_FLAG_INVERT_BITMAP ),
&glyph->root.bitmap );
}
}
Exit1:
FT_FRAME_EXIT();
}
+42 -72
View File
@@ -69,12 +69,8 @@ FT_BEGIN_HEADER
/* used in `color_flags' field of the PFR_Header */
typedef enum PFR_HeaderFlags_
{
PFR_FLAG_BLACK_PIXEL = 1,
PFR_FLAG_INVERT_BITMAP = 2
} PFR_HeaderFlags;
#define PFR_FLAG_BLACK_PIXEL 0x01U
#define PFR_FLAG_INVERT_BITMAP 0x02U
/************************************************************************/
@@ -96,36 +92,27 @@ FT_BEGIN_HEADER
} PFR_LogFontRec, *PFR_LogFont;
typedef enum PFR_LogFlags_
{
PFR_LOG_EXTRA_ITEMS = 0x40,
PFR_LOG_2BYTE_BOLD = 0x20,
PFR_LOG_BOLD = 0x10,
PFR_LOG_2BYTE_STROKE = 8,
PFR_LOG_STROKE = 4,
PFR_LINE_JOIN_MASK = 3
#define PFR_LINE_JOIN_MITER 0x00U
#define PFR_LINE_JOIN_ROUND 0x01U
#define PFR_LINE_JOIN_BEVEL 0x02U
#define PFR_LINE_JOIN_MASK ( PFR_LINE_JOIN_ROUND | PFR_LINE_JOIN_BEVEL )
} PFR_LogFlags;
typedef enum PFR_LineJoinFlags_
{
PFR_LINE_JOIN_MITER = 0,
PFR_LINE_JOIN_ROUND = 1,
PFR_LINE_JOIN_BEVEL = 2
} PFR_LineJoinFlags;
#define PFR_LOG_STROKE 0x04U
#define PFR_LOG_2BYTE_STROKE 0x08U
#define PFR_LOG_BOLD 0x10U
#define PFR_LOG_2BYTE_BOLD 0x20U
#define PFR_LOG_EXTRA_ITEMS 0x40U
/************************************************************************/
typedef enum PFR_BitmapFlags_
{
PFR_BITMAP_3BYTE_OFFSET = 4,
PFR_BITMAP_2BYTE_SIZE = 2,
PFR_BITMAP_2BYTE_CHARCODE = 1
#define PFR_BITMAP_2BYTE_CHARCODE 0x01U
#define PFR_BITMAP_2BYTE_SIZE 0x02U
#define PFR_BITMAP_3BYTE_OFFSET 0x04U
} PFR_BitmapFlags;
/*not part of the specification but used for implementation */
#define PFR_BITMAP_CHARCODES_VALIDATED 0x40U
#define PFR_BITMAP_VALID_CHARCODES 0x80U
typedef struct PFR_BitmapCharRec_
@@ -137,15 +124,11 @@ FT_BEGIN_HEADER
} PFR_BitmapCharRec, *PFR_BitmapChar;
typedef enum PFR_StrikeFlags_
{
PFR_STRIKE_2BYTE_COUNT = 0x10,
PFR_STRIKE_3BYTE_OFFSET = 0x08,
PFR_STRIKE_3BYTE_SIZE = 0x04,
PFR_STRIKE_2BYTE_YPPM = 0x02,
PFR_STRIKE_2BYTE_XPPM = 0x01
} PFR_StrikeFlags;
#define PFR_STRIKE_2BYTE_XPPM 0x01U
#define PFR_STRIKE_2BYTE_YPPM 0x02U
#define PFR_STRIKE_3BYTE_SIZE 0x04U
#define PFR_STRIKE_3BYTE_OFFSET 0x08U
#define PFR_STRIKE_2BYTE_COUNT 0x10U
typedef struct PFR_StrikeRec_
@@ -266,38 +249,29 @@ FT_BEGIN_HEADER
} PFR_PhyFontRec, *PFR_PhyFont;
typedef enum PFR_PhyFlags_
{
PFR_PHY_EXTRA_ITEMS = 0x80,
PFR_PHY_3BYTE_GPS_OFFSET = 0x20,
PFR_PHY_2BYTE_GPS_SIZE = 0x10,
PFR_PHY_ASCII_CODE = 0x08,
PFR_PHY_PROPORTIONAL = 0x04,
PFR_PHY_2BYTE_CHARCODE = 0x02,
PFR_PHY_VERTICAL = 0x01
} PFR_PhyFlags;
#define PFR_PHY_VERTICAL 0x01U
#define PFR_PHY_2BYTE_CHARCODE 0x02U
#define PFR_PHY_PROPORTIONAL 0x04U
#define PFR_PHY_ASCII_CODE 0x08U
#define PFR_PHY_2BYTE_GPS_SIZE 0x10U
#define PFR_PHY_3BYTE_GPS_OFFSET 0x20U
#define PFR_PHY_EXTRA_ITEMS 0x80U
typedef enum PFR_KernFlags_
{
PFR_KERN_2BYTE_CHAR = 0x01,
PFR_KERN_2BYTE_ADJ = 0x02
} PFR_KernFlags;
#define PFR_KERN_2BYTE_CHAR 0x01U
#define PFR_KERN_2BYTE_ADJ 0x02U
/************************************************************************/
typedef enum PFR_GlyphFlags_
{
PFR_GLYPH_IS_COMPOUND = 0x80,
PFR_GLYPH_EXTRA_ITEMS = 0x08,
PFR_GLYPH_1BYTE_XYCOUNT = 0x04,
PFR_GLYPH_XCOUNT = 0x02,
PFR_GLYPH_YCOUNT = 0x01
#define PFR_GLYPH_YCOUNT 0x01U
#define PFR_GLYPH_XCOUNT 0x02U
#define PFR_GLYPH_1BYTE_XYCOUNT 0x04U
} PFR_GlyphFlags;
#define PFR_GLYPH_SINGLE_EXTRA_ITEMS 0x08U
#define PFR_GLYPH_COMPOUND_EXTRA_ITEMS 0x40U
#define PFR_GLYPH_IS_COMPOUND 0x80U
/* controlled coordinate */
@@ -321,14 +295,10 @@ FT_BEGIN_HEADER
} PFR_SubGlyphRec, *PFR_SubGlyph;
typedef enum PFR_SubgGlyphFlags_
{
PFR_SUBGLYPH_3BYTE_OFFSET = 0x80,
PFR_SUBGLYPH_2BYTE_SIZE = 0x40,
PFR_SUBGLYPH_YSCALE = 0x20,
PFR_SUBGLYPH_XSCALE = 0x10
} PFR_SubGlyphFlags;
#define PFR_SUBGLYPH_XSCALE 0x10U
#define PFR_SUBGLYPH_YSCALE 0x20U
#define PFR_SUBGLYPH_2BYTE_SIZE 0x40U
#define PFR_SUBGLYPH_3BYTE_OFFSET 0x80U
typedef struct PFR_GlyphRec_
+3 -3
View File
@@ -1087,9 +1087,9 @@
for ( ; count > 0; count--, idx++ )
{
FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
FT_Long val;
FT_String* string;
FT_String* string = NULL;
skip_spaces( &cur, limit );
@@ -1217,7 +1217,7 @@
case T1_FIELD_TYPE_MM_BBOX:
{
FT_Memory memory = parser->memory;
FT_Fixed* temp;
FT_Fixed* temp = NULL;
FT_Int result;
FT_UInt i;
+2 -2
View File
@@ -779,7 +779,7 @@
* It turns out though that minimizing the total number of lit
* pixels is also important, so position C), with one edge
* aligned with a pixel boundary is actually preferable
* to A). There are also more possibile positions for C) than
* to A). There are also more possible positions for C) than
* for A) or B), so it involves less distortion of the overall
* character shape.
*/
@@ -802,7 +802,7 @@
}
/* We choose between B) and C) above based on the amount
* of fractinal stem width; for small amounts, choose
* of fractional stem width; for small amounts, choose
* C) always, for large amounts, B) always, and inbetween,
* pick whichever one involves less stem movement.
*/
+1 -1
View File
@@ -80,7 +80,7 @@
#if 0
/* org_width is is font units, result in device pixels, 26.6 format */
/* org_width is in font units, result in device pixels, 26.6 format */
FT_LOCAL_DEF( FT_Pos )
psh_dimension_snap_width( PSH_Dimension dimension,
FT_Int org_width )
+30 -12
View File
@@ -179,8 +179,6 @@
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
/* This macro is used to indicate that a function parameter is unused. */
/* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
@@ -459,6 +457,12 @@
#define IS_TOP_OVERSHOOT( x ) \
(Bool)( x - FLOOR( x ) >= ras.precision_half )
#if FT_RENDER_POOL_SIZE > 2048
#define FT_MAX_BLACK_POOL ( FT_RENDER_POOL_SIZE / sizeof ( Long ) )
#else
#define FT_MAX_BLACK_POOL ( 2048 / sizeof ( Long ) )
#endif
/* The most used variables are positioned at the top of the structure. */
/* Thus, their offset can be coded with less opcodes, resulting in a */
/* smaller executable. */
@@ -3106,9 +3110,9 @@
static void
ft_black_reset( black_PRaster raster,
char* pool_base,
Long pool_size )
ft_black_reset( FT_Raster raster,
PByte pool_base,
ULong pool_size )
{
FT_UNUSED( raster );
FT_UNUSED( pool_base );
@@ -3117,20 +3121,20 @@
static int
ft_black_set_mode( black_PRaster raster,
ULong mode,
const char* palette )
ft_black_set_mode( FT_Raster raster,
ULong mode,
void* args )
{
FT_UNUSED( raster );
FT_UNUSED( mode );
FT_UNUSED( palette );
FT_UNUSED( args );
return 0;
}
static int
ft_black_render( black_PRaster raster,
ft_black_render( FT_Raster raster,
const FT_Raster_Params* params )
{
const FT_Outline* outline = (const FT_Outline*)params->source;
@@ -3143,7 +3147,7 @@
#else
black_TWorker worker[1];
Long buffer[FT_MAX( FT_RENDER_POOL_SIZE, 2048 ) / sizeof ( Long )];
Long buffer[FT_MAX_BLACK_POOL];
#endif
@@ -3181,6 +3185,20 @@
if ( !target_map->buffer )
return FT_THROW( Invalid );
/* reject too large outline coordinates */
{
FT_Vector* vec = outline->points;
FT_Vector* limit = vec + outline->n_points;
for ( ; vec < limit; vec++ )
{
if ( vec->x < -0x1000000L || vec->x > 0x1000000L ||
vec->y < -0x1000000L || vec->y > 0x1000000L )
return FT_THROW( Invalid );
}
}
#ifdef __REACTOS__
worker = malloc(sizeof(black_TWorker));
buffer = malloc(FT_MAX(FT_RENDER_POOL_SIZE, 2048));
@@ -3191,7 +3209,7 @@
worker->buff = buffer;
#ifdef __REACTOS__
worker->sizeBuff = buffer + (FT_MAX(FT_RENDER_POOL_SIZE, 2048) / sizeof(Long));
worker->sizeBuff = buffer + FT_MAX_BLACK_POOL;
#else
worker->sizeBuff = (&buffer)[1]; /* Points to right after buffer. */
#endif
+4
View File
@@ -949,6 +949,10 @@
instance_size * num_instances > fvar_len )
num_instances = 0;
/* we don't support Multiple Master CFFs yet */
if ( !face->goto_table( face, TTAG_CFF, stream, 0 ) )
num_instances = 0;
/* we support at most 2^15 - 1 instances */
if ( num_instances >= ( 1U << 15 ) - 1 )
{
+2 -2
View File
@@ -1245,7 +1245,7 @@
mid = max + 1;
/* search in segments before the current segment */
for ( i = max ; i > 0; i-- )
for ( i = max; i > 0; i-- )
{
FT_UInt prev_end;
FT_Byte* old_p;
@@ -3104,7 +3104,7 @@
if ( char_code < start )
max = mid;
else if ( char_code > start+cnt )
else if ( char_code > start + cnt )
min = mid + 1;
else
return TRUE;
+1 -1
View File
@@ -2,7 +2,7 @@
/* */
/* ttpost.c */
/* */
/* Postcript name table processing for TrueType and OpenType fonts */
/* PostScript name table processing for TrueType and OpenType fonts */
/* (body). */
/* */
/* Copyright 1996-2016 by */
+1 -1
View File
@@ -2,7 +2,7 @@
/* */
/* ttpost.h */
/* */
/* Postcript name table processing for TrueType and OpenType fonts */
/* PostScript name table processing for TrueType and OpenType fonts */
/* (specification). */
/* */
/* Copyright 1996-2016 by */
File diff suppressed because it is too large Load Diff
@@ -390,7 +390,7 @@ class HtmlFormatter( Formatter ):
"""Convert a code sequence to HTML."""
line = code_header + '\n'
for l in lines:
line = line + html_quote( l ) + '\n'
line = line + html_quote( l ).rstrip() + '\n'
return line + code_footer
+9 -4
View File
@@ -72,12 +72,17 @@
FT_UInt* interpreter_version = (FT_UInt*)value;
#ifndef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( *interpreter_version != TT_INTERPRETER_VERSION_35 )
error = FT_ERR( Unimplemented_Feature );
else
if ( *interpreter_version == TT_INTERPRETER_VERSION_35
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|| *interpreter_version == TT_INTERPRETER_VERSION_38
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|| *interpreter_version == TT_INTERPRETER_VERSION_40
#endif
)
driver->interpreter_version = *interpreter_version;
else
error = FT_ERR( Unimplemented_Feature );
return error;
}
+195 -81
View File
@@ -122,7 +122,7 @@
FT_UInt glyph_index )
{
TT_Face face = loader->face;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
@@ -153,7 +153,7 @@
loader->top_bearing = top_bearing;
loader->vadvance = advance_height;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
loader->exec )
{
@@ -165,7 +165,7 @@
/* backwards compatibility mode on and off. */
sph_set_tweaks( loader, glyph_index );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
if ( !loader->linear_def )
{
@@ -427,7 +427,8 @@
load->glyph->control_len = n_ins;
load->glyph->control_data = load->exec->glyphIns;
FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins );
if ( n_ins )
FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins );
}
#endif /* TT_USE_BYTECODE_INTERPRETER */
@@ -732,7 +733,8 @@
TT_Hint_Glyph( TT_Loader loader,
FT_Bool is_composite )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
TT_Face face = loader->face;
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
@@ -815,13 +817,23 @@
#endif
/* save glyph phantom points */
loader->pp1 = zone->cur[zone->n_points - 4];
loader->pp2 = zone->cur[zone->n_points - 3];
loader->pp3 = zone->cur[zone->n_points - 2];
loader->pp4 = zone->cur[zone->n_points - 1];
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/* Save possibly modified glyph phantom points unless in v40 backwards */
/* compatibility mode, where no movement on the x axis means no reason */
/* to change bearings or advance widths. */
if ( !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
!loader->exec->backwards_compatibility ) )
{
#endif
loader->pp1 = zone->cur[zone->n_points - 4];
loader->pp2 = zone->cur[zone->n_points - 3];
loader->pp3 = zone->cur[zone->n_points - 2];
loader->pp4 = zone->cur[zone->n_points - 1];
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
}
#endif
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
if ( loader->exec->sph_tweak_flags & SPH_TWEAK_DEEMBOLDEN )
@@ -830,7 +842,7 @@
else if ( loader->exec->sph_tweak_flags & SPH_TWEAK_EMBOLDEN )
FT_Outline_EmboldenXY( &loader->gloader->current.outline, 24, 0 );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
return FT_Err_Ok;
}
@@ -896,7 +908,7 @@
}
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
TT_Face face = loader->face;
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
@@ -915,7 +927,7 @@
FT_Bool do_scale = FALSE;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
@@ -946,7 +958,7 @@
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
{
/* scale the glyph */
@@ -1077,7 +1089,7 @@
: -subglyph->transform.yx;
int c = subglyph->transform.xy > 0 ? subglyph->transform.xy
: -subglyph->transform.xy;
int d = subglyph->transform.yy > 0 ? subglyph->transform.yy
int d = subglyph->transform.yy > 0 ? subglyph->transform.yy
: -subglyph->transform.yy;
int m = a > b ? a : b;
int n = c > d ? c : d;
@@ -1323,49 +1335,71 @@
* (3) for everything else.
*
*/
static void
tt_loader_set_pp( TT_Loader loader )
{
FT_Bool subpixel_hinting = 0;
FT_Bool grayscale = 0;
FT_Bool use_aw_2 = 0;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face );
#endif
#define TT_LOADER_SET_PP( loader ) \
do \
{ \
FT_Bool subpixel_hinting_ = loader->exec \
? loader->exec->subpixel_hinting \
: 0; \
FT_Bool grayscale_ = loader->exec \
? loader->exec->grayscale \
: 0; \
FT_Bool use_aw_2_ = (FT_Bool)( subpixel_hinting_ && \
grayscale_ ); \
\
\
(loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \
(loader)->pp1.y = 0; \
(loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \
(loader)->pp2.y = 0; \
\
(loader)->pp3.x = use_aw_2_ ? (loader)->advance / 2 : 0; \
(loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \
(loader)->pp4.x = use_aw_2_ ? (loader)->advance / 2 : 0; \
(loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \
} while ( 0 )
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting
: 0;
grayscale = loader->exec ? loader->exec->grayscale
: 0;
}
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
{
subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting_lean
: 0;
grayscale = loader->exec ? loader->exec->grayscale_cleartype
: 0;
}
#endif
#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
use_aw_2 = (FT_Bool)( subpixel_hinting && grayscale );
#define TT_LOADER_SET_PP( loader ) \
do \
{ \
(loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \
(loader)->pp1.y = 0; \
(loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \
(loader)->pp2.y = 0; \
\
(loader)->pp3.x = 0; \
(loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \
(loader)->pp4.x = 0; \
(loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \
} while ( 0 )
loader->pp1.x = loader->bbox.xMin - loader->left_bearing;
loader->pp1.y = 0;
loader->pp2.x = loader->pp1.x + loader->advance;
loader->pp2.y = 0;
#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
loader->pp3.x = use_aw_2 ? loader->advance / 2 : 0;
loader->pp3.y = loader->bbox.yMax + loader->top_bearing;
loader->pp4.x = use_aw_2 ? loader->advance / 2 : 0;
loader->pp4.y = loader->pp3.y - loader->vadvance;
}
/* a utility function to retrieve i-th node from given FT_List */
static FT_ListNode
ft_list_get_node_at( FT_List list,
FT_UInt index )
{
FT_ListNode cur;
if ( !list )
return NULL;
for ( cur = list->head; cur; cur = cur->next )
{
if ( !index )
return cur;
index--;
}
return NULL;
}
/*************************************************************************/
@@ -1523,7 +1557,7 @@
/* must initialize points before (possibly) overriding */
/* glyph metrics from the incremental interface */
TT_LOADER_SET_PP( loader );
tt_loader_set_pp( loader );
#ifdef FT_CONFIG_OPTION_INCREMENTAL
tt_get_metrics_incr_overrides( loader, glyph_index );
@@ -1598,7 +1632,7 @@
/* must initialize phantom points before (possibly) overriding */
/* glyph metrics from the incremental interface */
TT_LOADER_SET_PP( loader );
tt_loader_set_pp( loader );
#ifdef FT_CONFIG_OPTION_INCREMENTAL
tt_get_metrics_incr_overrides( loader, glyph_index );
@@ -1640,6 +1674,8 @@
FT_UInt start_contour;
FT_ULong ins_pos; /* position of composite instructions, if any */
FT_ListNode node, node2;
/*
* We store the glyph index directly in the `node->data' pointer,
@@ -1648,6 +1684,12 @@
* pointers with a width of at least 32 bits.
*/
/* clear the nodes filled by sibling chains */
node = ft_list_get_node_at( &loader->composites, recurse_count );
for ( node2 = node; node2; node2 = node2->next )
node2->data = (void*)ULONG_MAX;
/* check whether we already have a composite glyph with this index */
if ( FT_List_Find( &loader->composites,
(void*)(unsigned long)glyph_index ) )
@@ -1657,11 +1699,12 @@
error = FT_THROW( Invalid_Composite );
goto Exit;
}
else if ( node )
node->data = (void*)(unsigned long)glyph_index;
else
{
FT_ListNode node = NULL;
if ( FT_NEW( node ) )
goto Exit;
node->data = (void*)(unsigned long)glyph_index;
@@ -1703,6 +1746,10 @@
outline.n_points = (short)( gloader->current.num_subglyphs + 4 );
outline.n_contours = outline.n_points;
outline.points = NULL;
outline.tags = NULL;
outline.contours = NULL;
if ( FT_NEW_ARRAY( points, outline.n_points ) ||
FT_NEW_ARRAY( tags, outline.n_points ) ||
FT_NEW_ARRAY( contours, outline.n_points ) )
@@ -1942,7 +1989,8 @@
FT_UInt glyph_index )
{
TT_Face face = loader->face;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
#endif
@@ -1969,11 +2017,18 @@
glyph->metrics.horiBearingY = bbox.yMax;
glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
/* adjust advance width to the value contained in the hdmx table */
/* unless FT_LOAD_COMPUTE_METRICS is set */
if ( !face->postscript.isFixedPitch &&
IS_HINTED( loader->load_flags ) &&
!( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
/* Adjust advance width to the value contained in the hdmx table */
/* unless FT_LOAD_COMPUTE_METRICS is set or backwards compatibility */
/* mode of the v40 interpreter is active. See `ttinterp.h' for */
/* details on backwards compatibility mode. */
if (
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
!( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
( loader->exec && loader->exec->backwards_compatibility ) ) &&
#endif
!face->postscript.isFixedPitch &&
IS_HINTED( loader->load_flags ) &&
!( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
{
FT_Byte* widthp;
@@ -1982,7 +2037,7 @@
size->root.metrics.x_ppem,
glyph_index );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
@@ -2000,7 +2055,7 @@
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
{
if ( widthp )
@@ -2189,6 +2244,10 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
#endif
#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( (TT_Face)glyph->face );
#endif
face = (TT_Face)glyph->face;
@@ -2202,11 +2261,13 @@
if ( IS_HINTED( load_flags ) && !glyf_table_only )
{
TT_ExecContext exec;
FT_Bool grayscale;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
FT_Bool grayscale = TRUE;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
FT_Bool subpixel_hinting_lean;
FT_Bool grayscale_cleartype;
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
FT_Bool subpixel_hinting = FALSE;
#if 0
@@ -2218,7 +2279,7 @@
FT_Bool subpixel_positioned;
FT_Bool gray_cleartype;
#endif
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
FT_Bool reexecute = FALSE;
@@ -2239,7 +2300,26 @@
if ( !exec )
return FT_THROW( Could_Not_Find_Context );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
{
subpixel_hinting_lean = TRUE;
grayscale_cleartype = !FT_BOOL( load_flags &
FT_LOAD_TARGET_LCD ||
load_flags &
FT_LOAD_TARGET_LCD_V );
exec->vertical_lcd_lean = FT_BOOL( load_flags &
FT_LOAD_TARGET_LCD_V );
}
else
{
subpixel_hinting_lean = FALSE;
grayscale_cleartype = FALSE;
exec->vertical_lcd_lean = FALSE;
}
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
@@ -2296,18 +2376,23 @@
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
grayscale = FT_BOOL( !subpixel_hinting_lean &&
FT_LOAD_TARGET_MODE( load_flags ) !=
FT_RENDER_MODE_MONO );
else
#endif
grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
FT_RENDER_MODE_MONO );
}
FT_RENDER_MODE_MONO );
error = TT_Load_Context( exec, face, size );
if ( error )
return error;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
@@ -2335,9 +2420,37 @@
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
{
/* a change from mono to subpixel rendering (and vice versa) */
/* requires a re-execution of the CVT program */
if ( subpixel_hinting_lean != exec->subpixel_hinting_lean )
{
FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
" re-executing `prep' table\n" ));
exec->subpixel_hinting_lean = subpixel_hinting_lean;
reexecute = TRUE;
}
/* a change from colored to grayscale subpixel rendering (and */
/* vice versa) requires a re-execution of the CVT program */
if ( grayscale_cleartype != exec->grayscale_cleartype )
{
FT_TRACE4(( "tt_loader_init: grayscale subpixel hinting change,"
" re-executing `prep' table\n" ));
exec->grayscale_cleartype = grayscale_cleartype;
reexecute = TRUE;
}
}
#endif
/* a change from mono to grayscale rendering (and vice versa) */
/* requires a re-execution of the CVT program */
if ( grayscale != exec->grayscale )
@@ -2370,10 +2483,11 @@
if ( exec->GS.instruct_control & 2 )
exec->GS = tt_default_graphics_state;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/* check whether we have a font hinted for ClearType -- */
/* note that this flag can also be modified in a glyph's bytecode */
if ( exec->GS.instruct_control & 4 )
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
exec->GS.instruct_control & 4 )
exec->ignore_x_mode = 0;
#endif
+57 -40
View File
@@ -551,7 +551,7 @@
for ( i = 0; i < blend->tuplecount; i++ )
{
FT_TRACE5(( " [ " ));
for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; j++ )
for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ )
{
blend->tuplecoords[i * gvar_head.axisCount + j] =
FT_GET_SHORT() * 4; /* convert to FT_Fixed */
@@ -613,6 +613,11 @@
{
FT_TRACE6(( " axis coordinate %d (%.4f):\n",
i, blend->normalizedcoords[i] / 65536.0 ));
if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
FT_TRACE6(( " intermediate coordinates %d (%.4f, %.4f):\n",
i,
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
/* It's not clear why (for intermediate tuples) we don't need */
/* to check against start/end -- the documentation says we don't. */
@@ -625,62 +630,74 @@
continue;
}
else if ( blend->normalizedcoords[i] == 0 )
if ( blend->normalizedcoords[i] == 0 )
{
FT_TRACE6(( " axis coordinate is zero, stop\n" ));
apply = 0;
break;
}
else if ( ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) ||
( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) )
if ( blend->normalizedcoords[i] == tuple_coords[i] )
{
FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n",
FT_TRACE6(( " tuple coordinate value %.4f fits perfectly\n",
tuple_coords[i] / 65536.0 ));
apply = 0;
break;
/* `apply' does not change */
continue;
}
else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
{
/* not an intermediate tuple */
if ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) ||
blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) )
{
FT_TRACE6(( " tuple coordinate value %.4f is exceeded, stop\n",
tuple_coords[i] / 65536.0 ));
apply = 0;
break;
}
FT_TRACE6(( " tuple coordinate value %.4f fits\n",
tuple_coords[i] / 65536.0 ));
/* not an intermediate tuple */
apply = FT_MulFix( apply,
blend->normalizedcoords[i] > 0
? blend->normalizedcoords[i]
: -blend->normalizedcoords[i] );
}
else if ( blend->normalizedcoords[i] < im_start_coords[i] ||
blend->normalizedcoords[i] > im_end_coords[i] )
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded,"
" stop\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = 0;
break;
}
else if ( blend->normalizedcoords[i] < tuple_coords[i] )
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
blend->normalizedcoords[i] - im_start_coords[i],
tuple_coords[i] - im_start_coords[i] );
blend->normalizedcoords[i],
tuple_coords[i] );
}
else
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
im_end_coords[i] - blend->normalizedcoords[i],
im_end_coords[i] - tuple_coords[i] );
/* intermediate tuple */
if ( blend->normalizedcoords[i] < im_start_coords[i] ||
blend->normalizedcoords[i] > im_end_coords[i] )
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] is exceeded,"
" stop\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = 0;
break;
}
else if ( blend->normalizedcoords[i] < tuple_coords[i] )
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
blend->normalizedcoords[i] - im_start_coords[i],
tuple_coords[i] - im_start_coords[i] );
}
else
{
FT_TRACE6(( " intermediate tuple range [%.4f;%.4f] fits\n",
im_start_coords[i] / 65536.0,
im_end_coords[i] / 65536.0 ));
apply = FT_MulDiv( apply,
im_end_coords[i] - blend->normalizedcoords[i],
im_end_coords[i] - tuple_coords[i] );
}
}
}
File diff suppressed because it is too large Load Diff
+131 -5
View File
@@ -99,7 +99,7 @@ FT_BEGIN_HEADER
} TT_CallRec, *TT_CallStack;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/*************************************************************************/
/* */
@@ -138,7 +138,7 @@ FT_BEGIN_HEADER
} SPH_Font_Class;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
/*************************************************************************/
@@ -247,9 +247,135 @@ FT_BEGIN_HEADER
TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */
TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */
FT_Bool grayscale; /* are we hinting for grayscale? */
FT_Bool grayscale; /* bi-level hinting and */
/* grayscale rendering */
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/*
* Modern TrueType fonts are usually rendered through Microsoft's
* collection of rendering techniques called ClearType (e.g., subpixel
* rendering and subpixel hinting). When ClearType was introduced, most
* fonts were not ready. Microsoft decided to implement a backwards
* compatibility mode that employed several simple to complicated
* assumptions and tricks that modified the interpretation of the
* bytecode contained in these fonts to make them look ClearType-y
* somehow. Most (web)fonts that were released since then have come to
* rely on these hacks to render correctly, even some of Microsoft's
* flagship ClearType fonts (Calibri, Cambria, Segoe UI).
*
* The minimal subpixel hinting code (interpreter version 40) employs a
* small list of font-agnostic hacks to bludgeon non-native-ClearType
* fonts (except tricky ones[1]) into submission. It will not try to
* toggle hacks for specific fonts for performance and complexity
* reasons. The focus is on modern (web)fonts rather than legacy fonts
* that were made for black-and-white rendering.
*
* Major hacks
*
* - Any point movement on the x axis is ignored (cf. `Direct_Move' and
* `Direct_Move_X'). This has the smallest code footprint and single
* biggest effect. The ClearType way to increase resolution is
* supersampling the x axis, the FreeType way is ignoring instructions
* on the x axis, which gives the same result in the majority of
* cases.
*
* - Points are not moved post-IUP (neither on the x nor on the y axis),
* except the x component of diagonal moves post-IUP (cf.
* `Direct_Move', `Direct_Move_Y', `Move_Zp2_Point'). Post-IUP
* changes are commonly used to `fix' pixel patterns which has little
* use outside monochrome rendering.
*
* - SHPIX and DELTAP don't execute unless moving a composite on the
* y axis or moving a previously y touched point. SHPIX additionally
* denies movement on the x axis (cf. `Ins_SHPIX' and `Ins_DELTAP').
* Both instructions are commonly used to `fix' pixel patterns for
* monochrome or Windows's GDI rendering but make little sense for
* FreeType rendering. Both can distort the outline. See [2] for
* details.
*
* - The hdmx table and modifications to phantom points are ignored.
* Bearings and advance widths remain unchanged (except rounding them
* outside the interpreter!), cf. `compute_glyph_metrics' and
* `TT_Hint_Glyph'. Letting non-native-ClearType fonts modify spacing
* might mess up spacing.
*
* Minor hacks
*
* - FLIPRGON, FLIPRGOFF, and FLIPPT don't execute post-IUP. This
* prevents dents in e.g. Arial-Regular's `D' and `G' glyphs at
* various sizes.
*
* (Post-IUP is the state after both IUP[x] and IUP[y] have been
* executed.)
*
* The best results are achieved for fonts that were from the outset
* designed with ClearType in mind, meaning they leave the x axis mostly
* alone and don't mess with the `final' outline to produce more
* pleasing pixel patterns. The harder the designer tried to produce
* very specific patterns (`superhinting') for pre-ClearType-displays,
* the worse the results.
*
* Microsoft defines a way to turn off backwards compatibility and
* interpret instructions as before (called `native ClearType')[2][3].
* The font designer then regains full control and is responsible for
* making the font work correctly with ClearType without any
* hand-holding by the interpreter or rasterizer[4]. The v40
* interpreter assumes backwards compatibility by default, which can be
* turned off the same way by executing the following in the control
* program (cf. `Ins_INSTCTRL').
*
* #PUSH 4,3
* INSTCTRL[]
*
* [1] Tricky fonts as FreeType defines them rely on the bytecode
* interpreter to display correctly. Hacks can interfere with them,
* so they get treated like native ClearType fonts (v40 with
* backwards compatibility turned off). Cf. `TT_RunIns'.
*
* [2] Proposed by Microsoft's Greg Hitchcock in
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
*
* [3] Beat Stamm describes it in more detail:
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec12
*
* [4] The list of `native ClearType' fonts is small at the time of this
* writing; I found the following on a Windows 10 Update 1511
* installation: Constantia, Corbel, Sitka, Malgun Gothic, Microsoft
* JhengHei (Bold and UI Bold), Microsoft YaHei (Bold and UI Bold),
* SimSun, NSimSun, and Yu Gothic.
*
*/
/* Using v40 implies subpixel hinting. Used to detect interpreter */
/* version switches. `_lean' to differentiate from the Infinality */
/* `subpixel_hinting', which is managed differently. */
FT_Bool subpixel_hinting_lean;
/* Long side of a LCD subpixel is vertical (e.g., screen is rotated). */
/* `_lean' to differentiate from the Infinality `vertical_lcd', which */
/* is managed differently. */
FT_Bool vertical_lcd_lean;
/* Default to backwards compatibility mode in v40 interpreter. If */
/* this is false, it implies the interpreter is in v35 or in native */
/* ClearType mode. */
FT_Bool backwards_compatibility;
/* Useful for detecting and denying post-IUP trickery that is usually */
/* used to fix pixel patterns (`superhinting'). */
FT_Bool iupx_called;
FT_Bool iupy_called;
/* ClearType hinting and grayscale rendering, as used by Universal */
/* Windows Platform apps (Windows 8 and above). Like the standard */
/* colorful ClearType mode, it utilizes a vastly increased virtual */
/* resolution on the x axis. Different from bi-level hinting and */
/* grayscale rendering, the old mode from Win9x days that roughly */
/* adheres to the physical pixel grid on both axes. */
FT_Bool grayscale_cleartype;
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
TT_Round_Func func_round_sphn; /* subpixel rounding function */
FT_Bool subpixel_hinting; /* Using subpixel hinting? */
@@ -279,7 +405,7 @@ FT_BEGIN_HEADER
FT_ULong sph_in_func_flags; /* flags to indicate if in */
/* special functions */
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
} TT_ExecContextRec;
+8 -6
View File
@@ -398,11 +398,11 @@
for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )
{
if ( !has_cvt && !sfnt_id[j][TRICK_SFNT_ID_cvt].Length )
num_matched_ids[j] ++;
num_matched_ids[j]++;
if ( !has_fpgm && !sfnt_id[j][TRICK_SFNT_ID_fpgm].Length )
num_matched_ids[j] ++;
num_matched_ids[j]++;
if ( !has_prep && !sfnt_id[j][TRICK_SFNT_ID_prep].Length )
num_matched_ids[j] ++;
num_matched_ids[j]++;
if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )
return TRUE;
}
@@ -1287,10 +1287,12 @@
TT_Driver driver = (TT_Driver)ttdriver;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
driver->interpreter_version = TT_INTERPRETER_VERSION_38;
#else
driver->interpreter_version = TT_INTERPRETER_VERSION_35;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
driver->interpreter_version = TT_INTERPRETER_VERSION_38;
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
driver->interpreter_version = TT_INTERPRETER_VERSION_40;
#endif
#else /* !TT_USE_BYTECODE_INTERPRETER */
+3 -3
View File
@@ -27,7 +27,7 @@
#include "ttsubpix.h"
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/*************************************************************************/
/* */
@@ -1000,12 +1000,12 @@
}
}
#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#else /* !TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
/* ANSI C doesn't like empty source files */
typedef int _tt_subpix_dummy;
#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* !TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
/* END */
+2 -2
View File
@@ -27,7 +27,7 @@
FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/*************************************************************************/
/* */
@@ -100,7 +100,7 @@ FT_BEGIN_HEADER
#define SPH_OPTION_SET_COMPATIBLE_WIDTHS FALSE
#define SPH_OPTION_SET_RASTERIZER_VERSION 38
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
FT_END_HEADER
+1 -1
View File
@@ -197,7 +197,7 @@
/* encoding of first glyph (1 byte) */
/* encoding of second glyph (1 byte) */
/* offset (little-endian short) */
for ( ; p < limit ; p += 4 )
for ( ; p < limit; p += 4 )
{
kp->index1 = FT_Get_Char_Index( t1_face, p[0] );
kp->index2 = FT_Get_Char_Index( t1_face, p[1] );
+3 -3
View File
@@ -326,7 +326,7 @@
/* Point to axes after MM_Var struct */
mmvar->namedstyle = NULL;
for ( i = 0 ; i < mmaster.num_axis; ++i )
for ( i = 0; i < mmaster.num_axis; ++i )
{
mmvar->axis[i].name = mmaster.axis[i].name;
mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum);
@@ -1544,7 +1544,7 @@
/* */
if ( face->type1.private_dict.lenIV >= 0 )
{
FT_Byte* temp;
FT_Byte* temp = NULL;
/* some fonts define empty subr records -- this is not totally */
@@ -1748,7 +1748,7 @@
if ( face->type1.private_dict.lenIV >= 0 &&
n < num_glyphs + TABLE_EXTEND )
{
FT_Byte* temp;
FT_Byte* temp = NULL;
if ( size <= (FT_ULong)face->type1.private_dict.lenIV )
+1 -1
View File
@@ -67,7 +67,7 @@
"pshinter" );
return ( module && pshinter && pshinter->get_globals_funcs )
? pshinter->get_globals_funcs( module )
: 0 ;
: 0;
}
+15 -4
View File
@@ -899,8 +899,13 @@
for (;;)
{
/* The format is simple: */
/* `/glyphname' + index [+ def] */
/* We support two formats. */
/* */
/* `/glyphname' + index [+ `def'] */
/* `(glyphname)' [+ `cvn'] + index [+ `def'] */
/* */
/* The latter format gets created by the */
/* LilyPond typesetting program. */
T1_Skip_Spaces( parser );
@@ -928,12 +933,13 @@
if ( parser->root.error )
return;
if ( *cur == '/' )
if ( *cur == '/' || *cur == '(' )
{
FT_UInt len;
FT_Bool have_literal = ( *cur == '(' );
if ( cur + 2 >= limit )
if ( cur + ( have_literal ? 3 : 2 ) >= limit )
{
FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
error = FT_THROW( Invalid_File_Format );
@@ -942,6 +948,8 @@
cur++; /* skip `/' */
len = (FT_UInt)( parser->root.cursor - cur );
if ( have_literal )
len--;
error = T1_Add_Table( name_table, n, cur, len + 1 );
if ( error )
@@ -961,6 +969,9 @@
T1_Skip_Spaces( parser );
if ( have_literal )
T1_Skip_PS_Token( parser );
cur = parser->root.cursor;
(void)T1_ToInt( parser );