*/* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
This commit is contained in:
parent
cecf93ef90
commit
f6aa089f12
|
@ -1,3 +1,7 @@
|
|||
2013-05-10 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
*/* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
|
||||
|
||||
2013-05-08 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* Version 2.4.12 released.
|
||||
|
|
|
@ -774,39 +774,12 @@ FT_BEGIN_HEADER
|
|||
|
||||
|
||||
/*
|
||||
* Define this variable if you want to keep the layout of internal
|
||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||
* a few obsolete functions to avoid linking problems on typical Unix
|
||||
* distributions.
|
||||
*
|
||||
* For embedded systems or building a new distribution from scratch, it
|
||||
* is recommended to disable the macro since it reduces the library's code
|
||||
* size and activates a few memory-saving optimizations as well.
|
||||
* This macro is obsolete. Support has been removed in FreeType
|
||||
* version 2.5.
|
||||
*/
|
||||
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
|
||||
* we restrict the number of charmaps in a font. The current API of
|
||||
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
|
||||
* takes charcode only. To determine the passed value is for cmap_index
|
||||
* or charcode, the possible cmap_index is restricted not to exceed
|
||||
* the minimum possible charcode by a rogue client. It is also very
|
||||
* unlikely that a rogue client is interested in Unicode values 0 to 15.
|
||||
*
|
||||
* NOTE: The original threshold was 4 deduced from popular number of
|
||||
* cmap subtables in UCS-4 TrueType fonts, but now it is not
|
||||
* irregular for OpenType fonts to have more than 4 subtables,
|
||||
* because variation selector subtables are available for Apple
|
||||
* and Microsoft platforms.
|
||||
*/
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_MAX_CHARMAP_CACHEABLE 15
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* This macro is defined if either unpatented or native TrueType
|
||||
* hinting is requested by the definitions above.
|
||||
|
|
11
docs/CHANGES
11
docs/CHANGES
|
@ -1,8 +1,17 @@
|
|||
|
||||
CHANGES BETWEEN 2.4.11 and 2.4.12
|
||||
CHANGES BETWEEN 2.4.12 and 2.5
|
||||
|
||||
I. IMPORTANT CHANGES
|
||||
|
||||
- As announced in the previous release, all code related to macro
|
||||
FT_CONFIG_OPTION_OLD_INTERNALS has been removed, thus becoming
|
||||
obsolete.
|
||||
|
||||
|
||||
======================================================================
|
||||
|
||||
CHANGES BETWEEN 2.4.11 and 2.4.12
|
||||
|
||||
- We have another CFF parsing and hinting engine! Written by Dave
|
||||
Arnold <darnold@adobe.com>, this work has been contributed by
|
||||
Adobe in collaboration with Google. It is vastly superior to
|
||||
|
|
|
@ -774,39 +774,12 @@ FT_BEGIN_HEADER
|
|||
|
||||
|
||||
/*
|
||||
* Define this variable if you want to keep the layout of internal
|
||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||
* a few obsolete functions to avoid linking problems on typical Unix
|
||||
* distributions.
|
||||
*
|
||||
* For embedded systems or building a new distribution from scratch, it
|
||||
* is recommended to disable the macro since it reduces the library's code
|
||||
* size and activates a few memory-saving optimizations as well.
|
||||
* This macro is obsolete. Support has been removed in FreeType
|
||||
* version 2.5.
|
||||
*/
|
||||
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
|
||||
* we restrict the number of charmaps in a font. The current API of
|
||||
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
|
||||
* takes charcode only. To determine the passed value is for cmap_index
|
||||
* or charcode, the possible cmap_index is restricted not to exceed
|
||||
* the minimum possible charcode by a rogue client. It is also very
|
||||
* unlikely that a rogue client is interested in Unicode values 0 to 15.
|
||||
*
|
||||
* NOTE: The original threshold was 4 deduced from popular number of
|
||||
* cmap subtables in UCS-4 TrueType fonts, but now it is not
|
||||
* irregular for OpenType fonts to have more than 4 subtables,
|
||||
* because variation selector subtables are available for Apple
|
||||
* and Microsoft platforms.
|
||||
*/
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_MAX_CHARMAP_CACHEABLE 15
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* This macro is defined if either unpatented or native TrueType
|
||||
* hinting is requested by the definitions above.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Cache subsystem (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
|
||||
/* Copyright 1996-2008, 2010, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -214,17 +214,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* these macros are incompatible with LLP64, should not be used */
|
||||
|
||||
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
|
||||
|
||||
#define FTC_FACE_ID_HASH( i ) \
|
||||
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
||||
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
@ -705,17 +694,6 @@ FT_BEGIN_HEADER
|
|||
(d1)->width == (d2)->width && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* this macro is incompatible with LLP64, should not be used */
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
|
||||
( (d)->width << 8 ) ^ (d)->height ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -1069,67 +1047,6 @@ FT_BEGIN_HEADER
|
|||
FTC_Node *anode );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_FontRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given `font' to the cache */
|
||||
/* manager. Note that a `font' is the combination of a given face */
|
||||
/* with a given character size. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The ID of the face to use. */
|
||||
/* */
|
||||
/* pix_width :: The character width in integer pixels. */
|
||||
/* */
|
||||
/* pix_height :: The character height in integer pixels. */
|
||||
/* */
|
||||
typedef struct FTC_FontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
( (f1)->face_id == (f2)->face_id && \
|
||||
(f1)->pix_width == (f2)->pix_width && \
|
||||
(f1)->pix_height == (f2)->pix_height )
|
||||
|
||||
/* this macro is incompatible with LLP64, should not be used */
|
||||
#define FTC_FONT_HASH( f ) \
|
||||
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
||||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
typedef FTC_FontRec* FTC_Font;
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Face( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Size( FTC_Manager manager,
|
||||
FTC_Font font,
|
||||
FT_Face *aface,
|
||||
FT_Size *asize );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
|
|
@ -48,29 +48,6 @@ FT_BEGIN_HEADER
|
|||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt32 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of an Int32 integer (which will be */
|
||||
/* handled as an unsigned long value). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The value to compute the root for. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `sqrt(x)'. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt32( FT_Int32 x );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2003, 2006, 2008, 2011-2012 by */
|
||||
/* Copyright 1996-2003, 2006, 2008, 2011-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -60,22 +60,6 @@ FT_BEGIN_HEADER
|
|||
(*FT_Size_SelectFunc)( FT_Size size,
|
||||
FT_ULong size_index );
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_ResetPointsFunc)( FT_Size size,
|
||||
FT_F26Dot6 char_width,
|
||||
FT_F26Dot6 char_height,
|
||||
FT_UInt horz_resolution,
|
||||
FT_UInt vert_resolution );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_ResetPixelsFunc)( FT_Size size,
|
||||
FT_UInt pixel_width,
|
||||
FT_UInt pixel_height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
|
@ -196,13 +180,6 @@ FT_BEGIN_HEADER
|
|||
FT_Slot_InitFunc init_slot;
|
||||
FT_Slot_DoneFunc done_slot;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_Size_ResetPointsFunc set_char_sizes;
|
||||
FT_Size_ResetPixelsFunc set_pixel_sizes;
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_Slot_LoadFunc load_glyph;
|
||||
|
||||
FT_Face_GetKerningFunc get_kerning;
|
||||
|
@ -216,30 +193,6 @@ FT_BEGIN_HEADER
|
|||
} FT_Driver_ClassRec, *FT_Driver_Class;
|
||||
|
||||
|
||||
/*
|
||||
* The following functions are used as stubs for `set_char_sizes' and
|
||||
* `set_pixel_sizes'; the code uses `request_size' and `select_size'
|
||||
* functions instead.
|
||||
*
|
||||
* Implementation is in `src/base/ftobjs.c'.
|
||||
*/
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_char_sizes( FT_Size size,
|
||||
FT_F26Dot6 width,
|
||||
FT_F26Dot6 height,
|
||||
FT_UInt horz_res,
|
||||
FT_UInt vert_res );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_pixel_sizes( FT_Size size,
|
||||
FT_UInt width,
|
||||
FT_UInt height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
|
@ -279,94 +232,74 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
|
||||
a_, b_,
|
||||
#else
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
|
||||
#endif
|
||||
|
||||
#define FT_DECLARE_DRIVER( class_ ) \
|
||||
FT_CALLBACK_TABLE \
|
||||
FT_CALLBACK_TABLE \
|
||||
const FT_Driver_ClassRec class_;
|
||||
|
||||
#define FT_DEFINE_DRIVER( \
|
||||
class_, \
|
||||
flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_, \
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
old_set_char_sizes_, \
|
||||
old_set_pixel_sizes_, \
|
||||
load_glyph_, \
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
request_size_, \
|
||||
select_size_ ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const FT_Driver_ClassRec class_ = \
|
||||
{ \
|
||||
FT_DEFINE_ROOT_MODULE( flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_ ) \
|
||||
\
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
\
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
\
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
\
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
\
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
|
||||
old_set_pixel_sizes_ ) \
|
||||
\
|
||||
load_glyph_, \
|
||||
\
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
\
|
||||
request_size_, \
|
||||
select_size_ \
|
||||
#define FT_DEFINE_DRIVER( \
|
||||
class_, \
|
||||
flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_, \
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
load_glyph_, \
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
request_size_, \
|
||||
select_size_ ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const FT_Driver_ClassRec class_ = \
|
||||
{ \
|
||||
FT_DEFINE_ROOT_MODULE( flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_ ) \
|
||||
\
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
\
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
\
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
\
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
\
|
||||
load_glyph_, \
|
||||
\
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
\
|
||||
request_size_, \
|
||||
select_size_ \
|
||||
};
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
|
||||
clazz->set_char_sizes = a_; \
|
||||
clazz->set_pixel_sizes = b_;
|
||||
#else
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
|
||||
#endif
|
||||
|
||||
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
|
||||
|
||||
#define FT_DEFINE_DRIVER( \
|
||||
|
@ -389,8 +322,6 @@ FT_BEGIN_HEADER
|
|||
done_size_, \
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
old_set_char_sizes_, \
|
||||
old_set_pixel_sizes_, \
|
||||
load_glyph_, \
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
|
@ -453,9 +384,6 @@ FT_BEGIN_HEADER
|
|||
clazz->init_slot = init_slot_; \
|
||||
clazz->done_slot = done_slot_; \
|
||||
\
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
|
||||
old_set_pixel_sizes_ ) \
|
||||
\
|
||||
clazz->load_glyph = load_glyph_; \
|
||||
\
|
||||
clazz->get_kerning = get_kerning_; \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */
|
||||
/* Copyright 1996-2002, 2004-2007, 2010, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -303,37 +303,6 @@ FT_BEGIN_HEADER
|
|||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void* *P );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_strdup( FT_Memory memory,
|
||||
const char* str,
|
||||
|
@ -345,6 +314,7 @@ FT_BEGIN_HEADER
|
|||
FT_ULong size,
|
||||
FT_Error *p_error );
|
||||
|
||||
|
||||
#define FT_MEM_STRDUP( dst, str ) \
|
||||
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2008, 2010, 2012 by */
|
||||
/* Copyright 1996-2006, 2008, 2010, 2012-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -352,10 +352,6 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
typedef struct FT_Face_InternalRec_
|
||||
{
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort reserved1;
|
||||
FT_Short reserved2;
|
||||
#endif
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2006, 2009, 2012 by */
|
||||
/* Copyright 1996-2006, 2009, 2012-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -125,77 +125,6 @@ FT_BEGIN_HEADER
|
|||
(*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_SFNT_HeaderRec_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the header of a SFNT font file. Supports collections. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
/* This function recognizes fonts embedded in a `TrueType */
|
||||
/* collection'. */
|
||||
/* */
|
||||
/* This function checks that the header is valid by looking at the */
|
||||
/* values of `search_range', `entry_selector', and `range_shift'. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_SFNT_HeaderRec_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Long face_index,
|
||||
SFNT_Header sfnt );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Directory_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the table directory into a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be on the first byte after the 4-byte font */
|
||||
/* format tag. This is the case just after a call to */
|
||||
/* TT_Load_Format_Tag(). */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Directory_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
SFNT_Header sfnt );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
|
@ -363,88 +292,6 @@ FT_BEGIN_HEADER
|
|||
TT_SBit_MetricsRec *ametrics );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_OldFunc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Select an sbit strike for a given size request. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* req :: The size request. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* astrike_index :: The index of the sbit strike. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* sbit strike exists for the selected ppem values. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Load_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType character map into memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the current stream object. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* cmap :: A pointer to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function assumes that the stream is already in use (i.e., */
|
||||
/* opened). In case of error, all partially allocated tables are */
|
||||
/* released. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Load_Func)( TT_Face face,
|
||||
void* cmap,
|
||||
FT_Stream input );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Free_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys a character mapping table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* cmap :: A handle to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Free_Func)( TT_Face face,
|
||||
void* cmap );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
|
@ -657,11 +504,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
TT_Load_Any_Func load_any;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
|
||||
TT_Load_Directory_Func load_directory;
|
||||
#endif
|
||||
|
||||
/* these functions are called by `load_face' but they can also */
|
||||
/* be called from external modules, if there is a need to do so */
|
||||
TT_Load_Table_Func load_head;
|
||||
|
@ -674,12 +516,6 @@ FT_BEGIN_HEADER
|
|||
TT_Load_Table_Func load_name;
|
||||
TT_Free_Table_Func free_name;
|
||||
|
||||
/* optional tables */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_Table_Func load_hdmx_stub;
|
||||
TT_Free_Table_Func free_hdmx_stub;
|
||||
#endif
|
||||
|
||||
/* this field was called `load_kerning' up to version 2.1.10 */
|
||||
TT_Load_Table_Func load_kern;
|
||||
|
||||
|
@ -690,43 +526,12 @@ FT_BEGIN_HEADER
|
|||
/* version 2.1.10 */
|
||||
TT_Load_Table_Func load_bhed;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
|
||||
TT_Load_Table_Func load_sbits_stub;
|
||||
|
||||
/*
|
||||
* The following two fields appeared in version 2.1.8, and were placed
|
||||
* between `load_sbits' and `load_sbit_image'. We support them as a
|
||||
* special exception since they are used by Xfont library within the
|
||||
* X.Org xserver, and because the probability that other rogue clients
|
||||
* use the other version 2.1.7 fields below is _extremely_ low.
|
||||
*
|
||||
* Note that this forces us to disable an interesting memory-saving
|
||||
* optimization though...
|
||||
*/
|
||||
|
||||
TT_Find_SBit_Image_Func find_sbit_image;
|
||||
TT_Load_SBit_Metrics_Func load_sbit_metrics;
|
||||
|
||||
#endif
|
||||
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Free_Table_Func free_sbits_stub;
|
||||
#endif
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_CharMap_Load_Func load_charmap_stub;
|
||||
TT_CharMap_Free_Func free_charmap_stub;
|
||||
#endif
|
||||
|
||||
/* starting here, the structure differs from version 2.1.7 */
|
||||
|
||||
/* this field was introduced in version 2.1.8, named `get_psname' */
|
||||
|
@ -755,213 +560,141 @@ FT_BEGIN_HEADER
|
|||
|
||||
#ifndef FT_CONFIG_OPTION_PIC
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) \
|
||||
a,
|
||||
#else
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) /* empty */
|
||||
#endif
|
||||
|
||||
#define FT_INTERNAL( a ) \
|
||||
a,
|
||||
|
||||
#define FT_DEFINE_SFNT_INTERFACE( \
|
||||
class_, \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_sfnt_header_, \
|
||||
load_directory_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_hdmx_stub_, \
|
||||
free_hdmx_stub_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
set_sbit_strike_stub_, \
|
||||
load_sbits_stub_, \
|
||||
find_sbit_image_, \
|
||||
load_sbit_metrics_, \
|
||||
load_sbit_image_, \
|
||||
free_sbits_stub_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
load_charmap_stub_, \
|
||||
free_charmap_stub_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
static const SFNT_Interface class_ = \
|
||||
{ \
|
||||
FT_INTERNAL( goto_table_ ) \
|
||||
FT_INTERNAL( init_face_ ) \
|
||||
FT_INTERNAL( load_face_ ) \
|
||||
FT_INTERNAL( done_face_ ) \
|
||||
FT_INTERNAL( get_interface_ ) \
|
||||
FT_INTERNAL( load_any_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory_ ) \
|
||||
FT_INTERNAL( load_head_ ) \
|
||||
FT_INTERNAL( load_hhea_ ) \
|
||||
FT_INTERNAL( load_cmap_ ) \
|
||||
FT_INTERNAL( load_maxp_ ) \
|
||||
FT_INTERNAL( load_os2_ ) \
|
||||
FT_INTERNAL( load_post_ ) \
|
||||
FT_INTERNAL( load_name_ ) \
|
||||
FT_INTERNAL( free_name_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub_ ) \
|
||||
FT_INTERNAL( load_kern_ ) \
|
||||
FT_INTERNAL( load_gasp_ ) \
|
||||
FT_INTERNAL( load_pclt_ ) \
|
||||
FT_INTERNAL( load_bhed_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics_ ) \
|
||||
FT_INTERNAL( load_sbit_image_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub_ ) \
|
||||
FT_INTERNAL( get_psname_ ) \
|
||||
FT_INTERNAL( free_psnames_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub_ ) \
|
||||
FT_INTERNAL( get_kerning_ ) \
|
||||
FT_INTERNAL( load_font_dir_ ) \
|
||||
FT_INTERNAL( load_hmtx_ ) \
|
||||
FT_INTERNAL( load_eblc_ ) \
|
||||
FT_INTERNAL( free_eblc_ ) \
|
||||
FT_INTERNAL( set_sbit_strike_ ) \
|
||||
FT_INTERNAL( load_strike_metrics_ ) \
|
||||
FT_INTERNAL( get_metrics_ ) \
|
||||
#define FT_DEFINE_SFNT_INTERFACE( \
|
||||
class_, \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
load_sbit_image_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
static const SFNT_Interface class_ = \
|
||||
{ \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
load_sbit_image_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_, \
|
||||
};
|
||||
|
||||
#else /* FT_CONFIG_OPTION_PIC */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) \
|
||||
clazz->a = a_;
|
||||
#else
|
||||
#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) /* empty */
|
||||
#endif
|
||||
|
||||
#define FT_INTERNAL( a, a_ ) \
|
||||
clazz->a = a_;
|
||||
|
||||
#define FT_DEFINE_SFNT_INTERFACE( \
|
||||
class_, \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_sfnt_header_, \
|
||||
load_directory_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_hdmx_stub_, \
|
||||
free_hdmx_stub_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
set_sbit_strike_stub_, \
|
||||
load_sbits_stub_, \
|
||||
find_sbit_image_, \
|
||||
load_sbit_metrics_, \
|
||||
load_sbit_image_, \
|
||||
free_sbits_stub_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
load_charmap_stub_, \
|
||||
free_charmap_stub_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
void \
|
||||
FT_Init_Class_ ## class_( FT_Library library, \
|
||||
SFNT_Interface* clazz ) \
|
||||
{ \
|
||||
FT_UNUSED( library ); \
|
||||
\
|
||||
FT_INTERNAL( goto_table, goto_table_ ) \
|
||||
FT_INTERNAL( init_face, init_face_ ) \
|
||||
FT_INTERNAL( load_face, load_face_ ) \
|
||||
FT_INTERNAL( done_face, done_face_ ) \
|
||||
FT_INTERNAL( get_interface, get_interface_ ) \
|
||||
FT_INTERNAL( load_any, load_any_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header, \
|
||||
load_sfnt_header_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory, \
|
||||
load_directory_ ) \
|
||||
FT_INTERNAL( load_head, load_head_ ) \
|
||||
FT_INTERNAL( load_hhea, load_hhea_ ) \
|
||||
FT_INTERNAL( load_cmap, load_cmap_ ) \
|
||||
FT_INTERNAL( load_maxp, load_maxp_ ) \
|
||||
FT_INTERNAL( load_os2, load_os2_ ) \
|
||||
FT_INTERNAL( load_post, load_post_ ) \
|
||||
FT_INTERNAL( load_name, load_name_ ) \
|
||||
FT_INTERNAL( free_name, free_name_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub, \
|
||||
load_hdmx_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub, \
|
||||
free_hdmx_stub_ ) \
|
||||
FT_INTERNAL( load_kern, load_kern_ ) \
|
||||
FT_INTERNAL( load_gasp, load_gasp_ ) \
|
||||
FT_INTERNAL( load_pclt, load_pclt_ ) \
|
||||
FT_INTERNAL( load_bhed, load_bhed_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub, \
|
||||
set_sbit_strike_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub, \
|
||||
load_sbits_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image, \
|
||||
find_sbit_image_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics, \
|
||||
load_sbit_metrics_ ) \
|
||||
FT_INTERNAL( load_sbit_image, load_sbit_image_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub, \
|
||||
free_sbits_stub_ ) \
|
||||
FT_INTERNAL( get_psname, get_psname_ ) \
|
||||
FT_INTERNAL( free_psnames, free_psnames_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub, \
|
||||
load_charmap_stub_ ) \
|
||||
FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub, \
|
||||
free_charmap_stub_ ) \
|
||||
FT_INTERNAL( get_kerning, get_kerning_ ) \
|
||||
FT_INTERNAL( load_font_dir, load_font_dir_ ) \
|
||||
FT_INTERNAL( load_hmtx, load_hmtx_ ) \
|
||||
FT_INTERNAL( load_eblc, load_eblc_ ) \
|
||||
FT_INTERNAL( free_eblc, free_eblc_ ) \
|
||||
FT_INTERNAL( set_sbit_strike, set_sbit_strike_ ) \
|
||||
FT_INTERNAL( load_strike_metrics, load_strike_metrics_ ) \
|
||||
FT_INTERNAL( get_metrics, get_metrics_ ) \
|
||||
#define FT_DEFINE_SFNT_INTERFACE( \
|
||||
class_, \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
load_sbit_image_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
get_metrics_ ) \
|
||||
void \
|
||||
FT_Init_Class_ ## class_( FT_Library library, \
|
||||
SFNT_Interface* clazz ) \
|
||||
{ \
|
||||
FT_UNUSED( library ); \
|
||||
\
|
||||
clazz->goto_table = goto_table_; \
|
||||
clazz->init_face = init_face_; \
|
||||
clazz->load_face = load_face_; \
|
||||
clazz->done_face = done_face_; \
|
||||
clazz->get_interface = get_interface_; \
|
||||
clazz->load_any = load_any_; \
|
||||
clazz->load_head = load_head_; \
|
||||
clazz->load_hhea = load_hhea_; \
|
||||
clazz->load_cmap = load_cmap_; \
|
||||
clazz->load_maxp = load_maxp_; \
|
||||
clazz->load_os2 = load_os2_; \
|
||||
clazz->load_post = load_post_; \
|
||||
clazz->load_name = load_name_; \
|
||||
clazz->free_name = free_name_; \
|
||||
clazz->load_kern = load_kern_; \
|
||||
clazz->load_gasp = load_gasp_; \
|
||||
clazz->load_pclt = load_pclt_; \
|
||||
clazz->load_bhed = load_bhed_; \
|
||||
clazz->load_sbit_image = load_sbit_image_; \
|
||||
clazz->get_psname = get_psname_; \
|
||||
clazz->free_psnames = free_psnames_; \
|
||||
clazz->get_kerning = get_kerning_; \
|
||||
clazz->load_font_dir = load_font_dir_; \
|
||||
clazz->load_hmtx = load_hmtx_; \
|
||||
clazz->load_eblc = load_eblc_; \
|
||||
clazz->free_eblc = free_eblc_; \
|
||||
clazz->set_sbit_strike = set_sbit_strike_; \
|
||||
clazz->load_strike_metrics = load_strike_metrics_; \
|
||||
clazz->get_metrics = get_metrics_; \
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_PIC */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
|
||||
/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -205,10 +205,6 @@ FT_BEGIN_HEADER
|
|||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
PS_Unicodes unicode_map;
|
||||
#endif
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
PS_Blend blend;
|
||||
|
||||
|
|
|
@ -311,87 +311,6 @@ FT_BEGIN_HEADER
|
|||
} TT_GaspRec;
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_HdmxEntryRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A small structure used to model the pre-computed widths of a given */
|
||||
/* size. They are found in the `hdmx' table. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* ppem :: The pixels per EM value at which these metrics apply. */
|
||||
/* */
|
||||
/* max_width :: The maximum advance width for this metric. */
|
||||
/* */
|
||||
/* widths :: An array of widths. Note: These are 8-bit bytes. */
|
||||
/* */
|
||||
typedef struct TT_HdmxEntryRec_
|
||||
{
|
||||
FT_Byte ppem;
|
||||
FT_Byte max_width;
|
||||
FT_Byte* widths;
|
||||
|
||||
} TT_HdmxEntryRec, *TT_HdmxEntry;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_HdmxRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model the `hdmx' table, which contains */
|
||||
/* pre-computed widths for a set of given sizes/dimensions. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* version :: The version number. */
|
||||
/* */
|
||||
/* num_records :: The number of hdmx records. */
|
||||
/* */
|
||||
/* records :: An array of hdmx records. */
|
||||
/* */
|
||||
typedef struct TT_HdmxRec_
|
||||
{
|
||||
FT_UShort version;
|
||||
FT_Short num_records;
|
||||
TT_HdmxEntry records;
|
||||
|
||||
} TT_HdmxRec, *TT_Hdmx;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_Kern0_PairRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a kerning pair for the kerning table */
|
||||
/* format 0. The engine now loads this table if it finds one in the */
|
||||
/* font file. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* left :: The index of the left glyph in pair. */
|
||||
/* */
|
||||
/* right :: The index of the right glyph in pair. */
|
||||
/* */
|
||||
/* value :: The kerning distance. A positive value spaces the */
|
||||
/* glyphs, a negative one makes them closer. */
|
||||
/* */
|
||||
typedef struct TT_Kern0_PairRec_
|
||||
{
|
||||
FT_UShort left; /* index of left glyph in pair */
|
||||
FT_UShort right; /* index of right glyph in pair */
|
||||
FT_FWord value; /* kerning value */
|
||||
|
||||
} TT_Kern0_PairRec, *TT_Kern0_Pair;
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
@ -1269,9 +1188,6 @@ FT_BEGIN_HEADER
|
|||
TT_HoriHeader horizontal; /* TrueType horizontal header */
|
||||
|
||||
TT_MaxProfile max_profile;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong max_components; /* stubbed to 0 */
|
||||
#endif
|
||||
|
||||
FT_Bool vertical_info;
|
||||
TT_VertHeader vertical; /* TT Vertical header, if present */
|
||||
|
@ -1308,11 +1224,6 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
/* horizontal device metrics */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_HdmxRec hdmx;
|
||||
#endif
|
||||
|
||||
/* grid-fitting and scaling table */
|
||||
TT_GaspRec gasp; /* the `gasp' table */
|
||||
|
||||
|
@ -1320,11 +1231,6 @@ FT_BEGIN_HEADER
|
|||
TT_PCLT pclt;
|
||||
|
||||
/* embedded bitmaps support */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong num_sbit_strikes;
|
||||
TT_SBit_Strike sbit_strikes;
|
||||
#endif
|
||||
|
||||
FT_ULong num_sbit_scales;
|
||||
TT_SBit_Scale sbit_scales;
|
||||
|
||||
|
@ -1338,12 +1244,6 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
/* the glyph locations */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort num_locations_stub;
|
||||
FT_Long* glyph_locations_stub;
|
||||
#endif
|
||||
|
||||
/* the font program, if any */
|
||||
FT_ULong font_program_size;
|
||||
FT_Byte* font_program;
|
||||
|
@ -1356,13 +1256,6 @@ FT_BEGIN_HEADER
|
|||
FT_ULong cvt_size;
|
||||
FT_Short* cvt;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
/* the format 0 kerning table, if any */
|
||||
FT_Int num_kern_pairs;
|
||||
FT_Int kern_table_index;
|
||||
TT_Kern0_Pair kern_pairs;
|
||||
#endif
|
||||
|
||||
/* A pointer to the bytecode interpreter to use. This is also */
|
||||
/* used to hook the debugger for the `ttdebug' utility. */
|
||||
TT_Interpreter interpreter;
|
||||
|
@ -1383,11 +1276,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
const char* postscript_name;
|
||||
|
||||
/* since version 2.1.8, but was originally placed after */
|
||||
/* `glyph_locations_stub' */
|
||||
FT_ULong glyf_len;
|
||||
|
||||
/* since version 2.1.8, but was originally placed before `extra' */
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
FT_Bool doblend;
|
||||
GX_Blend blend;
|
||||
|
|
|
@ -152,40 +152,6 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* documentation is in ftcalc.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 )
|
||||
FT_Sqrt32( FT_Int32 x )
|
||||
{
|
||||
FT_UInt32 val, root, newroot, mask;
|
||||
|
||||
|
||||
root = 0;
|
||||
mask = (FT_UInt32)0x40000000UL;
|
||||
val = (FT_UInt32)x;
|
||||
|
||||
do
|
||||
{
|
||||
newroot = root + mask;
|
||||
if ( newroot <= val )
|
||||
{
|
||||
val -= newroot;
|
||||
root = newroot + mask;
|
||||
}
|
||||
|
||||
root >>= 1;
|
||||
mask >>= 2;
|
||||
|
||||
} while ( mask != 0 );
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
#ifdef FT_LONG64
|
||||
|
||||
|
||||
|
|
|
@ -4815,70 +4815,6 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
ft_stub_set_char_sizes( FT_Size size,
|
||||
FT_F26Dot6 width,
|
||||
FT_F26Dot6 height,
|
||||
FT_UInt horz_res,
|
||||
FT_UInt vert_res )
|
||||
{
|
||||
FT_Size_RequestRec req;
|
||||
FT_Driver driver = size->face->driver;
|
||||
|
||||
|
||||
if ( driver->clazz->request_size )
|
||||
{
|
||||
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
|
||||
req.width = width;
|
||||
req.height = height;
|
||||
|
||||
if ( horz_res == 0 )
|
||||
horz_res = vert_res;
|
||||
|
||||
if ( vert_res == 0 )
|
||||
vert_res = horz_res;
|
||||
|
||||
if ( horz_res == 0 )
|
||||
horz_res = vert_res = 72;
|
||||
|
||||
req.horiResolution = horz_res;
|
||||
req.vertResolution = vert_res;
|
||||
|
||||
return driver->clazz->request_size( size, &req );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
ft_stub_set_pixel_sizes( FT_Size size,
|
||||
FT_UInt width,
|
||||
FT_UInt height )
|
||||
{
|
||||
FT_Size_RequestRec req;
|
||||
FT_Driver driver = size->face->driver;
|
||||
|
||||
|
||||
if ( driver->clazz->request_size )
|
||||
{
|
||||
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
|
||||
req.width = width << 6;
|
||||
req.height = height << 6;
|
||||
req.horiResolution = 0;
|
||||
req.vertResolution = 0;
|
||||
|
||||
return driver->clazz->request_size( size, &req );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
|
|
@ -433,70 +433,4 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
(void)FT_ALLOC( *P, size );
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
(void)FT_QALLOC( *p, size );
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
(void)FT_REALLOC( *P, current, size );
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
(void)FT_QREALLOC( *p, current, size );
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void* *P )
|
||||
{
|
||||
if ( *P )
|
||||
FT_MEM_FREE( *P );
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -864,10 +864,6 @@ THE SOFTWARE.
|
|||
0, /* FT_Slot_InitFunc */
|
||||
0, /* FT_Slot_DoneFunc */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
BDF_Glyph_Load,
|
||||
|
||||
0, /* FT_Face_GetKerningFunc */
|
||||
|
|
|
@ -30,44 +30,6 @@
|
|||
#define FT_COMPONENT trace_cache
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*
|
||||
* These structures correspond to the FTC_Font and FTC_ImageDesc types
|
||||
* that were defined in version 2.1.7.
|
||||
*/
|
||||
typedef struct FTC_OldFontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
|
||||
} FTC_OldFontRec, *FTC_OldFont;
|
||||
|
||||
|
||||
typedef struct FTC_OldImageDescRec_
|
||||
{
|
||||
FTC_OldFontRec font;
|
||||
FT_UInt32 flags;
|
||||
|
||||
} FTC_OldImageDescRec, *FTC_OldImageDesc;
|
||||
|
||||
|
||||
/*
|
||||
* Notice that FTC_OldImageDescRec and FTC_ImageTypeRec are nearly
|
||||
* identical, bit-wise. The only difference is that the `width' and
|
||||
* `height' fields are expressed as 16-bit integers in the old structure,
|
||||
* and as normal `int' in the new one.
|
||||
*
|
||||
* We are going to perform a weird hack to detect which structure is
|
||||
* being passed to the image and sbit caches. If the new structure's
|
||||
* `width' is larger than 0x10000, we assume that we are really receiving
|
||||
* an FTC_OldImageDesc.
|
||||
*/
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
* Basic Families
|
||||
*
|
||||
|
@ -336,26 +298,6 @@
|
|||
if ( anode )
|
||||
*anode = NULL;
|
||||
|
||||
#if defined( FT_CONFIG_OPTION_OLD_INTERNALS ) && ( FT_INT_MAX > 0xFFFFU )
|
||||
|
||||
/*
|
||||
* This one is a major hack used to detect whether we are passed a
|
||||
* regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
|
||||
*/
|
||||
if ( (FT_ULong)type->width >= 0x10000L )
|
||||
{
|
||||
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;
|
||||
|
||||
|
||||
query.attrs.scaler.face_id = desc->font.face_id;
|
||||
query.attrs.scaler.width = desc->font.pix_width;
|
||||
query.attrs.scaler.height = desc->font.pix_height;
|
||||
query.attrs.load_flags = desc->flags;
|
||||
}
|
||||
else
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
{
|
||||
if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
|
||||
{
|
||||
|
@ -467,142 +409,11 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* yet another backwards-legacy structure */
|
||||
typedef struct FTC_OldImage_Desc_
|
||||
{
|
||||
FTC_FontRec font;
|
||||
FT_UInt image_type;
|
||||
|
||||
} FTC_OldImage_Desc;
|
||||
|
||||
|
||||
#define FTC_OLD_IMAGE_FORMAT( x ) ( (x) & 7 )
|
||||
|
||||
|
||||
#define ftc_old_image_format_bitmap 0x0000
|
||||
#define ftc_old_image_format_outline 0x0001
|
||||
|
||||
#define ftc_old_image_format_mask 0x000F
|
||||
|
||||
#define ftc_old_image_flag_monochrome 0x0010
|
||||
#define ftc_old_image_flag_unhinted 0x0020
|
||||
#define ftc_old_image_flag_autohinted 0x0040
|
||||
#define ftc_old_image_flag_unscaled 0x0080
|
||||
#define ftc_old_image_flag_no_sbits 0x0100
|
||||
|
||||
/* monochrome bitmap */
|
||||
#define ftc_old_image_mono ftc_old_image_format_bitmap | \
|
||||
ftc_old_image_flag_monochrome
|
||||
|
||||
/* anti-aliased bitmap */
|
||||
#define ftc_old_image_grays ftc_old_image_format_bitmap
|
||||
|
||||
/* scaled outline */
|
||||
#define ftc_old_image_outline ftc_old_image_format_outline
|
||||
|
||||
|
||||
static void
|
||||
ftc_image_type_from_old_desc( FTC_ImageType typ,
|
||||
FTC_OldImage_Desc* desc )
|
||||
{
|
||||
typ->face_id = desc->font.face_id;
|
||||
typ->width = desc->font.pix_width;
|
||||
typ->height = desc->font.pix_height;
|
||||
|
||||
/* convert image type flags to load flags */
|
||||
{
|
||||
FT_UInt load_flags = FT_LOAD_DEFAULT;
|
||||
FT_UInt type = desc->image_type;
|
||||
|
||||
|
||||
/* determine load flags, depending on the font description's */
|
||||
/* image type */
|
||||
|
||||
if ( FTC_OLD_IMAGE_FORMAT( type ) == ftc_old_image_format_bitmap )
|
||||
{
|
||||
if ( type & ftc_old_image_flag_monochrome )
|
||||
load_flags |= FT_LOAD_MONOCHROME;
|
||||
|
||||
/* disable embedded bitmaps loading if necessary */
|
||||
if ( type & ftc_old_image_flag_no_sbits )
|
||||
load_flags |= FT_LOAD_NO_BITMAP;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* we want an outline, don't load embedded bitmaps */
|
||||
load_flags |= FT_LOAD_NO_BITMAP;
|
||||
|
||||
if ( type & ftc_old_image_flag_unscaled )
|
||||
load_flags |= FT_LOAD_NO_SCALE;
|
||||
}
|
||||
|
||||
/* always render glyphs to bitmaps */
|
||||
load_flags |= FT_LOAD_RENDER;
|
||||
|
||||
if ( type & ftc_old_image_flag_unhinted )
|
||||
load_flags |= FT_LOAD_NO_HINTING;
|
||||
|
||||
if ( type & ftc_old_image_flag_autohinted )
|
||||
load_flags |= FT_LOAD_FORCE_AUTOHINT;
|
||||
|
||||
typ->flags = load_flags;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Image_Cache_New( FTC_Manager manager,
|
||||
FTC_ImageCache *acache );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Image_Cache_Lookup( FTC_ImageCache icache,
|
||||
FTC_OldImage_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FT_Glyph *aglyph );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_Image_Cache_New( FTC_Manager manager,
|
||||
FTC_ImageCache *acache )
|
||||
{
|
||||
return FTC_ImageCache_New( manager, (FTC_ImageCache*)acache );
|
||||
}
|
||||
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_Image_Cache_Lookup( FTC_ImageCache icache,
|
||||
FTC_OldImage_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FT_Glyph *aglyph )
|
||||
{
|
||||
FTC_ImageTypeRec type0;
|
||||
|
||||
|
||||
if ( !desc )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
ftc_image_type_from_old_desc( &type0, desc );
|
||||
|
||||
return FTC_ImageCache_Lookup( (FTC_ImageCache)icache,
|
||||
&type0,
|
||||
gindex,
|
||||
aglyph,
|
||||
NULL );
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* basic small bitmap cache
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* basic small bitmap cache
|
||||
*
|
||||
*/
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FTC_SFamilyClassRec ftc_basic_sbit_family_class =
|
||||
|
@ -672,25 +483,6 @@
|
|||
|
||||
*ansbit = NULL;
|
||||
|
||||
#if defined( FT_CONFIG_OPTION_OLD_INTERNALS ) && ( FT_INT_MAX > 0xFFFFU )
|
||||
|
||||
/* This one is a major hack used to detect whether we are passed a
|
||||
* regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
|
||||
*/
|
||||
if ( (FT_ULong)type->width >= 0x10000L )
|
||||
{
|
||||
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;
|
||||
|
||||
|
||||
query.attrs.scaler.face_id = desc->font.face_id;
|
||||
query.attrs.scaler.width = desc->font.pix_width;
|
||||
query.attrs.scaler.height = desc->font.pix_height;
|
||||
query.attrs.load_flags = desc->flags;
|
||||
}
|
||||
else
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
{
|
||||
if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX )
|
||||
{
|
||||
|
@ -807,49 +599,4 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBit_Cache_New( FTC_Manager manager,
|
||||
FTC_SBitCache *acache );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBit_Cache_Lookup( FTC_SBitCache cache,
|
||||
FTC_OldImage_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FTC_SBit *ansbit );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_SBit_Cache_New( FTC_Manager manager,
|
||||
FTC_SBitCache *acache )
|
||||
{
|
||||
return FTC_SBitCache_New( manager, (FTC_SBitCache*)acache );
|
||||
}
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_SBit_Cache_Lookup( FTC_SBitCache cache,
|
||||
FTC_OldImage_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FTC_SBit *ansbit )
|
||||
{
|
||||
FTC_ImageTypeRec type0;
|
||||
|
||||
|
||||
if ( !desc )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
ftc_image_type_from_old_desc( &type0, desc );
|
||||
|
||||
return FTC_SBitCache_Lookup( (FTC_SBitCache)cache,
|
||||
&type0,
|
||||
gindex,
|
||||
ansbit,
|
||||
NULL );
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -269,11 +269,7 @@
|
|||
|
||||
|
||||
/* remove a node from the cache manager */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_BASE_DEF( void )
|
||||
#else
|
||||
FT_LOCAL_DEF( void )
|
||||
#endif
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager )
|
||||
{
|
||||
|
|
|
@ -86,12 +86,6 @@ FT_BEGIN_HEADER
|
|||
ftc_get_top_node_for_hash( ( cache ), ( hash ) )
|
||||
#endif
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_BASE( void )
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Callback functions of the caching sub-system (specification only). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006, 2011 by */
|
||||
/* Copyright 2004-2006, 2011, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -81,11 +81,10 @@
|
|||
FT_LOCAL( void )
|
||||
ftc_cache_done( FTC_Cache cache );
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_LOCAL( void )
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FTCCBACK_H__ */
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType CharMap cache (body) */
|
||||
/* */
|
||||
/* Copyright 2000-2012 by */
|
||||
/* Copyright 2000-2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -31,43 +31,6 @@
|
|||
#define FT_COMPONENT trace_cache
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
typedef enum FTC_OldCMapType_
|
||||
{
|
||||
FTC_OLD_CMAP_BY_INDEX = 0,
|
||||
FTC_OLD_CMAP_BY_ENCODING = 1,
|
||||
FTC_OLD_CMAP_BY_ID = 2
|
||||
|
||||
} FTC_OldCMapType;
|
||||
|
||||
|
||||
typedef struct FTC_OldCMapIdRec_
|
||||
{
|
||||
FT_UInt platform;
|
||||
FT_UInt encoding;
|
||||
|
||||
} FTC_OldCMapIdRec, *FTC_OldCMapId;
|
||||
|
||||
|
||||
typedef struct FTC_OldCMapDescRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FTC_OldCMapType type;
|
||||
|
||||
union
|
||||
{
|
||||
FT_UInt index;
|
||||
FT_Encoding encoding;
|
||||
FTC_OldCMapIdRec id;
|
||||
|
||||
} u;
|
||||
|
||||
} FTC_OldCMapDescRec, *FTC_OldCMapDesc;
|
||||
|
||||
#endif /* FT_CONFIG_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each FTC_CMapNode contains a simple array to map a range of character */
|
||||
|
@ -266,21 +229,6 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*
|
||||
* Unfortunately, it is not possible to support binary backwards
|
||||
* compatibility in the cmap cache. The FTC_CMapCache_Lookup signature
|
||||
* changes were too deep, and there is no clever hackish way to detect
|
||||
* what kind of structure we are being passed.
|
||||
*
|
||||
* On the other hand it seems that no production code is using this
|
||||
* function on Unix distributions.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* documentation is in ftcache.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_UInt )
|
||||
|
@ -315,57 +263,9 @@
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*
|
||||
* If cmap_index is greater than the maximum number of cachable
|
||||
* charmaps, we assume the request is from a legacy rogue client
|
||||
* using old internal header. See include/config/ftoption.h.
|
||||
*/
|
||||
if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE && !no_cmap_change )
|
||||
{
|
||||
FTC_OldCMapDesc desc = (FTC_OldCMapDesc) face_id;
|
||||
|
||||
|
||||
char_code = (FT_UInt32)cmap_index;
|
||||
query.face_id = desc->face_id;
|
||||
|
||||
|
||||
switch ( desc->type )
|
||||
{
|
||||
case FTC_OLD_CMAP_BY_INDEX:
|
||||
query.cmap_index = desc->u.index;
|
||||
query.char_code = (FT_UInt32)cmap_index;
|
||||
break;
|
||||
|
||||
case FTC_OLD_CMAP_BY_ENCODING:
|
||||
{
|
||||
FT_Face face;
|
||||
|
||||
|
||||
error = FTC_Manager_LookupFace( cache->manager, desc->face_id,
|
||||
&face );
|
||||
if ( error )
|
||||
return 0;
|
||||
|
||||
FT_Select_Charmap( face, desc->u.encoding );
|
||||
|
||||
return FT_Get_Char_Index( face, char_code );
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
{
|
||||
query.face_id = face_id;
|
||||
query.cmap_index = (FT_UInt)cmap_index;
|
||||
query.char_code = char_code;
|
||||
}
|
||||
query.face_id = face_id;
|
||||
query.cmap_index = (FT_UInt)cmap_index;
|
||||
query.char_code = char_code;
|
||||
|
||||
hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
|
||||
|
||||
|
|
|
@ -689,55 +689,4 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FTC_Manager_Lookup_Face( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface )
|
||||
{
|
||||
return FTC_Manager_LookupFace( manager, face_id, aface );
|
||||
}
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Size( FTC_Manager manager,
|
||||
FTC_Font font,
|
||||
FT_Face *aface,
|
||||
FT_Size *asize )
|
||||
{
|
||||
FTC_ScalerRec scaler;
|
||||
FT_Error error;
|
||||
FT_Size size;
|
||||
FT_Face face;
|
||||
|
||||
|
||||
scaler.face_id = font->face_id;
|
||||
scaler.width = font->pix_width;
|
||||
scaler.height = font->pix_height;
|
||||
scaler.pixel = TRUE;
|
||||
scaler.x_res = 0;
|
||||
scaler.y_res = 0;
|
||||
|
||||
error = FTC_Manager_LookupSize( manager, &scaler, &size );
|
||||
if ( error )
|
||||
{
|
||||
face = NULL;
|
||||
size = NULL;
|
||||
}
|
||||
else
|
||||
face = size->face;
|
||||
|
||||
if ( aface )
|
||||
*aface = face;
|
||||
|
||||
if ( asize )
|
||||
*asize = size;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -765,9 +765,6 @@
|
|||
cff_slot_init,
|
||||
cff_slot_done,
|
||||
|
||||
ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
cff_glyph_load,
|
||||
|
||||
cff_get_kerning,
|
||||
|
|
|
@ -2711,16 +2711,9 @@
|
|||
&advance );
|
||||
glyph->root.linearHoriAdvance = advance;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
has_vertical_info = FT_BOOL(
|
||||
face->vertical_info &&
|
||||
face->vertical.number_Of_VMetrics > 0 &&
|
||||
face->vertical.long_metrics );
|
||||
#else
|
||||
has_vertical_info = FT_BOOL(
|
||||
face->vertical_info &&
|
||||
face->vertical.number_Of_VMetrics > 0 );
|
||||
#endif
|
||||
|
||||
/* get the vertical metrics from the vtmx table if we have one */
|
||||
if ( has_vertical_info )
|
||||
|
@ -2936,14 +2929,8 @@
|
|||
glyph->root.linearHoriAdvance = decoder.glyph_width;
|
||||
glyph->root.internal->glyph_transformed = 0;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
has_vertical_info = FT_BOOL( face->vertical_info &&
|
||||
face->vertical.number_Of_VMetrics > 0 &&
|
||||
face->vertical.long_metrics );
|
||||
#else
|
||||
has_vertical_info = FT_BOOL( face->vertical_info &&
|
||||
face->vertical.number_Of_VMetrics > 0 );
|
||||
#endif
|
||||
|
||||
/* get the vertical metrics from the vtmx table if we have one */
|
||||
if ( has_vertical_info )
|
||||
|
|
|
@ -221,11 +221,6 @@
|
|||
cid_slot_init,
|
||||
cid_slot_done,
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
|
||||
cid_slot_load_glyph,
|
||||
|
||||
0, /* FT_Face_GetKerningFunc */
|
||||
|
|
|
@ -699,10 +699,6 @@ THE SOFTWARE.
|
|||
0, /* FT_Slot_InitFunc */
|
||||
0, /* FT_Slot_DoneFunc */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
PCF_Glyph_Load,
|
||||
|
||||
0, /* FT_Face_GetKerningFunc */
|
||||
|
|
|
@ -197,10 +197,6 @@
|
|||
pfr_slot_init,
|
||||
pfr_slot_done,
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
pfr_slot_load,
|
||||
|
||||
pfr_get_kerning,
|
||||
|
|
|
@ -445,134 +445,6 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_load_sfnt_header_stub( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Long face_index,
|
||||
SFNT_Header header )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( stream );
|
||||
FT_UNUSED( face_index );
|
||||
FT_UNUSED( header );
|
||||
|
||||
return FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_load_directory_stub( TT_Face face,
|
||||
FT_Stream stream,
|
||||
SFNT_Header header )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( stream );
|
||||
FT_UNUSED( header );
|
||||
|
||||
return FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_load_hdmx_stub( TT_Face face,
|
||||
FT_Stream stream )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( stream );
|
||||
|
||||
return FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
tt_face_free_hdmx_stub( TT_Face face )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_set_sbit_strike_stub( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong* astrike_index )
|
||||
{
|
||||
/*
|
||||
* We simply forge a FT_Size_Request and call the real function
|
||||
* that does all the work.
|
||||
*
|
||||
* This stub might be called by libXfont in the X.Org Xserver,
|
||||
* compiled against version 2.1.8 or newer.
|
||||
*/
|
||||
|
||||
FT_Size_RequestRec req;
|
||||
|
||||
|
||||
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
|
||||
req.width = (FT_F26Dot6)x_ppem;
|
||||
req.height = (FT_F26Dot6)y_ppem;
|
||||
req.horiResolution = 0;
|
||||
req.vertResolution = 0;
|
||||
|
||||
*astrike_index = 0x7FFFFFFFUL;
|
||||
|
||||
return tt_face_set_sbit_strike( face, &req, astrike_index );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_load_sbit_stub( TT_Face face,
|
||||
FT_Stream stream )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( stream );
|
||||
|
||||
/*
|
||||
* This function was originally implemented to load the sbit table.
|
||||
* However, it has been replaced by `tt_face_load_eblc', and this stub
|
||||
* is only there for some rogue clients which would want to call it
|
||||
* directly (which doesn't make much sense).
|
||||
*/
|
||||
return FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
tt_face_free_sbit_stub( TT_Face face )
|
||||
{
|
||||
/* nothing to do in this stub */
|
||||
FT_UNUSED( face );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_load_charmap_stub( TT_Face face,
|
||||
void* cmap,
|
||||
FT_Stream input )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( cmap );
|
||||
FT_UNUSED( input );
|
||||
|
||||
return FT_THROW( Unimplemented_Feature );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
tt_face_free_charmap_stub( TT_Face face,
|
||||
void* cmap )
|
||||
{
|
||||
FT_UNUSED( face );
|
||||
FT_UNUSED( cmap );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
#define PUT_EMBEDDED_BITMAPS( a ) a
|
||||
#else
|
||||
|
@ -596,9 +468,6 @@
|
|||
|
||||
tt_face_load_any,
|
||||
|
||||
tt_face_load_sfnt_header_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
tt_face_load_directory_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
tt_face_load_head,
|
||||
tt_face_load_hhea,
|
||||
tt_face_load_cmap,
|
||||
|
@ -609,9 +478,6 @@
|
|||
tt_face_load_name,
|
||||
tt_face_free_name,
|
||||
|
||||
tt_face_load_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
tt_face_free_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
tt_face_load_kern,
|
||||
tt_face_load_gasp,
|
||||
tt_face_load_pclt,
|
||||
|
@ -619,29 +485,16 @@
|
|||
/* see `ttload.h' */
|
||||
PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),
|
||||
|
||||
tt_face_set_sbit_strike_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
tt_face_load_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
tt_find_sbit_image, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
tt_load_sbit_metrics, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),
|
||||
|
||||
tt_face_free_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
/* see `ttpost.h' */
|
||||
PUT_PS_NAMES( tt_face_get_ps_name ),
|
||||
PUT_PS_NAMES( tt_face_free_ps_names ),
|
||||
|
||||
tt_face_load_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
tt_face_free_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
/* since version 2.1.8 */
|
||||
|
||||
tt_face_get_kerning,
|
||||
|
||||
/* since version 2.2 */
|
||||
|
||||
tt_face_load_font_dir,
|
||||
tt_face_load_hmtx,
|
||||
|
||||
|
|
|
@ -919,11 +919,7 @@
|
|||
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 )
|
||||
{
|
||||
|
@ -1124,7 +1120,6 @@
|
|||
}
|
||||
|
||||
/* freeing the horizontal metrics */
|
||||
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
{
|
||||
FT_Stream stream = FT_FACE_STREAM( face );
|
||||
|
||||
|
@ -1134,10 +1129,6 @@
|
|||
face->horz_metrics_size = 0;
|
||||
face->vert_metrics_size = 0;
|
||||
}
|
||||
#else
|
||||
FT_FREE( face->horizontal.long_metrics );
|
||||
FT_FREE( face->horizontal.short_metrics );
|
||||
#endif
|
||||
|
||||
/* freeing the vertical ones, if any */
|
||||
if ( face->vertical_info )
|
||||
|
|
189
src/sfnt/ttmtx.c
189
src/sfnt/ttmtx.c
|
@ -35,13 +35,6 @@
|
|||
#define FT_COMPONENT trace_ttmtx
|
||||
|
||||
|
||||
/*
|
||||
* Unfortunately, we can't enable our memory optimizations if
|
||||
* FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because at least
|
||||
* one rogue client (libXfont in the X.Org XServer) is directly accessing
|
||||
* the metrics.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -60,8 +53,6 @@
|
|||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
tt_face_load_hmtx( TT_Face face,
|
||||
FT_Stream stream,
|
||||
|
@ -97,142 +88,6 @@
|
|||
return error;
|
||||
}
|
||||
|
||||
#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
tt_face_load_hmtx( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Bool vertical )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Memory memory = stream->memory;
|
||||
|
||||
FT_ULong table_len;
|
||||
FT_Long num_shorts, num_longs, num_shorts_checked;
|
||||
|
||||
TT_LongMetrics* longs;
|
||||
TT_ShortMetrics** shorts;
|
||||
FT_Byte* p;
|
||||
|
||||
|
||||
if ( vertical )
|
||||
{
|
||||
void* lm = &face->vertical.long_metrics;
|
||||
void** sm = &face->vertical.short_metrics;
|
||||
|
||||
|
||||
error = face->goto_table( face, TTAG_vmtx, stream, &table_len );
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
num_longs = face->vertical.number_Of_VMetrics;
|
||||
if ( (FT_ULong)num_longs > table_len / 4 )
|
||||
num_longs = (FT_Long)( table_len / 4 );
|
||||
|
||||
face->vertical.number_Of_VMetrics = 0;
|
||||
|
||||
longs = (TT_LongMetrics*)lm;
|
||||
shorts = (TT_ShortMetrics**)sm;
|
||||
}
|
||||
else
|
||||
{
|
||||
void* lm = &face->horizontal.long_metrics;
|
||||
void** sm = &face->horizontal.short_metrics;
|
||||
|
||||
|
||||
error = face->goto_table( face, TTAG_hmtx, stream, &table_len );
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
num_longs = face->horizontal.number_Of_HMetrics;
|
||||
if ( (FT_ULong)num_longs > table_len / 4 )
|
||||
num_longs = (FT_Long)( table_len / 4 );
|
||||
|
||||
face->horizontal.number_Of_HMetrics = 0;
|
||||
|
||||
longs = (TT_LongMetrics*)lm;
|
||||
shorts = (TT_ShortMetrics**)sm;
|
||||
}
|
||||
|
||||
/* never trust derived values */
|
||||
|
||||
num_shorts = face->max_profile.numGlyphs - num_longs;
|
||||
num_shorts_checked = ( table_len - num_longs * 4L ) / 2;
|
||||
|
||||
if ( num_shorts < 0 )
|
||||
{
|
||||
FT_TRACE0(( "tt_face_load_hmtx:"
|
||||
" %cmtx has more metrics than glyphs.\n",
|
||||
vertical ? 'v' : 'h' ));
|
||||
|
||||
/* Adobe simply ignores this problem. So we shall do the same. */
|
||||
#if 0
|
||||
error = vertical ? FT_THROW( Invalid_Vert_Metrics )
|
||||
: FT_THROW( Invalid_Horiz_Metrics );
|
||||
goto Exit;
|
||||
#else
|
||||
num_shorts = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( FT_QNEW_ARRAY( *longs, num_longs ) ||
|
||||
FT_QNEW_ARRAY( *shorts, num_shorts ) )
|
||||
goto Fail;
|
||||
|
||||
if ( FT_FRAME_ENTER( table_len ) )
|
||||
goto Fail;
|
||||
|
||||
p = stream->cursor;
|
||||
|
||||
{
|
||||
TT_LongMetrics cur = *longs;
|
||||
TT_LongMetrics limit = cur + num_longs;
|
||||
|
||||
|
||||
for ( ; cur < limit; cur++ )
|
||||
{
|
||||
cur->advance = FT_NEXT_USHORT( p );
|
||||
cur->bearing = FT_NEXT_SHORT( p );
|
||||
}
|
||||
}
|
||||
|
||||
/* do we have an inconsistent number of metric values? */
|
||||
{
|
||||
TT_ShortMetrics* cur = *shorts;
|
||||
TT_ShortMetrics* limit = cur +
|
||||
FT_MIN( num_shorts, num_shorts_checked );
|
||||
|
||||
|
||||
for ( ; cur < limit; cur++ )
|
||||
*cur = FT_NEXT_SHORT( p );
|
||||
|
||||
/* We fill up the missing left side bearings with the */
|
||||
/* last valid value. Since this will occur for buggy CJK */
|
||||
/* fonts usually only, nothing serious will happen. */
|
||||
if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 )
|
||||
{
|
||||
FT_Short val = (*shorts)[num_shorts_checked - 1];
|
||||
|
||||
|
||||
limit = *shorts + num_shorts;
|
||||
for ( ; cur < limit; cur++ )
|
||||
*cur = val;
|
||||
}
|
||||
}
|
||||
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
if ( vertical )
|
||||
face->vertical.number_Of_VMetrics = (FT_UShort)num_longs;
|
||||
else
|
||||
face->horizontal.number_Of_HMetrics = (FT_UShort)num_longs;
|
||||
|
||||
Fail:
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -343,8 +198,6 @@
|
|||
/* */
|
||||
/* advance :: The advance width resp. advance height. */
|
||||
/* */
|
||||
#ifndef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
tt_face_get_metrics( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
|
@ -422,47 +275,5 @@
|
|||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
tt_face_get_metrics( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
FT_UInt gindex,
|
||||
FT_Short* abearing,
|
||||
FT_UShort* aadvance )
|
||||
{
|
||||
void* v = &face->vertical;
|
||||
void* h = &face->horizontal;
|
||||
TT_HoriHeader* header = vertical ? (TT_HoriHeader*)v
|
||||
: (TT_HoriHeader*)h;
|
||||
TT_LongMetrics longs_m;
|
||||
FT_UShort k = header->number_Of_HMetrics;
|
||||
|
||||
|
||||
if ( k == 0 ||
|
||||
!header->long_metrics ||
|
||||
gindex >= (FT_UInt)face->max_profile.numGlyphs )
|
||||
{
|
||||
*abearing = *aadvance = 0;
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
if ( gindex < (FT_UInt)k )
|
||||
{
|
||||
longs_m = (TT_LongMetrics)header->long_metrics + gindex;
|
||||
*abearing = longs_m->bearing;
|
||||
*aadvance = longs_m->advance;
|
||||
}
|
||||
else
|
||||
{
|
||||
*abearing = ((TT_ShortMetrics*)header->short_metrics)[gindex - k];
|
||||
*aadvance = ((TT_LongMetrics)header->long_metrics)[k - 1].advance;
|
||||
}
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
1477
src/sfnt/ttsbit.c
1477
src/sfnt/ttsbit.c
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType and OpenType embedded bitmap support (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
|
||||
/* Copyright 1996-2008, 2013 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -45,22 +45,6 @@ FT_BEGIN_HEADER
|
|||
FT_ULong strike_index,
|
||||
FT_Size_Metrics* metrics );
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_LOCAL( FT_Error )
|
||||
tt_find_sbit_image( TT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_ULong strike_index,
|
||||
TT_SBit_Range *arange,
|
||||
TT_SBit_Strike *astrike,
|
||||
FT_ULong *aglyph_offset );
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
tt_load_sbit_metrics( FT_Stream stream,
|
||||
TT_SBit_Range range,
|
||||
TT_SBit_Metrics metrics );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
tt_face_load_sbit_image( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
|
|
|
@ -486,9 +486,6 @@
|
|||
tt_slot_init,
|
||||
0, /* FT_Slot_DoneFunc */
|
||||
|
||||
ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
tt_glyph_load,
|
||||
|
||||
tt_get_kerning,
|
||||
|
|
|
@ -708,10 +708,6 @@
|
|||
T1_GlyphSlot_Init,
|
||||
T1_GlyphSlot_Done,
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
T1_Load_Glyph,
|
||||
|
||||
#ifdef T1_CONFIG_OPTION_NO_AFM
|
||||
|
|
|
@ -230,10 +230,6 @@
|
|||
T42_GlyphSlot_Init,
|
||||
T42_GlyphSlot_Done,
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
T42_GlyphSlot_Load,
|
||||
|
||||
0, /* FT_Face_GetKerningFunc */
|
||||
|
|
|
@ -1141,10 +1141,6 @@
|
|||
0, /* FT_Slot_InitFunc */
|
||||
0, /* FT_Slot_DoneFunc */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
ft_stub_set_char_sizes,
|
||||
ft_stub_set_pixel_sizes,
|
||||
#endif
|
||||
FNT_Load_Glyph,
|
||||
|
||||
0, /* FT_Face_GetKerningFunc */
|
||||
|
|
Loading…
Reference in New Issue