updated freetype to 2.3.9

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2009-03-22 23:19:15 +00:00
parent f11f17301f
commit 89bbd37a10
51 changed files with 1004 additions and 544 deletions
+166 -167
View File
@@ -25,14 +25,6 @@
#endif #endif
/*************************************************************************/
/* */
/* The `raster' component duplicates some of the declarations in */
/* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
/* */
/*************************************************************************/
#ifndef __FREETYPE_H__ #ifndef __FREETYPE_H__
#define __FREETYPE_H__ #define __FREETYPE_H__
@@ -395,8 +387,8 @@ FT_BEGIN_HEADER
/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_FaceRec details the publicly accessible fields of a given */ /* See @FT_FaceRec for the publicly accessible fields of a given face */
/* face object. */ /* object. */
/* */ /* */
typedef struct FT_FaceRec_* FT_Face; typedef struct FT_FaceRec_* FT_Face;
@@ -425,8 +417,8 @@ FT_BEGIN_HEADER
/* activated at any given time per face. */ /* activated at any given time per face. */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_SizeRec structure details the publicly accessible fields */ /* See @FT_SizeRec for the publicly accessible fields of a given size */
/* of a given size object. */ /* object. */
/* */ /* */
typedef struct FT_SizeRec_* FT_Size; typedef struct FT_SizeRec_* FT_Size;
@@ -438,7 +430,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A handle to a given `glyph slot'. A slot is a container where it */ /* A handle to a given `glyph slot'. A slot is a container where it */
/* is possible to load any one of the glyphs contained in its parent */ /* is possible to load any of the glyphs contained in its parent */
/* face. */ /* face. */
/* */ /* */
/* In other words, each time you call @FT_Load_Glyph or */ /* In other words, each time you call @FT_Load_Glyph or */
@@ -447,7 +439,7 @@ FT_BEGIN_HEADER
/* other control information. */ /* other control information. */
/* */ /* */
/* <Also> */ /* <Also> */
/* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
/* */ /* */
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
@@ -478,8 +470,8 @@ FT_BEGIN_HEADER
/* the list and automatically activates it. */ /* the list and automatically activates it. */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_CharMapRec details the publicly accessible fields of a */ /* See @FT_CharMapRec for the publicly accessible fields of a given */
/* given character map. */ /* character map. */
/* */ /* */
typedef struct FT_CharMapRec_* FT_CharMap; typedef struct FT_CharMapRec_* FT_CharMap;
@@ -535,123 +527,123 @@ FT_BEGIN_HEADER
/* Other encodings might be defined in the future. */ /* Other encodings might be defined in the future. */
/* */ /* */
/* <Values> */ /* <Values> */
/* FT_ENCODING_NONE :: */ /* FT_ENCODING_NONE :: */
/* The encoding value~0 is reserved. */ /* The encoding value~0 is reserved. */
/* */ /* */
/* FT_ENCODING_UNICODE :: */ /* FT_ENCODING_UNICODE :: */
/* Corresponds to the Unicode character set. This value covers */ /* Corresponds to the Unicode character set. This value covers */
/* all versions of the Unicode repertoire, including ASCII and */ /* all versions of the Unicode repertoire, including ASCII and */
/* Latin-1. Most fonts include a Unicode charmap, but not all */ /* Latin-1. Most fonts include a Unicode charmap, but not all */
/* of them. */ /* of them. */
/* */ /* */
/* FT_ENCODING_MS_SYMBOL :: */ /* FT_ENCODING_MS_SYMBOL :: */
/* Corresponds to the Microsoft Symbol encoding, used to encode */ /* Corresponds to the Microsoft Symbol encoding, used to encode */
/* mathematical symbols in the 32..255 character code range. For */ /* mathematical symbols in the 32..255 character code range. For */
/* more information, see `http://www.ceviz.net/symbol.htm'. */ /* more information, see `http://www.ceviz.net/symbol.htm'. */
/* */ /* */
/* FT_ENCODING_SJIS :: */ /* FT_ENCODING_SJIS :: */
/* Corresponds to Japanese SJIS encoding. More info at */ /* Corresponds to Japanese SJIS encoding. More info at */
/* at `http://langsupport.japanreference.com/encoding.shtml'. */ /* at `http://langsupport.japanreference.com/encoding.shtml'. */
/* See note on multi-byte encodings below. */ /* See note on multi-byte encodings below. */
/* */ /* */
/* FT_ENCODING_GB2312 :: */ /* FT_ENCODING_GB2312 :: */
/* Corresponds to an encoding system for Simplified Chinese as used */ /* Corresponds to an encoding system for Simplified Chinese as used */
/* used in mainland China. */ /* used in mainland China. */
/* */ /* */
/* FT_ENCODING_BIG5 :: */ /* FT_ENCODING_BIG5 :: */
/* Corresponds to an encoding system for Traditional Chinese as used */ /* Corresponds to an encoding system for Traditional Chinese as */
/* in Taiwan and Hong Kong. */ /* used in Taiwan and Hong Kong. */
/* */ /* */
/* FT_ENCODING_WANSUNG :: */ /* FT_ENCODING_WANSUNG :: */
/* Corresponds to the Korean encoding system known as Wansung. */ /* Corresponds to the Korean encoding system known as Wansung. */
/* For more information see */ /* For more information see */
/* `http://www.microsoft.com/typography/unicode/949.txt'. */ /* `http://www.microsoft.com/typography/unicode/949.txt'. */
/* */ /* */
/* FT_ENCODING_JOHAB :: */ /* FT_ENCODING_JOHAB :: */
/* The Korean standard character set (KS~C 5601-1992), which */ /* The Korean standard character set (KS~C 5601-1992), which */
/* corresponds to MS Windows code page 1361. This character set */ /* corresponds to MS Windows code page 1361. This character set */
/* includes all possible Hangeul character combinations. */ /* includes all possible Hangeul character combinations. */
/* */ /* */
/* FT_ENCODING_ADOBE_LATIN_1 :: */ /* FT_ENCODING_ADOBE_LATIN_1 :: */
/* Corresponds to a Latin-1 encoding as defined in a Type~1 */ /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
/* PostScript font. It is limited to 256 character codes. */ /* PostScript font. It is limited to 256 character codes. */
/* */ /* */
/* FT_ENCODING_ADOBE_STANDARD :: */ /* FT_ENCODING_ADOBE_STANDARD :: */
/* Corresponds to the Adobe Standard encoding, as found in Type~1, */ /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */ /* codes. */
/* */ /* */
/* FT_ENCODING_ADOBE_EXPERT :: */ /* FT_ENCODING_ADOBE_EXPERT :: */
/* Corresponds to the Adobe Expert encoding, as found in Type~1, */ /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */ /* codes. */
/* */ /* */
/* FT_ENCODING_ADOBE_CUSTOM :: */ /* FT_ENCODING_ADOBE_CUSTOM :: */
/* Corresponds to a custom encoding, as found in Type~1, CFF, and */ /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
/* OpenType/CFF fonts. It is limited to 256 character codes. */ /* OpenType/CFF fonts. It is limited to 256 character codes. */
/* */ /* */
/* FT_ENCODING_APPLE_ROMAN :: */ /* FT_ENCODING_APPLE_ROMAN :: */
/* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
/* OpenType fonts contain a charmap for this encoding, since older */ /* and OpenType fonts contain a charmap for this encoding, since */
/* versions of Mac OS are able to use it. */ /* older versions of Mac OS are able to use it. */
/* */ /* */
/* FT_ENCODING_OLD_LATIN_2 :: */ /* FT_ENCODING_OLD_LATIN_2 :: */
/* This value is deprecated and was never used nor reported by */ /* This value is deprecated and was never used nor reported by */
/* FreeType. Don't use or test for it. */ /* FreeType. Don't use or test for it. */
/* */ /* */
/* FT_ENCODING_MS_SJIS :: */ /* FT_ENCODING_MS_SJIS :: */
/* Same as FT_ENCODING_SJIS. Deprecated. */ /* Same as FT_ENCODING_SJIS. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_GB2312 :: */ /* FT_ENCODING_MS_GB2312 :: */
/* Same as FT_ENCODING_GB2312. Deprecated. */ /* Same as FT_ENCODING_GB2312. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_BIG5 :: */ /* FT_ENCODING_MS_BIG5 :: */
/* Same as FT_ENCODING_BIG5. Deprecated. */ /* Same as FT_ENCODING_BIG5. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_WANSUNG :: */ /* FT_ENCODING_MS_WANSUNG :: */
/* Same as FT_ENCODING_WANSUNG. Deprecated. */ /* Same as FT_ENCODING_WANSUNG. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_JOHAB :: */ /* FT_ENCODING_MS_JOHAB :: */
/* Same as FT_ENCODING_JOHAB. Deprecated. */ /* Same as FT_ENCODING_JOHAB. Deprecated. */
/* */ /* */
/* <Note> */ /* <Note> */
/* By default, FreeType automatically synthesizes a Unicode charmap */ /* By default, FreeType automatically synthesizes a Unicode charmap */
/* for PostScript fonts, using their glyph names dictionaries. */ /* for PostScript fonts, using their glyph names dictionaries. */
/* However, it also reports the encodings defined explicitly in the */ /* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */ /* font file, for the cases when they are needed, with the Adobe */
/* values as well. */ /* values as well. */
/* */ /* */
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
/* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out which */ /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
/* encoding is really present. If, for example, the `cs_registry' */ /* which encoding is really present. If, for example, the */
/* field is `KOI8' and the `cs_encoding' field is `R', the font is */ /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
/* encoded in KOI8-R. */ /* the font is encoded in KOI8-R. */
/* */ /* */
/* FT_ENCODING_NONE is always set (with a single exception) by the */ /* FT_ENCODING_NONE is always set (with a single exception) by the */
/* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
/* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
/* which encoding is really present. For example, */ /* which encoding is really present. For example, */
/* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
/* Russian). */ /* Russian). */
/* */ /* */
/* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
/* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
/* FT_ENCODING_APPLE_ROMAN). */ /* FT_ENCODING_APPLE_ROMAN). */
/* */ /* */
/* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
/* @FT_Get_CMap_Language_ID to query the Mac language ID which may be */ /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
/* needed to be able to distinguish Apple encoding variants. See */ /* be needed to be able to distinguish Apple encoding variants. See */
/* */ /* */
/* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
/* */ /* */
/* to get an idea how to do that. Basically, if the language ID is~0, */ /* to get an idea how to do that. Basically, if the language ID */
/* don't use it, otherwise subtract 1 from the language ID. Then */ /* is~0, don't use it, otherwise subtract 1 from the language ID. */
/* examine `encoding_id'. If, for example, `encoding_id' is */ /* Then examine `encoding_id'. If, for example, `encoding_id' is */
/* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
/* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
/* variant the Arabic encoding. */ /* variant the Arabic encoding. */
/* */ /* */
typedef enum FT_Encoding_ typedef enum FT_Encoding_
{ {
@@ -907,8 +899,8 @@ FT_BEGIN_HEADER
/* charmap :: The current active charmap for this face. */ /* charmap :: The current active charmap for this face. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Fields may be changed after a call to @FT_Attach_File or */ /* Fields may be changed after a call to @FT_Attach_File or */
/* @FT_Attach_Stream. */ /* @FT_Attach_Stream. */
/* */ /* */
typedef struct FT_FaceRec_ typedef struct FT_FaceRec_
{ {
@@ -1485,7 +1477,7 @@ FT_BEGIN_HEADER
/* Only relevant for outline glyphs. */ /* Only relevant for outline glyphs. */
/* */ /* */
/* advance :: This is the transformed advance width for the */ /* advance :: This is the transformed advance width for the */
/* glyph. */ /* glyph (in 26.6 fractional pixel format). */
/* */ /* */
/* format :: This field indicates the format of the image */ /* format :: This field indicates the format of the image */
/* contained in the glyph slot. Typically */ /* contained in the glyph slot. Typically */
@@ -1692,26 +1684,26 @@ FT_BEGIN_HEADER
/* @FT_Open_Args structure. */ /* @FT_Open_Args structure. */
/* */ /* */
/* <Values> */ /* <Values> */
/* FT_OPEN_MEMORY :: This is a memory-based stream. */ /* FT_OPEN_MEMORY :: This is a memory-based stream. */
/* */ /* */
/* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
/* */ /* */
/* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
/* name. */ /* name. */
/* */ /* */
/* FT_OPEN_DRIVER :: Use the `driver' field. */ /* FT_OPEN_DRIVER :: Use the `driver' field. */
/* */ /* */
/* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
/* */ /* */
/* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
/* */ /* */
/* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
/* */ /* */
/* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
/* */ /* */
/* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
/* */ /* */
/* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
@@ -1736,8 +1728,8 @@ FT_BEGIN_HEADER
/* FT_Parameter */ /* FT_Parameter */
/* */ /* */
/* <Description> */ /* <Description> */
/* A simple structure used to pass more or less generic parameters */ /* A simple structure used to pass more or less generic parameters to */
/* to @FT_Open_Face. */ /* @FT_Open_Face. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* tag :: A four-byte identification tag. */ /* tag :: A four-byte identification tag. */
@@ -2128,8 +2120,8 @@ FT_BEGIN_HEADER
/* value. */ /* value. */
/* */ /* */
/* <Note> */ /* <Note> */
/* If `width' is zero, then the horizontal scaling value is set */ /* If `width' is zero, then the horizontal scaling value is set equal */
/* equal to the vertical scaling value, and vice versa. */ /* to the vertical scaling value, and vice versa. */
/* */ /* */
typedef struct FT_Size_RequestRec_ typedef struct FT_Size_RequestRec_
{ {
@@ -2456,6 +2448,7 @@ FT_BEGIN_HEADER
* *
* Besides deciding which hinter to use, you can also decide which * Besides deciding which hinter to use, you can also decide which
* hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
*
*/ */
#define FT_LOAD_DEFAULT 0x0 #define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1 #define FT_LOAD_NO_SCALE 0x1
@@ -2542,15 +2535,15 @@ FT_BEGIN_HEADER
* *
* FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
* } * }
*
*/ */
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
/************************************************************************** /**************************************************************************
@@ -2563,7 +2556,6 @@ FT_BEGIN_HEADER
* @FT_LOAD_TARGET_XXX value. * @FT_LOAD_TARGET_XXX value.
* *
*/ */
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
@@ -2611,9 +2603,9 @@ FT_BEGIN_HEADER
/* FreeType~2. Each mode corresponds to a specific type of scanline */ /* FreeType~2. Each mode corresponds to a specific type of scanline */
/* conversion performed on the outline. */ /* conversion performed on the outline. */
/* */ /* */
/* For bitmap fonts the `bitmap->pixel_mode' field in the */ /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
/* @FT_GlyphSlotRec structure gives the format of the returned */ /* field in the @FT_GlyphSlotRec structure gives the format of the */
/* bitmap. */ /* returned bitmap. */
/* */ /* */
/* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
/* */ /* */
@@ -2634,7 +2626,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* FT_RENDER_MODE_LCD :: */ /* FT_RENDER_MODE_LCD :: */
/* This mode corresponds to horizontal RGB and BGR sub-pixel */ /* This mode corresponds to horizontal RGB and BGR sub-pixel */
/* displays, like LCD-screens. It produces 8-bit bitmaps that are */ /* displays like LCD screens. It produces 8-bit bitmaps that are */
/* 3~times the width of the original glyph outline in pixels, and */ /* 3~times the width of the original glyph outline in pixels, and */
/* which use the @FT_PIXEL_MODE_LCD mode. */ /* which use the @FT_PIXEL_MODE_LCD mode. */
/* */ /* */
@@ -2645,11 +2637,16 @@ FT_BEGIN_HEADER
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
/* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
/* (not active in the default builds). It is up to the caller to */ /* (not active in the default builds). It is up to the caller to */
/* either call @FT_Library_SetLcdFilter (if available) or do the */ /* either call @FT_Library_SetLcdFilter (if available) or do the */
/* filtering itself. */ /* filtering itself. */
/* */
/* The selected render mode only affects vector glyphs of a font. */
/* Embedded bitmaps often have a different pixel mode like */
/* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
/* them into 8-bit pixmaps. */
/* */ /* */
typedef enum FT_Render_Mode_ typedef enum FT_Render_Mode_
{ {
@@ -2674,8 +2671,8 @@ FT_BEGIN_HEADER
/* @FT_Render_Mode values instead. */ /* @FT_Render_Mode values instead. */
/* */ /* */
/* <Values> */ /* <Values> */
/* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
/* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
/* */ /* */
#define ft_render_mode_normal FT_RENDER_MODE_NORMAL #define ft_render_mode_normal FT_RENDER_MODE_NORMAL
#define ft_render_mode_mono FT_RENDER_MODE_MONO #define ft_render_mode_mono FT_RENDER_MODE_MONO
@@ -2822,14 +2819,14 @@ FT_BEGIN_HEADER
/* Return the track kerning for a given face object at a given size. */ /* Return the track kerning for a given face object at a given size. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to a source face object. */ /* face :: A handle to a source face object. */
/* */ /* */
/* point_size :: The point size in 16.16 fractional points. */ /* point_size :: The point size in 16.16 fractional points. */
/* */ /* */
/* degree :: The degree of tightness. */ /* degree :: The degree of tightness. */
/* */ /* */
/* <Output> */ /* <Output> */
/* akerning :: The kerning in 16.16 fractional points. */ /* akerning :: The kerning in 16.16 fractional points. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
@@ -3060,7 +3057,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* Note that `*agindex' is set to~0 if the charmap is empty. The */ /* Note that `*agindex' is set to~0 if the charmap is empty. The */
/* result itself can be~0 in two cases: if the charmap is empty or */ /* result itself can be~0 in two cases: if the charmap is empty or */
/* when the value~0 is the first valid character code. */ /* if the value~0 is the first valid character code. */
/* */ /* */
FT_EXPORT( FT_ULong ) FT_EXPORT( FT_ULong )
FT_Get_First_Char( FT_Face face, FT_Get_First_Char( FT_Face face,
@@ -3082,7 +3079,7 @@ FT_BEGIN_HEADER
/* char_code :: The starting character code. */ /* char_code :: The starting character code. */
/* */ /* */
/* <Output> */ /* <Output> */
/* agindex :: Glyph index of first character code. 0~if charmap */ /* agindex :: Glyph index of next character code. 0~if charmap */
/* is empty. */ /* is empty. */
/* */ /* */
/* <Return> */ /* <Return> */
@@ -3159,15 +3156,16 @@ FT_BEGIN_HEADER
* *
* @description: * @description:
* Retrieve a description of a given subglyph. Only use it if * Retrieve a description of a given subglyph. Only use it if
* `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
* returned. * returned otherwise.
* *
* @input: * @input:
* glyph :: * glyph ::
* The source glyph slot. * The source glyph slot.
* *
* sub_index :: * sub_index ::
* The index of subglyph. Must be less than `glyph->num_subglyphs'. * The index of the subglyph. Must be less than
* `glyph->num_subglyphs'.
* *
* @output: * @output:
* p_index :: * p_index ::
@@ -3739,26 +3737,27 @@ FT_BEGIN_HEADER
/************************************************************************* /*************************************************************************
* *
* @enum: * @enum:
* FREETYPE_XXX * FREETYPE_XXX
* *
* @description: * @description:
* These three macros identify the FreeType source code version. * These three macros identify the FreeType source code version.
* Use @FT_Library_Version to access them at runtime. * Use @FT_Library_Version to access them at runtime.
* *
* @values: * @values:
* FREETYPE_MAJOR :: The major version number. * FREETYPE_MAJOR :: The major version number.
* FREETYPE_MINOR :: The minor version number. * FREETYPE_MINOR :: The minor version number.
* FREETYPE_PATCH :: The patch level. * FREETYPE_PATCH :: The patch level.
*
* @note:
* The version number of FreeType if built as a dynamic link library
* with the `libtool' package is _not_ controlled by these three
* macros.
* *
* @note:
* The version number of FreeType if built as a dynamic link library
* with the `libtool' package is _not_ controlled by these three
* macros.
*/ */
#define FREETYPE_MAJOR 2 #define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 3 #define FREETYPE_MINOR 3
#define FREETYPE_PATCH 8 #define FREETYPE_PATCH 9
/*************************************************************************/ /*************************************************************************/
+69 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType API for accessing CID font information (specification). */ /* FreeType API for accessing CID font information (specification). */
/* */ /* */
/* Copyright 2007 by Dereg Clegg. */ /* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@@ -88,6 +88,74 @@ FT_BEGIN_HEADER
const char* *ordering, const char* *ordering,
FT_Int *supplement); FT_Int *supplement);
/**********************************************************************
*
* @function:
* FT_Get_CID_Is_Internally_CID_Keyed
*
* @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.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* is_cid ::
* The type of the face as an @FT_Bool.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid );
/**********************************************************************
*
* @function:
* FT_Get_CID_From_Glyph_Index
*
* @description:
* Retrieve the CID of the input glyph index.
*
* @input:
* face ::
* A handle to the input face.
*
* glyph_index ::
* The input glyph index.
*
* @output:
* cid ::
* The CID as an @FT_UInt.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
/* */ /* */
FT_END_HEADER FT_END_HEADER
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType convenience functions to handle glyphs (specification). */ /* FreeType convenience functions to handle glyphs (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -194,7 +194,7 @@ FT_BEGIN_HEADER
/* outline :: A descriptor for the outline. */ /* outline :: A descriptor for the outline. */
/* */ /* */
/* <Note> */ /* <Note> */
/* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */ /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
/* the outline's content easily. */ /* the outline's content easily. */
/* */ /* */
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType Multiple Master font interface (specification). */ /* FreeType Multiple Master font interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -257,7 +257,7 @@ FT_BEGIN_HEADER
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Output> */ /* <Output> */
/* amaster :: The Multiple Masters descriptor. */ /* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free */ /* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */ /* (a single call to FT_FREE will do it). */
/* */ /* */
+4 -5
View File
@@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */ /* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */ /* most scalable font formats (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -130,8 +130,7 @@ FT_BEGIN_HEADER
/* numContours :: The maximal number of contours within the outline. */ /* numContours :: The maximal number of contours within the outline. */
/* */ /* */
/* <Output> */ /* <Output> */
/* anoutline :: A handle to the new outline. NULL in case of */ /* anoutline :: A handle to the new outline. */
/* error. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
@@ -362,7 +361,7 @@ FT_BEGIN_HEADER
/* outline :: A pointer to the target outline descriptor. */ /* outline :: A pointer to the target outline descriptor. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
/* the outline's `flags' field. */ /* the outline's `flags' field. */
/* */ /* */
/* It shouldn't be used by a normal client application, unless it */ /* It shouldn't be used by a normal client application, unless it */
@@ -416,7 +415,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Render an outline within a bitmap using the current scan-convert. */ /* Render an outline within a bitmap using the current scan-convert. */
/* This functions uses an @FT_Raster_Params structure as an argument, */ /* This function uses an @FT_Raster_Params structure as an argument, */
/* allowing advanced features like direct composition, translucency, */ /* allowing advanced features like direct composition, translucency, */
/* etc. */ /* etc. */
/* */ /* */
+3 -3
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType API for accessing PFR-specific data (specification only). */ /* FreeType API for accessing PFR-specific data (specification only). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -62,8 +62,8 @@ FT_BEGIN_HEADER
* *
* @output: * @output:
* aoutline_resolution :: * aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'. * Outline resolution. This is equivalent to `face->units_per_EM'
* Optional (parameter can be NULL). * for non-PFR fonts. Optional (parameter can be NULL).
* *
* ametrics_resolution :: * ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution' * Metrics resolution. This is equivalent to `outline_resolution'
+3 -3
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType size objects management (specification). */ /* FreeType size objects management (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -129,8 +129,8 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Even though it is possible to create several size objects for a */ /* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */ /* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */ /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
/* determine the `current character pixel size'. */ /* activated last to determine the `current character pixel size'. */
/* */ /* */
/* This function can be used to `activate' a previously created size */ /* This function can be used to `activate' a previously created size */
/* object. */ /* object. */
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType path stroker (specification). */ /* FreeType path stroker (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -171,7 +171,7 @@ FT_BEGIN_HEADER
* The source outline handle. * The source outline handle.
* *
* @return: * @return:
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
* outlines. * outlines.
*/ */
FT_EXPORT( FT_StrokerBorder ) FT_EXPORT( FT_StrokerBorder )
@@ -197,6 +197,7 @@ FT_BEGIN_HEADER
{ {
T1_FIELD_LOCATION_CID_INFO, T1_FIELD_LOCATION_CID_INFO,
T1_FIELD_LOCATION_FONT_DICT, T1_FIELD_LOCATION_FONT_DICT,
T1_FIELD_LOCATION_FONT_EXTRA,
T1_FIELD_LOCATION_FONT_INFO, T1_FIELD_LOCATION_FONT_INFO,
T1_FIELD_LOCATION_PRIVATE, T1_FIELD_LOCATION_PRIVATE,
T1_FIELD_LOCATION_BBOX, T1_FIELD_LOCATION_BBOX,
@@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType CID font services (specification). */ /* The FreeType CID font services (specification). */
/* */ /* */
/* Copyright 2007 by Derek Clegg. */ /* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@@ -31,10 +31,19 @@ FT_BEGIN_HEADER
const char* *registry, const char* *registry,
const char* *ordering, const char* *ordering,
FT_Int *supplement ); FT_Int *supplement );
typedef FT_Error
(*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
FT_Bool *is_cid );
typedef FT_Error
(*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
FT_DEFINE_SERVICE( CID ) FT_DEFINE_SERVICE( CID )
{ {
FT_CID_GetRegistryOrderingSupplementFunc get_ros; FT_CID_GetRegistryOrderingSupplementFunc get_ros;
FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
}; };
/* */ /* */
@@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType PostScript info service (specification). */ /* The FreeType PostScript info service (specification). */
/* */ /* */
/* Copyright 2003, 2004 by */ /* Copyright 2003, 2004, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -33,6 +33,10 @@ FT_BEGIN_HEADER
(*PS_GetFontInfoFunc)( FT_Face face, (*PS_GetFontInfoFunc)( FT_Face face,
PS_FontInfoRec* afont_info ); PS_FontInfoRec* afont_info );
typedef FT_Error
(*PS_GetFontExtraFunc)( FT_Face face,
PS_FontExtraRec* afont_extra );
typedef FT_Int typedef FT_Int
(*PS_HasGlyphNamesFunc)( FT_Face face ); (*PS_HasGlyphNamesFunc)( FT_Face face );
@@ -44,6 +48,7 @@ FT_BEGIN_HEADER
FT_DEFINE_SERVICE( PsInfo ) FT_DEFINE_SERVICE( PsInfo )
{ {
PS_GetFontInfoFunc ps_get_font_info; PS_GetFontInfoFunc ps_get_font_info;
PS_GetFontExtraFunc ps_get_font_extra;
PS_HasGlyphNamesFunc ps_has_glyph_names; PS_HasGlyphNamesFunc ps_has_glyph_names;
PS_GetFontPrivateFunc ps_get_font_private; PS_GetFontPrivateFunc ps_get_font_private;
}; };
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */ /* Basic Type1/Type2 type definitions and interface (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -87,11 +87,24 @@ FT_BEGIN_HEADER
} T1_EncodingType; } T1_EncodingType;
/* used to hold extra data of PS_FontInfoRec that
* cannot be stored in the publicly defined structure.
*
* Note these can't be blended with multiple-masters.
*/
typedef struct PS_FontExtraRec_
{
FT_UShort fs_type;
} PS_FontExtraRec;
typedef struct T1_FontRec_ typedef struct T1_FontRec_
{ {
PS_FontInfoRec font_info; /* font info dictionary */ PS_FontInfoRec font_info; /* font info dictionary */
PS_PrivateRec private_dict; /* private dictionary */ PS_FontExtraRec font_extra; /* font info extra fields */
FT_String* font_name; /* top-level dictionary */ PS_PrivateRec private_dict; /* private dictionary */
FT_String* font_name; /* top-level dictionary */
T1_EncodingType encoding_type; T1_EncodingType encoding_type;
T1_EncodingRec encoding; T1_EncodingRec encoding;
@@ -231,6 +244,7 @@ FT_BEGIN_HEADER
void* psnames; void* psnames;
void* psaux; void* psaux;
CID_FaceInfoRec cid; CID_FaceInfoRec cid;
PS_FontExtraRec font_extra;
#if 0 #if 0
void* afm_data; void* afm_data;
#endif #endif
+4 -8
View File
@@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */ /* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -78,10 +78,6 @@ FT_BEGIN_HEADER
FT_Short underline_position; FT_Short underline_position;
FT_UShort underline_thickness; FT_UShort underline_thickness;
/* since 2.3.8 */
FT_UShort fs_type;
} PS_FontInfoRec; } PS_FontInfoRec;
@@ -486,11 +482,11 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* The string pointers within the font info structure are owned by * The string pointers within the @PS_PrivateRec structure are owned by
* the face and don't need to be freed by the caller. * the face and don't need to be freed by the caller.
* *
* If the font's format is not PostScript-based, this function will * If the font's format is not PostScript-based, this function returns
* return the `FT_Err_Invalid_Argument' error code. * the `FT_Err_Invalid_Argument' error code.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
+2 -2
View File
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */ /* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */ /* (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -695,7 +695,7 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* SFNT tables with length zero are treated as missing by Windows. * SFNT tables with length zero are treated as missing.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
+9 -7
View File
@@ -21,8 +21,10 @@ UseFreeTypeHeaders ;
if $(FT2_MULTI) if $(FT2_MULTI)
{ {
_sources = ftutil ftdbgmem ftstream ftcalc fttrigon ftgloadr ftoutln _sources = ftadvanc ftcalc ftdbgmem ftgloadr
ftobjs ftnames ftrfork ; ftnames ftobjs ftoutln ftrfork
ftstream fttrigon ftutil
;
} }
else else
{ {
@@ -35,11 +37,11 @@ UseFreeTypeHeaders ;
# Add the optional/replaceable files. # Add the optional/replaceable files.
# #
{ {
local _sources = system init glyph mm bdf local _sources = bbox bdf bitmap debug gasp
bbox debug xf86 type1 pfr glyph gxval init lcdfil mm
stroke winfnt otval bitmap synth otval pfr stroke synth system
gxval lcdfil gasp patent type1 winfnt xf86 patent
; ;
FT2_Library $(FT2_LIB) : ft$(_sources).c ; FT2_Library $(FT2_LIB) : ft$(_sources).c ;
} }
+5 -5
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Quick computation of advance widths (body). */ /* Quick computation of advance widths (body). */
/* */ /* */
/* Copyright 2008 by */ /* Copyright 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -42,8 +42,8 @@
else else
scale = face->size->metrics.x_scale; scale = face->size->metrics.x_scale;
/* this must be the same computation as to get linearHori/VertAdvance */ /* this must be the same scaling as to get linear{Hori,Vert}Advance */
/* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c */ /* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c) */
for ( nn = 0; nn < count; nn++ ) for ( nn = 0; nn < count; nn++ )
advances[nn] = FT_MulDiv( advances[nn], scale, 64 ); advances[nn] = FT_MulDiv( advances[nn], scale, 64 );
@@ -148,8 +148,8 @@
break; break;
padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT ) padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? face->glyph->advance.x ? face->glyph->advance.y
: face->glyph->advance.y; : face->glyph->advance.x;
} }
if ( error ) if ( error )
+55 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType API for accessing CID font information. */ /* FreeType API for accessing CID font information. */
/* */ /* */
/* Copyright 2007 by Derek Clegg. */ /* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@@ -16,6 +16,7 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_CID_H
#include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_CID_H #include FT_SERVICE_CID_H
@@ -60,4 +61,57 @@
} }
FT_EXPORT_DEF( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid )
{
FT_Error error = FT_Err_Invalid_Argument;
FT_Bool ic = 0;
if ( face )
{
FT_Service_CID service;
FT_FACE_FIND_SERVICE( face, service, CID );
if ( service && service->get_is_cid )
error = service->get_is_cid( face, &ic);
}
if ( is_cid )
*is_cid = ic;
return error;
}
FT_EXPORT_DEF( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid )
{
FT_Error error = FT_Err_Invalid_Argument;
FT_UInt c = 0;
if ( face )
{
FT_Service_CID service;
FT_FACE_FIND_SERVICE( face, service, CID );
if ( service && service->get_cid_from_glyph_index )
error = service->get_cid_from_glyph_index( face, glyph_index, &c);
}
if ( cid )
*cid = c;
return error;
}
/* END */ /* END */
+62
View File
@@ -0,0 +1,62 @@
/***************************************************************************/
/* */
/* ftfstype.c */
/* */
/* FreeType utility file to access FSType data (body). */
/* */
/* Copyright 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
#include FT_TRUETYPE_TABLES_H
#include FT_INTERNAL_SERVICE_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_UShort )
FT_Get_FSType_Flags( FT_Face face )
{
TT_OS2* os2;
/* first, try to get the fs_type directly from the font */
if ( face )
{
FT_Service_PsInfo service = NULL;
FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
if ( service && service->ps_get_font_extra )
{
PS_FontExtraRec extra;
if ( !service->ps_get_font_extra( face, &extra ) &&
extra.fs_type != 0 )
return extra.fs_type;
}
}
/* look at FSType before fsType for Type42 */
if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL &&
os2->version != 0xFFFFU )
return os2->fsType;
return 0;
}
/* END */
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Multiple Master font support (body). */ /* Multiple Master font support (body). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004 by */ /* Copyright 1996-2001, 2003, 2004, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -52,7 +52,7 @@
*aservice, *aservice,
MULTI_MASTERS ); MULTI_MASTERS );
if ( aservice ) if ( *aservice )
error = FT_Err_Ok; error = FT_Err_Ok;
} }
+24 -30
View File
@@ -1140,6 +1140,7 @@
args.flags = FT_OPEN_PATHNAME; args.flags = FT_OPEN_PATHNAME;
args.pathname = (char*)pathname; args.pathname = (char*)pathname;
args.stream = NULL;
return FT_Open_Face( library, &args, face_index, aface ); return FT_Open_Face( library, &args, face_index, aface );
} }
@@ -1166,6 +1167,7 @@
args.flags = FT_OPEN_MEMORY; args.flags = FT_OPEN_MEMORY;
args.memory_base = file_base; args.memory_base = file_base;
args.memory_size = file_size; args.memory_size = file_size;
args.stream = NULL;
return FT_Open_Face( library, &args, face_index, aface ); return FT_Open_Face( library, &args, face_index, aface );
} }
@@ -1417,7 +1419,7 @@
&length, &length,
&is_sfnt_cid ); &is_sfnt_cid );
if ( error ) if ( error )
return error; goto Exit;
if ( FT_Stream_Seek( stream, pos + offset ) ) if ( FT_Stream_Seek( stream, pos + offset ) )
goto Exit; goto Exit;
@@ -1436,8 +1438,19 @@
is_sfnt_cid ? "cid" : "type1", is_sfnt_cid ? "cid" : "type1",
aface ); aface );
Exit: Exit:
FT_Stream_Seek( stream, pos ); {
return error; FT_Error error1;
if ( error == FT_Err_Unknown_File_Format )
{
error1 = FT_Stream_Seek( stream, pos );
if ( error1 )
return error1;
}
return error;
}
} }
@@ -1605,6 +1618,10 @@
if ( !error ) if ( !error )
goto Exit; goto Exit;
/* rewind sfnt stream before open_face_PS_from_sfnt_stream() */
if ( FT_Stream_Seek( stream, flag_offset + 4 ) )
goto Exit;
if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) ) if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )
return error; return error;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen ); error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );
@@ -2450,8 +2467,8 @@
} }
else else
{ {
metrics->x_scale = 1L << 22; metrics->x_scale = 1L << 16;
metrics->y_scale = 1L << 22; metrics->y_scale = 1L << 16;
metrics->ascender = bsize->y_ppem; metrics->ascender = bsize->y_ppem;
metrics->descender = 0; metrics->descender = 0;
metrics->height = bsize->height << 6; metrics->height = bsize->height << 6;
@@ -2562,8 +2579,8 @@
else else
{ {
FT_ZERO( metrics ); FT_ZERO( metrics );
metrics->x_scale = 1L << 22; metrics->x_scale = 1L << 16;
metrics->y_scale = 1L << 22; metrics->y_scale = 1L << 16;
} }
} }
@@ -4378,27 +4395,4 @@
} }
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_UShort )
FT_Get_FSType_Flags( FT_Face face )
{
PS_FontInfoRec font_info;
TT_OS2* os2;
/* look at FSType before fsType for Type42 */
if ( !FT_Get_PS_Font_Info( face, &font_info ) &&
font_info.fs_type != 0 )
return font_info.fs_type;
if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL &&
os2->version != 0xFFFFU )
return os2->fsType;
return 0;
}
/* END */ /* END */
+6 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Embedded resource forks accessor (body). */ /* Embedded resource forks accessor (body). */
/* */ /* */
/* Copyright 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
/* Masatake YAMATO and Redhat K.K. */ /* Masatake YAMATO and Redhat K.K. */
/* */ /* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */ /* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -709,8 +709,12 @@
return FT_Err_Ok; return FT_Err_Ok;
} }
else else
FT_Stream_Skip( stream, 4 + 4 ); /* offset + length */ {
error = FT_Stream_Skip( stream, 4 + 4 ); /* offset + length */
if ( error )
return error;
} }
}
return FT_Err_Unknown_File_Format; return FT_Err_Unknown_File_Format;
} }
+1 -4
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType path stroker (body). */ /* FreeType path stroker (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -606,9 +606,6 @@
if ( tags[0] & FT_STROKE_TAG_END ) if ( tags[0] & FT_STROKE_TAG_END )
{ {
if ( in_contour == 0 )
goto Fail;
in_contour = 0; in_contour = 0;
num_contours++; num_contours++;
} }
+5 -4
View File
@@ -3,7 +3,7 @@
# #
# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by # Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@@ -33,7 +33,8 @@ BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
# All files listed here should be included in `ftbase.c' (for a `single' # All files listed here should be included in `ftbase.c' (for a `single'
# build). # build).
# #
BASE_SRC := $(BASE_DIR)/ftcalc.c \ BASE_SRC := $(BASE_DIR)/ftadvanc.c \
$(BASE_DIR)/ftcalc.c \
$(BASE_DIR)/ftdbgmem.c \ $(BASE_DIR)/ftdbgmem.c \
$(BASE_DIR)/ftgloadr.c \ $(BASE_DIR)/ftgloadr.c \
$(BASE_DIR)/ftnames.c \ $(BASE_DIR)/ftnames.c \
@@ -42,8 +43,8 @@ BASE_SRC := $(BASE_DIR)/ftcalc.c \
$(BASE_DIR)/ftrfork.c \ $(BASE_DIR)/ftrfork.c \
$(BASE_DIR)/ftstream.c \ $(BASE_DIR)/ftstream.c \
$(BASE_DIR)/fttrigon.c \ $(BASE_DIR)/fttrigon.c \
$(BASE_DIR)/ftutil.c \ $(BASE_DIR)/ftutil.c
$(BASE_DIR)/ftadvanc.c
ifneq ($(ftmac_c),) ifneq ($(ftmac_c),)
BASE_SRC += $(BASE_DIR)/$(ftmac_c) BASE_SRC += $(BASE_DIR)/$(ftmac_c)
+8 -1
View File
@@ -1,6 +1,6 @@
/* /*
* Copyright 2000 Computing Research Labs, New Mexico State University * Copyright 2000 Computing Research Labs, New Mexico State University
* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
* Francesco Zappa Nardelli * Francesco Zappa Nardelli
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
@@ -1394,6 +1394,12 @@
font->font_descent = fp->value.int32; font->font_descent = fp->value.int32;
else if ( ft_memcmp( name, "SPACING", 7 ) == 0 ) else if ( ft_memcmp( name, "SPACING", 7 ) == 0 )
{ {
if ( !fp->value.atom )
{
error = BDF_Err_Invalid_File_Format;
goto Exit;
}
if ( fp->value.atom[0] == 'p' || fp->value.atom[0] == 'P' ) if ( fp->value.atom[0] == 'p' || fp->value.atom[0] == 'P' )
font->spacing = BDF_PROPORTIONAL; font->spacing = BDF_PROPORTIONAL;
else if ( fp->value.atom[0] == 'm' || fp->value.atom[0] == 'M' ) else if ( fp->value.atom[0] == 'm' || fp->value.atom[0] == 'M' )
@@ -2072,6 +2078,7 @@
error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
if ( error ) if ( error )
goto Exit; goto Exit;
/* at this point, `p->font' can't be NULL */
p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 ); p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 );
if ( FT_NEW_ARRAY( p->font->props, p->cnt ) ) if ( FT_NEW_ARRAY( p->font->props, p->cnt ) )
+3 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* FreeType Cache Manager (body). */ /* FreeType Cache Manager (body). */
/* */ /* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -608,7 +608,8 @@
} }
Exit: Exit:
*acache = cache; if ( acache )
*acache = cache;
return error; return error;
} }
+75 -9
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* OpenType font driver implementation (body). */ /* OpenType font driver implementation (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -188,29 +188,28 @@
FT_CALLBACK_DEF( FT_Error ) FT_CALLBACK_DEF( FT_Error )
cff_get_advances( FT_Face ftface, cff_get_advances( FT_Face face,
FT_UInt start, FT_UInt start,
FT_UInt count, FT_UInt count,
FT_Int32 flags, FT_Int32 flags,
FT_Fixed* advances ) FT_Fixed* advances )
{ {
CFF_Face face = (CFF_Face)ftface;
FT_UInt nn; FT_UInt nn;
FT_Error error = CFF_Err_Ok; FT_Error error = CFF_Err_Ok;
FT_GlyphSlot slot = face->root.glyph; FT_GlyphSlot slot = face->glyph;
flags |= FT_LOAD_ADVANCE_ONLY; flags |= FT_LOAD_ADVANCE_ONLY;
for ( nn = 0; nn < count; nn++ ) for ( nn = 0; nn < count; nn++ )
{ {
error = Load_Glyph( slot, face->root.size, start+nn, flags ); error = Load_Glyph( slot, face->size, start + nn, flags );
if ( error ) if ( error )
break; break;
advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT ) advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? slot->advance.y ? slot->linearVertAdvance
: slot->advance.x; : slot->linearHoriAdvance;
} }
return error; return error;
@@ -371,7 +370,8 @@
cff->font_info = font_info; cff->font_info = font_info;
} }
*afont_info = *cff->font_info; if ( cff )
*afont_info = *cff->font_info;
Fail: Fail:
return error; return error;
@@ -381,6 +381,7 @@
static const FT_Service_PsInfoRec cff_service_ps_info = static const FT_Service_PsInfoRec cff_service_ps_info =
{ {
(PS_GetFontInfoFunc) cff_ps_get_font_info, (PS_GetFontInfoFunc) cff_ps_get_font_info,
(PS_GetFontExtraFunc) NULL,
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,
(PS_GetFontPrivateFunc)NULL /* unsupported with CFF fonts */ (PS_GetFontPrivateFunc)NULL /* unsupported with CFF fonts */
}; };
@@ -506,9 +507,74 @@
} }
static FT_Error
cff_get_is_cid( CFF_Face face,
FT_Bool *is_cid )
{
FT_Error error = CFF_Err_Ok;
CFF_Font cff = (CFF_Font)face->extra.data;
*is_cid = 0;
if ( cff )
{
CFF_FontRecDict dict = &cff->top_font.font_dict;
if ( dict->cid_registry != 0xFFFFU )
*is_cid = 1;
}
return error;
}
static FT_Error
cff_get_cid_from_glyph_index( CFF_Face face,
FT_UInt glyph_index,
FT_UInt *cid )
{
FT_Error error = CFF_Err_Ok;
CFF_Font cff;
cff = (CFF_Font)face->extra.data;
if ( cff )
{
FT_UInt c;
CFF_FontRecDict dict = &cff->top_font.font_dict;
if ( dict->cid_registry == 0xFFFFU )
{
error = CFF_Err_Invalid_Argument;
goto Fail;
}
if ( glyph_index > cff->num_glyphs )
{
error = CFF_Err_Invalid_Argument;
goto Fail;
}
c = cff->charset.sids[glyph_index];
if ( cid )
*cid = c;
}
Fail:
return error;
}
static const FT_Service_CIDRec cff_service_cid_info = static const FT_Service_CIDRec cff_service_cid_info =
{ {
(FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros,
(FT_CID_GetIsInternallyCIDKeyedFunc) cff_get_is_cid,
(FT_CID_GetCIDFromGlyphIndexFunc) cff_get_cid_from_glyph_index
}; };
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* OpenType Glyph Loader (body). */ /* OpenType Glyph Loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -420,7 +420,7 @@
sub = cff->subfonts[fd_index]; sub = cff->subfonts[fd_index];
if ( builder->hints_funcs ) if ( builder->hints_funcs && size )
{ {
CFF_Internal internal = (CFF_Internal)size->root.internal; CFF_Internal internal = (CFF_Internal)size->root.internal;
+3 -5
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* OpenType and CFF data/program tables loader (body). */ /* OpenType and CFF data/program tables loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -319,7 +319,7 @@
static FT_Error static FT_Error
cff_index_load_offsets( CFF_Index idx ) cff_index_load_offsets( CFF_Index idx )
{ {
FT_Error error = 0; FT_Error error = CFF_Err_Ok;
FT_Stream stream = idx->stream; FT_Stream stream = idx->stream;
FT_Memory memory = stream->memory; FT_Memory memory = stream->memory;
@@ -402,6 +402,7 @@
old_offset = 1; old_offset = 1;
for ( n = 0; n <= idx->count; n++ ) for ( n = 0; n <= idx->count; n++ )
{ {
/* at this point, `idx->offsets' can't be NULL */
offset = idx->offsets[n]; offset = idx->offsets[n];
if ( !offset ) if ( !offset )
offset = old_offset; offset = old_offset;
@@ -1540,9 +1541,6 @@
if ( error ) if ( error )
goto Exit; goto Exit;
} }
else
/* CID-keyed fonts only need CIDs */
FT_FREE( font->charset.sids );
} }
/* get the font name (/CIDFontName for CID-keyed fonts, */ /* get the font name (/CIDFontName for CID-keyed fonts, */
+2 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* CFF token stream parser (body) */ /* CFF token stream parser (body) */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -244,7 +244,7 @@
if ( !nib && !number ) if ( !nib && !number )
exponent_add--; exponent_add--;
/* Only add digit if we don't overflow. */ /* Only add digit if we don't overflow. */
else if ( number < 0xCCCCCCCL ) else if ( number < 0xCCCCCCCL && fraction_length < 9 )
{ {
fraction_length++; fraction_length++;
number = number * 10 + nib; number = number * 10 + nib;
+5 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* CID-keyed Type1 font loader (body). */ /* CID-keyed Type1 font loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -97,6 +97,10 @@
object = (FT_Byte*)&cid->font_info; object = (FT_Byte*)&cid->font_info;
break; break;
case T1_FIELD_LOCATION_FONT_EXTRA:
object = (FT_Byte*)&face->font_extra;
break;
case T1_FIELD_LOCATION_BBOX: case T1_FIELD_LOCATION_BBOX:
object = (FT_Byte*)&cid->font_bbox; object = (FT_Byte*)&cid->font_bbox;
break; break;
+46 -3
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* CID driver interface (body). */ /* CID driver interface (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -74,13 +74,23 @@
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((CID_Face)face)->cid.font_info; *afont_info = ((CID_Face)face)->cid.font_info;
return 0;
return CID_Err_Ok;
} }
static FT_Error
cid_ps_get_font_extra( FT_Face face,
PS_FontExtraRec* afont_extra )
{
*afont_extra = ((CID_Face)face)->font_extra;
return CID_Err_Ok;
}
static const FT_Service_PsInfoRec cid_service_ps_info = static const FT_Service_PsInfoRec cid_service_ps_info =
{ {
(PS_GetFontInfoFunc) cid_ps_get_font_info, (PS_GetFontInfoFunc) cid_ps_get_font_info,
(PS_GetFontExtraFunc) cid_ps_get_font_extra,
(PS_HasGlyphNamesFunc) NULL, /* unsupported with CID fonts */ (PS_HasGlyphNamesFunc) NULL, /* unsupported with CID fonts */
(PS_GetFontPrivateFunc)NULL /* unsupported */ (PS_GetFontPrivateFunc)NULL /* unsupported */
}; };
@@ -112,9 +122,42 @@
} }
static FT_Error
cid_get_is_cid( CID_Face face,
FT_Bool *is_cid )
{
FT_Error error = CID_Err_Ok;
FT_UNUSED( face );
if ( is_cid )
*is_cid = 1; /* cid driver is only used for CID keyed fonts */
return error;
}
static FT_Error
cid_get_cid_from_glyph_index( CID_Face face,
FT_UInt glyph_index,
FT_UInt *cid )
{
FT_Error error = CID_Err_Ok;
FT_UNUSED( face );
if ( cid )
*cid = glyph_index; /* identity mapping */
return error;
}
static const FT_Service_CIDRec cid_service_cid_info = static const FT_Service_CIDRec cid_service_cid_info =
{ {
(FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros (FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros,
(FT_CID_GetIsInternallyCIDKeyedFunc) cid_get_is_cid,
(FT_CID_GetCIDFromGlyphIndexFunc) cid_get_cid_from_glyph_index
}; };
+7 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* CID token definitions (specification only). */ /* CID token definitions (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -48,6 +48,12 @@
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 ) T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 )
T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 ) T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 ) T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontExtraRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
T1_FIELD_NUM ( "FSType", fs_type, 0 ) T1_FIELD_NUM ( "FSType", fs_type, 0 )
+1 -1
View File
@@ -569,7 +569,7 @@
if ( error ) if ( error )
result = 0; result = 0;
FT_Stream_Seek( stream, old_pos ); (void)FT_Stream_Seek( stream, old_pos );
} }
return result; return result;
+4 -2
View File
@@ -2,7 +2,7 @@
FreeType font driver for pcf files FreeType font driver for pcf files
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008 by Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by
Francesco Zappa Nardelli Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -442,7 +442,7 @@ THE SOFTWARE.
FT_Int32 load_flags ) FT_Int32 load_flags )
{ {
PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
FT_Stream stream = face->root.stream; FT_Stream stream;
FT_Error error = PCF_Err_Ok; FT_Error error = PCF_Err_Ok;
FT_Bitmap* bitmap = &slot->bitmap; FT_Bitmap* bitmap = &slot->bitmap;
PCF_Metric metric; PCF_Metric metric;
@@ -459,6 +459,8 @@ THE SOFTWARE.
goto Exit; goto Exit;
} }
stream = face->root.stream;
if ( glyph_index > 0 ) if ( glyph_index > 0 )
glyph_index--; glyph_index--;
+7 -3
View File
@@ -2,7 +2,7 @@
FreeType font driver for pcf fonts FreeType font driver for pcf fonts
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by
Francesco Zappa Nardelli Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -470,7 +470,11 @@ THE SOFTWARE.
if ( nprops & 3 ) if ( nprops & 3 )
{ {
i = 4 - ( nprops & 3 ); i = 4 - ( nprops & 3 );
FT_Stream_Skip( stream, i ); if ( FT_STREAM_SKIP( i ) )
{
error = PCF_Err_Invalid_Stream_Skip;
goto Bail;
}
} }
if ( PCF_BYTE_ORDER( format ) == MSBFirst ) if ( PCF_BYTE_ORDER( format ) == MSBFirst )
@@ -623,7 +627,7 @@ THE SOFTWARE.
metrics = face->metrics; metrics = face->metrics;
for ( i = 0; i < nmetrics; i++ ) for ( i = 0; i < nmetrics; i++ )
{ {
pcf_get_metric( stream, format, metrics + i ); error = pcf_get_metric( stream, format, metrics + i );
metrics[i].bits = 0; metrics[i].bits = 0;
+3 -3
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType glyph rasterizer (body). */ /* The FreeType glyph rasterizer (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -811,10 +811,10 @@ a };
n = ras.num_Profs; n = ras.num_Profs;
p = ras.fProfile;
if ( n > 1 ) if ( n > 1 && p )
{ {
p = ras.fProfile;
while ( n > 0 ) while ( n > 0 )
{ {
if ( n > 1 ) if ( n > 1 )
+6 -3
View File
@@ -3,7 +3,7 @@
# #
# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007 by # Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@@ -37,8 +37,11 @@ SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \
# SFNT driver headers # SFNT driver headers
# #
SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) \ # Note that ttsbit0.c gets #included by ttsbit.c.
$(SFNT_DIR)/sferrors.h #
SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) \
$(SFNT_DIR)/sferrors.h \
$(SFNT_DIR)/ttsbit0.c
# SFNT driver object(s) # SFNT driver object(s)
+27 -2
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* High-level SFNT driver interface (body). */ /* High-level SFNT driver interface (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -151,10 +151,35 @@
} }
static FT_UInt
sfnt_get_name_index( TT_Face face,
FT_String* glyph_name )
{
FT_Face root = &face->root;
FT_Long i;
for ( i = 0; i < root->num_glyphs; i++ )
{
FT_String* gname;
FT_Error error = tt_face_get_ps_name( face, i, &gname );
if ( error )
continue;
if ( !ft_strcmp( glyph_name, gname ) )
return (FT_UInt)i;
}
return 0;
}
static const FT_Service_GlyphDictRec sfnt_service_glyph_dict = static const FT_Service_GlyphDictRec sfnt_service_glyph_dict =
{ {
(FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name,
(FT_GlyphDict_NameIndexFunc)NULL (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index
}; };
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+68 -67
View File
@@ -408,7 +408,7 @@
face->ttc_header.version = 1 << 16; face->ttc_header.version = 1 << 16;
face->ttc_header.count = 1; face->ttc_header.count = 1;
if ( FT_NEW( face->ttc_header.offsets) ) if ( FT_NEW( face->ttc_header.offsets ) )
return error; return error;
face->ttc_header.offsets[0] = offset; face->ttc_header.offsets[0] = offset;
@@ -862,12 +862,78 @@
} }
} }
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*
* Now allocate the root array of FT_Bitmap_Size records and
* populate them. Unfortunately, it isn't possible to indicate bit
* depths in the FT_Bitmap_Size record. This is a design error.
*/
{
FT_UInt i, count;
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
count = face->sbit_num_strikes;
#else
count = (FT_UInt)face->num_sbit_strikes;
#endif
if ( count > 0 )
{
FT_Memory memory = face->root.stream->memory;
FT_UShort em_size = face->header.Units_Per_EM;
FT_Short avgwidth = face->os2.xAvgCharWidth;
FT_Size_Metrics metrics;
if ( em_size == 0 || face->os2.version == 0xFFFFU )
{
avgwidth = 0;
em_size = 1;
}
if ( FT_NEW_ARRAY( root->available_sizes, count ) )
goto Exit;
for ( i = 0; i < count; i++ )
{
FT_Bitmap_Size* bsize = root->available_sizes + i;
error = sfnt->load_strike_metrics( face, i, &metrics );
if ( error )
goto Exit;
bsize->height = (FT_Short)( metrics.height >> 6 );
bsize->width = (FT_Short)(
( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );
bsize->x_ppem = metrics.x_ppem << 6;
bsize->y_ppem = metrics.y_ppem << 6;
/* assume 72dpi */
bsize->size = metrics.y_ppem << 6;
}
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
root->num_fixed_sizes = (FT_Int)count;
}
}
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
/* a font with no bitmaps and no outlines is scalable; */
/* it has only empty glyphs then */
if ( !FT_HAS_FIXED_SIZES( root ) && !FT_IS_SCALABLE( root ) )
root->face_flags |= FT_FACE_FLAG_SCALABLE;
/*********************************************************************/ /*********************************************************************/
/* */ /* */
/* Set up metrics. */ /* Set up metrics. */
/* */ /* */
if ( has_outline == TRUE ) if ( FT_IS_SCALABLE( root ) )
{ {
/* XXX What about if outline header is missing */ /* XXX What about if outline header is missing */
/* (e.g. sfnt wrapped bitmap)? */ /* (e.g. sfnt wrapped bitmap)? */
@@ -952,71 +1018,6 @@
root->underline_thickness = face->postscript.underlineThickness; root->underline_thickness = face->postscript.underlineThickness;
} }
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*
* Now allocate the root array of FT_Bitmap_Size records and
* populate them. Unfortunately, it isn't possible to indicate bit
* depths in the FT_Bitmap_Size record. This is a design error.
*/
{
FT_UInt i, count;
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
count = face->sbit_num_strikes;
#else
count = (FT_UInt)face->num_sbit_strikes;
#endif
if ( count > 0 )
{
FT_Memory memory = face->root.stream->memory;
FT_UShort em_size = face->header.Units_Per_EM;
FT_Short avgwidth = face->os2.xAvgCharWidth;
FT_Size_Metrics metrics;
if ( em_size == 0 || face->os2.version == 0xFFFFU )
{
avgwidth = 0;
em_size = 1;
}
if ( FT_NEW_ARRAY( root->available_sizes, count ) )
goto Exit;
for ( i = 0; i < count; i++ )
{
FT_Bitmap_Size* bsize = root->available_sizes + i;
error = sfnt->load_strike_metrics( face, i, &metrics );
if ( error )
goto Exit;
bsize->height = (FT_Short)( metrics.height >> 6 );
bsize->width = (FT_Short)(
( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );
bsize->x_ppem = metrics.x_ppem << 6;
bsize->y_ppem = metrics.y_ppem << 6;
/* assume 72dpi */
bsize->size = metrics.y_ppem << 6;
}
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
root->num_fixed_sizes = (FT_Int)count;
}
}
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
/* a font with no bitmaps and no outlines is scalable; */
/* it has only empty glyphs then */
if ( !FT_HAS_FIXED_SIZES( root ) && !FT_IS_SCALABLE( root ) )
root->face_flags |= FT_FACE_FLAG_SCALABLE;
} }
Exit: Exit:
+81 -37
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* TrueType character mapping table (cmap) support (body). */ /* TrueType character mapping table (cmap) support (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -231,7 +231,7 @@
/* language 4 USHORT Mac language code */ /* language 4 USHORT Mac language code */
/* keys 6 USHORT[256] sub-header keys */ /* keys 6 USHORT[256] sub-header keys */
/* subs 518 SUBHEAD[NSUBS] sub-headers array */ /* subs 518 SUBHEAD[NSUBS] sub-headers array */
/* glyph_ids 518+NSUB*8 USHORT[] glyph id array */ /* glyph_ids 518+NSUB*8 USHORT[] glyph ID array */
/* */ /* */
/* The `keys' table is used to map charcode high-bytes to sub-headers. */ /* The `keys' table is used to map charcode high-bytes to sub-headers. */
/* The value of `NSUBS' is the number of sub-headers defined in the */ /* The value of `NSUBS' is the number of sub-headers defined in the */
@@ -282,7 +282,7 @@
FT_UInt n, max_subs; FT_UInt n, max_subs;
FT_Byte* keys; /* keys table */ FT_Byte* keys; /* keys table */
FT_Byte* subs; /* sub-headers */ FT_Byte* subs; /* sub-headers */
FT_Byte* glyph_ids; /* glyph id array */ FT_Byte* glyph_ids; /* glyph ID array */
if ( table + length > valid->limit || length < 6 + 512 ) if ( table + length > valid->limit || length < 6 + 512 )
@@ -605,14 +605,14 @@
/* each segment; can be */ /* each segment; can be */
/* zero */ /* zero */
/* */ /* */
/* glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph id */ /* glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph ID */
/* ranges */ /* ranges */
/* */ /* */
/* Character codes are modelled by a series of ordered (increasing) */ /* Character codes are modelled by a series of ordered (increasing) */
/* intervals called segments. Each segment has start and end codes, */ /* intervals called segments. Each segment has start and end codes, */
/* provided by the `startCount' and `endCount' arrays. Segments must */ /* provided by the `startCount' and `endCount' arrays. Segments must */
/* not be overlapping and the last segment should always contain the */ /* not overlap, and the last segment should always contain the value */
/* `0xFFFF' endCount. */ /* 0xFFFF for `endCount'. */
/* */ /* */
/* The fields `searchRange', `entrySelector' and `rangeShift' are better */ /* The fields `searchRange', `entrySelector' and `rangeShift' are better */
/* ignored (they are traces of over-engineering in the TrueType */ /* ignored (they are traces of over-engineering in the TrueType */
@@ -629,10 +629,10 @@
/* the segment, and the value of `idDelta' is added to it. */ /* the segment, and the value of `idDelta' is added to it. */
/* */ /* */
/* */ /* */
/* Finally, note that certain fonts contain invalid charmaps that */ /* Finally, note that a lot of fonts contain an invalid last segment, */
/* contain end=0xFFFF, start=0xFFFF, delta=0x0001, offset=0xFFFF at the */ /* where `start' and `end' are correctly set to 0xFFFF but both `delta' */
/* of their charmaps (e.g. opens___.ttf which comes with OpenOffice.org) */ /* and `offset' are incorrect (e.g., `opens___.ttf' which comes with */
/* we need special code to deal with them correctly... */ /* OpenOffice.org). We need special code to deal with them correctly. */
/* */ /* */
#ifdef TT_CONFIG_CMAP_FORMAT_4 #ifdef TT_CONFIG_CMAP_FORMAT_4
@@ -697,6 +697,23 @@
p += num_ranges * 2; p += num_ranges * 2;
offset = FT_PEEK_USHORT( p ); offset = FT_PEEK_USHORT( p );
/* some fonts have an incorrect last segment; */
/* we have to catch it */
if ( range_index >= num_ranges - 1 &&
cmap->cur_start == 0xFFFFU &&
cmap->cur_end == 0xFFFFU )
{
TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face;
FT_Byte* limit = face->cmap_table + face->cmap_size;
if ( offset && p + offset + 2 > limit )
{
cmap->cur_delta = 1;
offset = 0;
}
}
if ( offset != 0xFFFFU ) if ( offset != 0xFFFFU )
{ {
cmap->cur_values = offset ? p + offset : NULL; cmap->cur_values = offset ? p + offset : NULL;
@@ -862,7 +879,7 @@
offsets = deltas + num_segs * 2; offsets = deltas + num_segs * 2;
glyph_ids = offsets + num_segs * 2; glyph_ids = offsets + num_segs * 2;
/* check last segment, its end count must be 0xFFFF */ /* check last segment; its end count value must be 0xFFFF */
if ( valid->level >= FT_VALIDATE_PARANOID ) if ( valid->level >= FT_VALIDATE_PARANOID )
{ {
p = ends + ( num_segs - 1 ) * 2; p = ends + ( num_segs - 1 ) * 2;
@@ -891,10 +908,10 @@
if ( start > end ) if ( start > end )
FT_INVALID_DATA; FT_INVALID_DATA;
/* this test should be performed at default validation level; */ /* this test should be performed at default validation level; */
/* unfortunately, some popular Asian fonts present overlapping */ /* unfortunately, some popular Asian fonts have overlapping */
/* ranges in their charmaps */ /* ranges in their charmaps */
/* */ /* */
if ( start <= last_end && n > 0 ) if ( start <= last_end && n > 0 )
{ {
if ( valid->level >= FT_VALIDATE_TIGHT ) if ( valid->level >= FT_VALIDATE_TIGHT )
@@ -902,7 +919,7 @@
else else
{ {
/* allow overlapping segments, provided their start points */ /* allow overlapping segments, provided their start points */
/* and end points, respectively, are in ascending order. */ /* and end points, respectively, are in ascending order */
/* */ /* */
if ( last_start > start || last_end > end ) if ( last_start > start || last_end > end )
error |= TT_CMAP_FLAG_UNSORTED; error |= TT_CMAP_FLAG_UNSORTED;
@@ -913,7 +930,7 @@
if ( offset && offset != 0xFFFFU ) if ( offset && offset != 0xFFFFU )
{ {
p += offset; /* start of glyph id array */ p += offset; /* start of glyph ID array */
/* check that we point within the glyph IDs table only */ /* check that we point within the glyph IDs table only */
if ( valid->level >= FT_VALIDATE_TIGHT ) if ( valid->level >= FT_VALIDATE_TIGHT )
@@ -922,11 +939,18 @@
p + ( end - start + 1 ) * 2 > table + length ) p + ( end - start + 1 ) * 2 > table + length )
FT_INVALID_DATA; FT_INVALID_DATA;
} }
/* some fonts handle the last segment incorrectly */ /* Some fonts handle the last segment incorrectly. In */
else if ( n != num_segs - 1 || /* theory, 0xFFFF might point to an ordinary glyph -- */
!( start == 0xFFFFU && /* a cmap 4 is versatile and could be used for any */
end == 0xFFFFU && /* encoding, not only Unicode. However, reality shows */
delta == 0x1U ) ) /* that far too many fonts are sloppy and incorrectly */
/* set all fields but `start' and `end' for the last */
/* segment if it contains only a single character. */
/* */
/* We thus omit the test here, delaying it to the */
/* routines which actually access the cmap. */
else if ( n != num_segs - 1 ||
!( start == 0xFFFFU && end == 0xFFFFU ) )
{ {
if ( p < glyph_ids || if ( p < glyph_ids ||
p + ( end - start + 1 ) * 2 > valid->limit ) p + ( end - start + 1 ) * 2 > valid->limit )
@@ -957,9 +981,9 @@
/* some fonts (erroneously?) use a range offset of 0xFFFF */ /* some fonts (erroneously?) use a range offset of 0xFFFF */
/* to mean missing glyph in cmap table */ /* to mean missing glyph in cmap table */
/* */ /* */
if ( valid->level >= FT_VALIDATE_PARANOID || if ( valid->level >= FT_VALIDATE_PARANOID ||
n != num_segs - 1 || n != num_segs - 1 ||
!( start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) ) !( start == 0xFFFFU && end == 0xFFFFU ) )
FT_INVALID_DATA; FT_INVALID_DATA;
} }
@@ -1017,11 +1041,21 @@
p += num_segs2; p += num_segs2;
offset = TT_PEEK_USHORT( p ); offset = TT_PEEK_USHORT( p );
/* some fonts handle the last segment incorrectly; */ /* some fonts have an incorrect last segment; */
/* we have to catch it */ /* we have to catch it */
if ( i >= num_segs - 1 && if ( i >= num_segs - 1 &&
start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) start == 0xFFFFU && end == 0xFFFFU )
offset = 0; {
TT_Face face = (TT_Face)cmap->cmap.charmap.face;
FT_Byte* limit = face->cmap_table + face->cmap_size;
if ( offset && p + offset + 2 > limit )
{
delta = 1;
offset = 0;
}
}
if ( offset == 0xFFFFU ) if ( offset == 0xFFFFU )
continue; continue;
@@ -1102,11 +1136,21 @@
p += num_segs2; p += num_segs2;
offset = TT_PEEK_USHORT( p ); offset = TT_PEEK_USHORT( p );
/* some fonts handle the last segment incorrectly; */ /* some fonts have an incorrect last segment; */
/* we have to catch it */ /* we have to catch it */
if ( mid >= num_segs - 1 && if ( mid >= num_segs - 1 &&
start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) start == 0xFFFFU && end == 0xFFFFU )
offset = 0; {
TT_Face face = (TT_Face)cmap->cmap.charmap.face;
FT_Byte* limit = face->cmap_table + face->cmap_size;
if ( offset && p + offset + 2 > limit )
{
delta = 1;
offset = 0;
}
}
/* search the first segment containing `charcode' */ /* search the first segment containing `charcode' */
if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING ) if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING )
@@ -1572,7 +1616,7 @@
/* */ /* */
/* start 0 ULONG first charcode */ /* start 0 ULONG first charcode */
/* end 4 ULONG last charcode */ /* end 4 ULONG last charcode */
/* startId 8 ULONG start glyph id for the group */ /* startId 8 ULONG start glyph ID for the group */
/* */ /* */
#ifdef TT_CONFIG_CMAP_FORMAT_8 #ifdef TT_CONFIG_CMAP_FORMAT_8
@@ -1954,7 +1998,7 @@
/* */ /* */
/* start 0 ULONG first charcode */ /* start 0 ULONG first charcode */
/* end 4 ULONG last charcode */ /* end 4 ULONG last charcode */
/* startId 8 ULONG start glyph id for the group */ /* startId 8 ULONG start glyph ID for the group */
/* */ /* */
#ifdef TT_CONFIG_CMAP_FORMAT_12 #ifdef TT_CONFIG_CMAP_FORMAT_12
+21 -8
View File
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */ /* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */ /* kerning data within the GPOS table at the moment. */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -103,6 +103,9 @@
p_next += length; p_next += length;
if ( p_next > p_limit ) /* handle broken table */
p_next = p_limit;
/* only use horizontal kerning tables */ /* only use horizontal kerning tables */
if ( ( coverage & ~8 ) != 0x0001 || if ( ( coverage & ~8 ) != 0x0001 ||
p + 8 > p_limit ) p + 8 > p_limit )
@@ -111,8 +114,8 @@
num_pairs = FT_NEXT_USHORT( p ); num_pairs = FT_NEXT_USHORT( p );
p += 6; p += 6;
if ( p + 6 * num_pairs > p_limit ) if ( ( p_next - p ) / 6 < (int)num_pairs ) /* handle broken count */
goto NextTable; num_pairs = (FT_UInt)( ( p_next - p ) / 6 );
avail |= mask; avail |= mask;
@@ -181,18 +184,22 @@
FT_Int result = 0; FT_Int result = 0;
FT_UInt count, mask = 1; FT_UInt count, mask = 1;
FT_Byte* p = face->kern_table; FT_Byte* p = face->kern_table;
FT_Byte* p_limit = p + face->kern_table_size;
p += 4; p += 4;
mask = 0x0001; mask = 0x0001;
for ( count = face->num_kern_tables; count > 0; count--, mask <<= 1 ) for ( count = face->num_kern_tables;
count > 0 && p + 6 <= p_limit;
count--, mask <<= 1 )
{ {
FT_Byte* base = p; FT_Byte* base = p;
FT_Byte* next = base; FT_Byte* next = base;
FT_UInt version = FT_NEXT_USHORT( p ); FT_UInt version = FT_NEXT_USHORT( p );
FT_UInt length = FT_NEXT_USHORT( p ); FT_UInt length = FT_NEXT_USHORT( p );
FT_UInt coverage = FT_NEXT_USHORT( p ); FT_UInt coverage = FT_NEXT_USHORT( p );
FT_UInt num_pairs;
FT_Int value = 0; FT_Int value = 0;
FT_UNUSED( version ); FT_UNUSED( version );
@@ -200,22 +207,28 @@
next = base + length; next = base + length;
if ( next > p_limit ) /* handle broken table */
next = p_limit;
if ( ( face->kern_avail_bits & mask ) == 0 ) if ( ( face->kern_avail_bits & mask ) == 0 )
goto NextTable; goto NextTable;
if ( p + 8 > next ) if ( p + 8 > next )
goto NextTable; goto NextTable;
num_pairs = FT_NEXT_USHORT( p );
p += 6;
if ( ( next - p ) / 6 < (int)num_pairs ) /* handle broken count */
num_pairs = (FT_UInt)( ( next - p ) / 6 );
switch ( coverage >> 8 ) switch ( coverage >> 8 )
{ {
case 0: case 0:
{ {
FT_UInt num_pairs = FT_NEXT_USHORT( p ); FT_ULong key0 = TT_KERN_INDEX( left_glyph, right_glyph );
FT_ULong key0 = TT_KERN_INDEX( left_glyph, right_glyph );
p += 6;
if ( face->kern_order_bits & mask ) /* binary search */ if ( face->kern_order_bits & mask ) /* binary search */
{ {
FT_UInt min = 0; FT_UInt min = 0;
+11 -6
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* TrueType and OpenType embedded bitmap support (body). */ /* TrueType and OpenType embedded bitmap support (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -83,7 +83,8 @@
FT_Int line_bits, FT_Int line_bits,
FT_Bool byte_padded, FT_Bool byte_padded,
FT_Int x_offset, FT_Int x_offset,
FT_Int y_offset ) FT_Int y_offset,
FT_Int source_height )
{ {
FT_Byte* line_buff; FT_Byte* line_buff;
FT_Int line_incr; FT_Int line_incr;
@@ -116,7 +117,7 @@
acc = 0; /* clear accumulator */ acc = 0; /* clear accumulator */
loaded = 0; /* no bits were loaded */ loaded = 0; /* no bits were loaded */
for ( height = target->rows; height > 0; height-- ) for ( height = source_height; height > 0; height-- )
{ {
FT_Byte* cur = line_buff; /* current write cursor */ FT_Byte* cur = line_buff; /* current write cursor */
FT_Int count = line_bits; /* # of bits to extract per line */ FT_Int count = line_bits; /* # of bits to extract per line */
@@ -772,7 +773,7 @@
Found: Found:
/* return successfully! */ /* return successfully! */
*arange = range; *arange = range;
return 0; return SFNT_Err_Ok;
} }
} }
@@ -1230,7 +1231,7 @@
/* the sbit blitter doesn't make a difference between pixmap */ /* the sbit blitter doesn't make a difference between pixmap */
/* depths. */ /* depths. */
blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes, blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes,
x_offset * pix_bits, y_offset ); x_offset * pix_bits, y_offset, metrics->height );
FT_FRAME_EXIT(); FT_FRAME_EXIT();
} }
@@ -1324,7 +1325,11 @@
range->image_format, metrics, stream ); range->image_format, metrics, stream );
case 8: /* compound format */ case 8: /* compound format */
FT_Stream_Skip( stream, 1L ); if ( FT_STREAM_SKIP( 1L ) )
{
error = SFNT_Err_Invalid_Stream_Skip;
goto Exit;
}
/* fallthrough */ /* fallthrough */
case 9: case 9:
+51 -78
View File
@@ -5,7 +5,7 @@
/* TrueType and OpenType embedded bitmap support (body). */ /* TrueType and OpenType embedded bitmap support (body). */
/* This is a heap-optimized version. */ /* This is a heap-optimized version. */
/* */ /* */
/* Copyright 2005, 2006, 2007, 2008 by */ /* Copyright 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -39,65 +39,16 @@
#define FT_COMPONENT trace_ttsbit #define FT_COMPONENT trace_ttsbit
static const FT_Frame_Field tt_sbit_line_metrics_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_SBit_LineMetricsRec
/* no FT_FRAME_START */
FT_FRAME_CHAR( ascender ),
FT_FRAME_CHAR( descender ),
FT_FRAME_BYTE( max_width ),
FT_FRAME_CHAR( caret_slope_numerator ),
FT_FRAME_CHAR( caret_slope_denominator ),
FT_FRAME_CHAR( caret_offset ),
FT_FRAME_CHAR( min_origin_SB ),
FT_FRAME_CHAR( min_advance_SB ),
FT_FRAME_CHAR( max_before_BL ),
FT_FRAME_CHAR( min_after_BL ),
FT_FRAME_CHAR( pads[0] ),
FT_FRAME_CHAR( pads[1] ),
FT_FRAME_END
};
static const FT_Frame_Field tt_strike_start_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_SBit_StrikeRec
/* no FT_FRAME_START */
FT_FRAME_ULONG( ranges_offset ),
FT_FRAME_SKIP_LONG,
FT_FRAME_ULONG( num_ranges ),
FT_FRAME_ULONG( color_ref ),
FT_FRAME_END
};
static const FT_Frame_Field tt_strike_end_fields[] =
{
/* no FT_FRAME_START */
FT_FRAME_USHORT( start_glyph ),
FT_FRAME_USHORT( end_glyph ),
FT_FRAME_BYTE ( x_ppem ),
FT_FRAME_BYTE ( y_ppem ),
FT_FRAME_BYTE ( bit_depth ),
FT_FRAME_CHAR ( flags ),
FT_FRAME_END
};
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
tt_face_load_eblc( TT_Face face, tt_face_load_eblc( TT_Face face,
FT_Stream stream ) FT_Stream stream )
{ {
FT_Error error = SFNT_Err_Ok; FT_Error error = SFNT_Err_Ok;
FT_Fixed version; FT_Fixed version;
FT_ULong num_strikes, table_size; FT_ULong num_strikes, table_size;
FT_Byte* p; FT_Byte* p;
FT_Byte* p_limit; FT_Byte* p_limit;
FT_UInt count; FT_UInt count;
face->sbit_num_strikes = 0; face->sbit_num_strikes = 0;
@@ -111,7 +62,7 @@
if ( table_size < 8 ) if ( table_size < 8 )
{ {
FT_ERROR(( "%s: table too short!\n", "tt_face_load_sbit_strikes" )); FT_ERROR(( "tt_face_load_sbit_strikes: table too short!\n" ));
error = SFNT_Err_Invalid_File_Format; error = SFNT_Err_Invalid_File_Format;
goto Exit; goto Exit;
} }
@@ -129,8 +80,7 @@
if ( version != 0x00020000UL || num_strikes >= 0x10000UL ) if ( version != 0x00020000UL || num_strikes >= 0x10000UL )
{ {
FT_ERROR(( "%s: invalid table version!\n", FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version!\n" ));
"tt_face_load_sbit_strikes" ));
error = SFNT_Err_Invalid_File_Format; error = SFNT_Err_Invalid_File_Format;
goto Fail; goto Fail;
} }
@@ -182,7 +132,7 @@
FT_ULong strike_index, FT_ULong strike_index,
FT_Size_Metrics* metrics ) FT_Size_Metrics* metrics )
{ {
FT_Byte* strike; FT_Byte* strike;
if ( strike_index >= (FT_ULong)face->sbit_num_strikes ) if ( strike_index >= (FT_ULong)face->sbit_num_strikes )
@@ -374,14 +324,11 @@
if ( p + 5 > limit ) if ( p + 5 > limit )
goto Fail; goto Fail;
if ( !decoder->metrics_loaded ) metrics->height = p[0];
{ metrics->width = p[1];
metrics->height = p[0]; metrics->horiBearingX = (FT_Char)p[2];
metrics->width = p[1]; metrics->horiBearingY = (FT_Char)p[3];
metrics->horiBearingX = (FT_Char)p[2]; metrics->horiAdvance = p[4];
metrics->horiBearingY = (FT_Char)p[3];
metrics->horiAdvance = p[4];
}
p += 5; p += 5;
if ( big ) if ( big )
@@ -389,19 +336,16 @@
if ( p + 3 > limit ) if ( p + 3 > limit )
goto Fail; goto Fail;
if ( !decoder->metrics_loaded ) metrics->vertBearingX = (FT_Char)p[0];
{ metrics->vertBearingY = (FT_Char)p[1];
metrics->vertBearingX = (FT_Char)p[0]; metrics->vertAdvance = p[2];
metrics->vertBearingY = (FT_Char)p[1];
metrics->vertAdvance = p[2];
}
p += 3; p += 3;
} }
decoder->metrics_loaded = 1; decoder->metrics_loaded = 1;
*pp = p; *pp = p;
return 0; return SFNT_Err_Ok;
Fail: Fail:
return SFNT_Err_Invalid_Argument; return SFNT_Err_Invalid_Argument;
@@ -507,7 +451,7 @@
if ( w > 0 ) if ( w > 0 )
wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) ); wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) );
/* all bits read and there are ( x_pos + w ) bits to be written */ /* all bits read and there are `x_pos + w' bits to be written */
write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) );
@@ -587,7 +531,12 @@
{ {
w = ( width < 8 - x_pos ) ? width : 8 - x_pos; w = ( width < 8 - x_pos ) ? width : 8 - x_pos;
if ( nbits < w ) if ( h == height )
{
rval |= *p++;
nbits += x_pos;
}
else if ( nbits < w )
{ {
rval |= *p++; rval |= *p++;
nbits += 8 - w; nbits += 8 - w;
@@ -598,7 +547,8 @@
nbits -= w; nbits -= w;
} }
*write++ |= ( ( rval >> nbits ) & 0xFF ) & ~( 0xFF << w ); *write++ |= ( ( rval >> nbits ) & 0xFF ) &
( ~( 0xFF << w ) << ( 8 - w - x_pos ) );
rval <<= 8; rval <<= 8;
w = width - w; w = width - w;
@@ -645,6 +595,13 @@
FT_Error error = SFNT_Err_Ok; FT_Error error = SFNT_Err_Ok;
FT_UInt num_components, nn; FT_UInt num_components, nn;
FT_Char horiBearingX = decoder->metrics->horiBearingX;
FT_Char horiBearingY = decoder->metrics->horiBearingY;
FT_Byte horiAdvance = decoder->metrics->horiAdvance;
FT_Char vertBearingX = decoder->metrics->vertBearingX;
FT_Char vertBearingY = decoder->metrics->vertBearingY;
FT_Byte vertAdvance = decoder->metrics->vertAdvance;
if ( p + 2 > limit ) if ( p + 2 > limit )
goto Fail; goto Fail;
@@ -653,6 +610,13 @@
if ( p + 4 * num_components > limit ) if ( p + 4 * num_components > limit )
goto Fail; goto Fail;
if ( !decoder->bitmap_allocated )
{
error = tt_sbit_decoder_alloc_bitmap( decoder );
if ( error )
goto Exit;
}
for ( nn = 0; nn < num_components; nn++ ) for ( nn = 0; nn < num_components; nn++ )
{ {
FT_UInt gindex = FT_NEXT_USHORT( p ); FT_UInt gindex = FT_NEXT_USHORT( p );
@@ -667,6 +631,15 @@
break; break;
} }
decoder->metrics->horiBearingX = horiBearingX;
decoder->metrics->horiBearingY = horiBearingY;
decoder->metrics->horiAdvance = horiAdvance;
decoder->metrics->vertBearingX = vertBearingX;
decoder->metrics->vertBearingY = vertBearingY;
decoder->metrics->vertAdvance = vertAdvance;
decoder->metrics->width = (FT_UInt)decoder->bitmap->width;
decoder->metrics->height = (FT_UInt)decoder->bitmap->rows;
Exit: Exit:
return error; return error;
+3 -3
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* TrueType bytecode interpreter (body). */ /* TrueType bytecode interpreter (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -5099,7 +5099,7 @@
return; return;
} }
if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem < A ) if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem <= A )
CUR.GS.scan_control = TRUE; CUR.GS.scan_control = TRUE;
if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated ) if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated )
@@ -5108,7 +5108,7 @@
if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched ) if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched )
CUR.GS.scan_control = TRUE; CUR.GS.scan_control = TRUE;
if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem >= A ) if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem > A )
CUR.GS.scan_control = FALSE; CUR.GS.scan_control = FALSE;
if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated ) if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated )
+2 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Objects manager (body). */ /* Objects manager (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -153,6 +153,7 @@
static const char* const trick_names[] = static const char* const trick_names[] =
{ {
"DFKaiSho-SB", /* dfkaisb.ttf */ "DFKaiSho-SB", /* dfkaisb.ttf */
"DFKaiShu",
"DFKai-SB", /* kaiu.ttf */ "DFKai-SB", /* kaiu.ttf */
"HuaTianSongTi?", /* htst3.ttf */ "HuaTianSongTi?", /* htst3.ttf */
"MingLiU", /* mingliu.ttf & mingliu.ttc */ "MingLiU", /* mingliu.ttf & mingliu.ttc */
+37 -19
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 driver interface (body). */ /* Type 1 driver interface (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -84,6 +84,7 @@
return 0; return 0;
} }
static const FT_Service_GlyphDictRec t1_service_glyph_dict = static const FT_Service_GlyphDictRec t1_service_glyph_dict =
{ {
(FT_GlyphDict_GetNameFunc) t1_get_glyph_name, (FT_GlyphDict_GetNameFunc) t1_get_glyph_name,
@@ -91,10 +92,10 @@
}; };
/* /*
* POSTSCRIPT NAME SERVICE * POSTSCRIPT NAME SERVICE
* *
*/ */
static const char* static const char*
t1_get_ps_name( T1_Face face ) t1_get_ps_name( T1_Face face )
@@ -102,16 +103,17 @@
return (const char*) face->type1.font_name; return (const char*) face->type1.font_name;
} }
static const FT_Service_PsFontNameRec t1_service_ps_name = static const FT_Service_PsFontNameRec t1_service_ps_name =
{ {
(FT_PsName_GetFunc)t1_get_ps_name (FT_PsName_GetFunc)t1_get_ps_name
}; };
/* /*
* MULTIPLE MASTERS SERVICE * MULTIPLE MASTERS SERVICE
* *
*/ */
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
static const FT_Service_MultiMastersRec t1_service_multi_masters = static const FT_Service_MultiMastersRec t1_service_multi_masters =
@@ -125,17 +127,28 @@
#endif #endif
/* /*
* POSTSCRIPT INFO SERVICE * POSTSCRIPT INFO SERVICE
* *
*/ */
static FT_Error static FT_Error
t1_ps_get_font_info( FT_Face face, t1_ps_get_font_info( FT_Face face,
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((T1_Face)face)->type1.font_info; *afont_info = ((T1_Face)face)->type1.font_info;
return 0;
return T1_Err_Ok;
}
static FT_Error
t1_ps_get_font_extra( FT_Face face,
PS_FontExtraRec* afont_extra )
{
*afont_extra = ((T1_Face)face)->type1.font_extra;
return T1_Err_Ok;
} }
@@ -143,6 +156,7 @@
t1_ps_has_glyph_names( FT_Face face ) t1_ps_has_glyph_names( FT_Face face )
{ {
FT_UNUSED( face ); FT_UNUSED( face );
return 1; return 1;
} }
@@ -152,17 +166,20 @@
PS_PrivateRec* afont_private ) PS_PrivateRec* afont_private )
{ {
*afont_private = ((T1_Face)face)->type1.private_dict; *afont_private = ((T1_Face)face)->type1.private_dict;
return 0;
return T1_Err_Ok;
} }
static const FT_Service_PsInfoRec t1_service_ps_info = static const FT_Service_PsInfoRec t1_service_ps_info =
{ {
(PS_GetFontInfoFunc) t1_ps_get_font_info, (PS_GetFontInfoFunc) t1_ps_get_font_info,
(PS_GetFontExtraFunc) t1_ps_get_font_extra,
(PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names,
(PS_GetFontPrivateFunc)t1_ps_get_font_private, (PS_GetFontPrivateFunc)t1_ps_get_font_private,
}; };
#ifndef T1_CONFIG_OPTION_NO_AFM #ifndef T1_CONFIG_OPTION_NO_AFM
static const FT_Service_KerningRec t1_service_kerning = static const FT_Service_KerningRec t1_service_kerning =
{ {
@@ -170,10 +187,11 @@
}; };
#endif #endif
/*
* SERVICE LIST /*
* * SERVICE LIST
*/ *
*/
static const FT_ServiceDescRec t1_services[] = static const FT_ServiceDescRec t1_services[] =
{ {
+13 -5
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 Glyph Loader (body). */ /* Type 1 Glyph Loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -295,8 +295,16 @@
if ( load_flags & FT_LOAD_NO_RECURSE ) if ( load_flags & FT_LOAD_NO_RECURSE )
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
glyph->x_scale = size->root.metrics.x_scale; if ( size )
glyph->y_scale = size->root.metrics.y_scale; {
glyph->x_scale = size->root.metrics.x_scale;
glyph->y_scale = size->root.metrics.y_scale;
}
else
{
glyph->x_scale = 0x10000L;
glyph->y_scale = 0x10000L;
}
glyph->root.outline.n_points = 0; glyph->root.outline.n_points = 0;
glyph->root.outline.n_contours = 0; glyph->root.outline.n_contours = 0;
@@ -430,8 +438,8 @@
} }
/* Then scale the metrics */ /* Then scale the metrics */
metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );
metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );
} }
/* compute the other metrics */ /* compute the other metrics */
+7 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 font loader (body). */ /* Type 1 font loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -948,6 +948,12 @@
} }
break; break;
case T1_FIELD_LOCATION_FONT_EXTRA:
dummy_object = &face->type1.font_extra;
objects = &dummy_object;
max_objects = 0;
break;
case T1_FIELD_LOCATION_PRIVATE: case T1_FIELD_LOCATION_PRIVATE:
dummy_object = &face->type1.private_dict; dummy_object = &face->type1.private_dict;
objects = &dummy_object; objects = &dummy_object;
+7 -1
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 tokenizer (specification). */ /* Type 1 tokenizer (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@@ -41,6 +41,12 @@
T1_FIELD_DICT_FONTDICT ) T1_FIELD_DICT_FONTDICT )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, T1_FIELD_NUM ( "UnderlineThickness", underline_thickness,
T1_FIELD_DICT_FONTDICT ) T1_FIELD_DICT_FONTDICT )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontExtraRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
T1_FIELD_NUM ( "FSType", fs_type, T1_FIELD_NUM ( "FSType", fs_type,
T1_FIELD_DICT_FONTDICT ) T1_FIELD_DICT_FONTDICT )
+35 -21
View File
@@ -4,7 +4,7 @@
/* */ /* */
/* High-level Type 42 driver interface (body). */ /* High-level Type 42 driver interface (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2007 by Roberto Alameda. */ /* Copyright 2002, 2003, 2004, 2006, 2007, 2009 by Roberto Alameda. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@@ -49,11 +49,11 @@
#define FT_COMPONENT trace_t42 #define FT_COMPONENT trace_t42
/* /*
* *
* GLYPH DICT SERVICE * GLYPH DICT SERVICE
* *
*/ */
static FT_Error static FT_Error
t42_get_glyph_name( T42_Face face, t42_get_glyph_name( T42_Face face,
@@ -94,11 +94,11 @@
}; };
/* /*
* *
* POSTSCRIPT NAME SERVICE * POSTSCRIPT NAME SERVICE
* *
*/ */
static const char* static const char*
t42_get_ps_font_name( T42_Face face ) t42_get_ps_font_name( T42_Face face )
@@ -113,17 +113,28 @@
}; };
/* /*
* *
* POSTSCRIPT INFO SERVICE * POSTSCRIPT INFO SERVICE
* *
*/ */
static FT_Error static FT_Error
t42_ps_get_font_info( FT_Face face, t42_ps_get_font_info( FT_Face face,
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((T42_Face)face)->type1.font_info; *afont_info = ((T42_Face)face)->type1.font_info;
return T42_Err_Ok;
}
static FT_Error
t42_ps_get_font_extra( FT_Face face,
PS_FontExtraRec* afont_extra )
{
*afont_extra = ((T42_Face)face)->type1.font_extra;
return T42_Err_Ok; return T42_Err_Ok;
} }
@@ -132,6 +143,7 @@
t42_ps_has_glyph_names( FT_Face face ) t42_ps_has_glyph_names( FT_Face face )
{ {
FT_UNUSED( face ); FT_UNUSED( face );
return 1; return 1;
} }
@@ -141,6 +153,7 @@
PS_PrivateRec* afont_private ) PS_PrivateRec* afont_private )
{ {
*afont_private = ((T42_Face)face)->type1.private_dict; *afont_private = ((T42_Face)face)->type1.private_dict;
return T42_Err_Ok; return T42_Err_Ok;
} }
@@ -148,16 +161,17 @@
static const FT_Service_PsInfoRec t42_service_ps_info = static const FT_Service_PsInfoRec t42_service_ps_info =
{ {
(PS_GetFontInfoFunc) t42_ps_get_font_info, (PS_GetFontInfoFunc) t42_ps_get_font_info,
(PS_GetFontExtraFunc) t42_ps_get_font_extra,
(PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names,
(PS_GetFontPrivateFunc)t42_ps_get_font_private (PS_GetFontPrivateFunc)t42_ps_get_font_private
}; };
/* /*
* *
* SERVICE LIST * SERVICE LIST
* *
*/ */
static const FT_ServiceDescRec t42_services[] = static const FT_ServiceDescRec t42_services[] =
{ {
+8 -1
View File
@@ -4,7 +4,8 @@
/* */ /* */
/* Type 42 font parser (body). */ /* Type 42 font parser (body). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Roberto Alameda. */ /* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* Roberto Alameda. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@@ -68,6 +69,12 @@
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 ) T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 )
T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 ) T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 ) T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 )
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontExtraRec
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
T1_FIELD_NUM ( "FSType", fs_type, 0 ) T1_FIELD_NUM ( "FSType", fs_type, 0 )
#undef FT_STRUCTURE #undef FT_STRUCTURE