mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 06:52:20 +00:00
[CHG] FreeType updated to version 2.4.6
This commit is contained in:
parent
96321c05f9
commit
46174e2847
15 changed files with 864 additions and 331 deletions
|
@ -199,7 +199,7 @@ dist:
|
|||
|
||||
currdir=`pwd` ; \
|
||||
for f in `find . -wholename '*/.git' -prune \
|
||||
-o -name .cvsignore \
|
||||
-o -name .gitignore \
|
||||
-o -type d \
|
||||
-o -print` ; do \
|
||||
ln -s $$currdir/$$f tmp/$$f ; \
|
||||
|
|
|
@ -203,6 +203,17 @@ FT_BEGIN_HEADER
|
|||
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define to disable the use of file stream functions and types, FILE, */
|
||||
/* fopen() etc. Enables the use of smaller system libraries on embedded */
|
||||
/* systems that have multiple system libraries, some with or without */
|
||||
/* file stream support, in the cases where file stream support is not */
|
||||
/* necessary such as memory loading of font files. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
|
|
|
@ -1063,8 +1063,8 @@ FT_BEGIN_HEADER
|
|||
/* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
|
||||
/* probably never want this except for demonstration purposes. */
|
||||
/* */
|
||||
/* Currently, there are six TrueType fonts in the list of tricky */
|
||||
/* fonts; they are hard-coded in file `ttobjs.c'. */
|
||||
/* Currently, there are about a dozen TrueType fonts in the list of */
|
||||
/* tricky fonts; they are hard-coded in file `ttobjs.c'. */
|
||||
/* */
|
||||
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
|
||||
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
|
||||
|
@ -2107,8 +2107,8 @@ FT_BEGIN_HEADER
|
|||
/* used to determine both scaling values. */
|
||||
/* */
|
||||
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
|
||||
/* The real dimension. The sum of the the `Ascender' and (minus */
|
||||
/* of) the `Descender' fields of @FT_FaceRec are used to determine */
|
||||
/* The real dimension. The sum of the the `ascender' and (minus */
|
||||
/* of) the `descender' fields of @FT_FaceRec are used to determine */
|
||||
/* both scaling values. */
|
||||
/* */
|
||||
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
|
||||
|
@ -2916,6 +2916,10 @@ FT_BEGIN_HEADER
|
|||
/* The glyph name is truncated to fit within the buffer if it is too */
|
||||
/* long. The returned string is always zero-terminated. */
|
||||
/* */
|
||||
/* Be aware that FreeType reorders glyph indices internally so that */
|
||||
/* glyph index~0 always corresponds to the `missing glyph' (called */
|
||||
/* `.notdef'). */
|
||||
/* */
|
||||
/* This function is not compiled within the library if the config */
|
||||
/* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
|
||||
/* `include/freetype/config/ftoptions.h'. */
|
||||
|
@ -3326,6 +3330,9 @@ FT_BEGIN_HEADER
|
|||
/* in the @PS_FontInfoRec structure which is only guaranteed to */
|
||||
/* return the correct results for Type~1 fonts. */
|
||||
/* */
|
||||
/* <Since> */
|
||||
/* 2.3.8 */
|
||||
/* */
|
||||
FT_EXPORT( FT_UShort )
|
||||
FT_Get_FSType_Flags( FT_Face face );
|
||||
|
||||
|
@ -3803,7 +3810,7 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
#define FREETYPE_MAJOR 2
|
||||
#define FREETYPE_MINOR 4
|
||||
#define FREETYPE_PATCH 5
|
||||
#define FREETYPE_PATCH 6
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType path stroker (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
|
||||
/* Copyright 2002-2006, 2008, 2009, 2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -75,20 +75,44 @@ FT_BEGIN_HEADER
|
|||
* to join two lines smoothly.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_BEVEL ::
|
||||
* Used to render beveled line joins; i.e., the two joining lines
|
||||
* are extended until they intersect.
|
||||
* Used to render beveled line joins. The outer corner of
|
||||
* the joined lines is filled by enclosing the triangular
|
||||
* region of the corner with a straight line between the
|
||||
* outer corners of each stroke.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_MITER_FIXED ::
|
||||
* Used to render mitered line joins, with fixed bevels if the
|
||||
* miter limit is exceeded. The outer edges of the strokes
|
||||
* for the two segments are extended until they meet at an
|
||||
* angle. If the segments meet at too sharp an angle (such
|
||||
* that the miter would extend from the intersection of the
|
||||
* segments a distance greater than the product of the miter
|
||||
* limit value and the border radius), then a bevel join (see
|
||||
* above) is used instead. This prevents long spikes being
|
||||
* created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
|
||||
* line join as used in PostScript and PDF.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_MITER_VARIABLE ::
|
||||
* FT_STROKER_LINEJOIN_MITER ::
|
||||
* Same as beveled rendering, except that an additional line
|
||||
* break is added if the angle between the two joining lines
|
||||
* is too closed (this is useful to avoid unpleasant spikes
|
||||
* in beveled rendering).
|
||||
* Used to render mitered line joins, with variable bevels if
|
||||
* the miter limit is exceeded. The intersection of the
|
||||
* strokes is clipped at a line perpendicular to the bisector
|
||||
* of the angle between the strokes, at the distance from the
|
||||
* intersection of the segments equal to the product of the
|
||||
* miter limit value and the border radius. This prevents
|
||||
* long spikes being created.
|
||||
* FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
|
||||
* join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
|
||||
* for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
|
||||
* backwards compatibility.
|
||||
*/
|
||||
typedef enum FT_Stroker_LineJoin_
|
||||
{
|
||||
FT_STROKER_LINEJOIN_ROUND = 0,
|
||||
FT_STROKER_LINEJOIN_BEVEL,
|
||||
FT_STROKER_LINEJOIN_MITER
|
||||
FT_STROKER_LINEJOIN_BEVEL = 1,
|
||||
FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
|
||||
FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
|
||||
FT_STROKER_LINEJOIN_MITER_FIXED = 3
|
||||
|
||||
} FT_Stroker_LineJoin;
|
||||
|
||||
|
@ -245,7 +269,8 @@ FT_BEGIN_HEADER
|
|||
* The line join style.
|
||||
*
|
||||
* miter_limit ::
|
||||
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
||||
* The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
|
||||
* FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
|
||||
* expressed as 16.16 fixed point value.
|
||||
*
|
||||
* @note:
|
||||
|
|
|
@ -155,6 +155,9 @@
|
|||
(const FT_Byte*)args->memory_base,
|
||||
args->memory_size );
|
||||
}
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
||||
|
||||
else if ( args->flags & FT_OPEN_PATHNAME )
|
||||
{
|
||||
/* create a normal system stream */
|
||||
|
@ -170,6 +173,9 @@
|
|||
FT_FREE( stream );
|
||||
stream = args->stream;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
else
|
||||
error = FT_Err_Invalid_Argument;
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@
|
|||
|
||||
|
||||
#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
|
||||
!defined( TT_CONFIG_OPTION_BYTECODE_INTEPRETER )
|
||||
!defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )
|
||||
if ( face && FT_IS_SFNT( face ) )
|
||||
{
|
||||
result = !face->internal->ignore_unpatented_hinter;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* ANSI-specific FreeType low-level system interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2006, 2008, 2009, 2010 by */
|
||||
/* Copyright 1996-2002, 2006, 2008-2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -137,6 +137,7 @@
|
|||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -267,6 +268,7 @@
|
|||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
|
||||
* Copyright 2001-2011
|
||||
* Francesco Zappa Nardelli
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
@ -983,7 +983,7 @@
|
|||
FT_Error error = BDF_Err_Ok;
|
||||
|
||||
|
||||
/* First check to see if the property has */
|
||||
/* First check whether the property has */
|
||||
/* already been added or not. If it has, then */
|
||||
/* simply ignore it. */
|
||||
if ( hash_lookup( name, &(font->proptbl) ) )
|
||||
|
@ -1276,7 +1276,7 @@
|
|||
FT_Error error = BDF_Err_Ok;
|
||||
|
||||
|
||||
/* First, check to see if the property already exists in the font. */
|
||||
/* First, check whether the property already exists in the font. */
|
||||
if ( ( hn = hash_lookup( name, (hashtable *)font->internal ) ) != 0 )
|
||||
{
|
||||
/* The property already exists in the font, so simply replace */
|
||||
|
@ -1530,7 +1530,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
/* Check to see whether a glyph is being scanned but should be */
|
||||
/* Check whether a glyph is being scanned but should be */
|
||||
/* ignored because it is an unencoded glyph. */
|
||||
if ( ( p->flags & _BDF_GLYPH ) &&
|
||||
p->glyph_enc == -1 &&
|
||||
|
@ -1587,13 +1587,14 @@
|
|||
|
||||
/* Check that the encoding is in the range [0,65536] because */
|
||||
/* otherwise p->have (a bitmap with static size) overflows. */
|
||||
if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
|
||||
if ( p->glyph_enc > 0 &&
|
||||
(size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
|
||||
{
|
||||
error = BDF_Err_Invalid_File_Format;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Check to see whether this encoding has already been encountered. */
|
||||
/* Check whether this encoding has already been encountered. */
|
||||
/* If it has then change it to unencoded so it gets added if */
|
||||
/* indicated. */
|
||||
if ( p->glyph_enc >= 0 )
|
||||
|
@ -1634,7 +1635,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Unencoded glyph. Check to see whether it should */
|
||||
/* Unencoded glyph. Check whether it should */
|
||||
/* be added or not. */
|
||||
if ( p->opts->keep_unencoded != 0 )
|
||||
{
|
||||
|
@ -1676,7 +1677,7 @@
|
|||
else
|
||||
glyph = font->glyphs + ( font->glyphs_used - 1 );
|
||||
|
||||
/* Check to see whether a bitmap is being constructed. */
|
||||
/* Check whether a bitmap is being constructed. */
|
||||
if ( p->flags & _BDF_BITMAP )
|
||||
{
|
||||
/* If there are more rows than are specified in the glyph metrics, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* CFF token stream parser (body) */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010 by */
|
||||
/* Copyright 1996-2004, 2007-2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -35,8 +35,6 @@
|
|||
#define FT_COMPONENT trace_cffparse
|
||||
|
||||
|
||||
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
cff_parser_init( CFF_Parser parser,
|
||||
FT_UInt code,
|
||||
|
@ -475,6 +473,12 @@
|
|||
if ( scaling < 0 || scaling > 9 )
|
||||
{
|
||||
/* Return default matrix in case of unlikely values. */
|
||||
|
||||
FT_TRACE1(( "cff_parse_font_matrix:"
|
||||
" strange scaling value for xx element (%d),\n"
|
||||
" "
|
||||
" using default matrix\n", scaling ));
|
||||
|
||||
matrix->xx = 0x10000L;
|
||||
matrix->yx = 0;
|
||||
matrix->yx = 0;
|
||||
|
@ -493,6 +497,12 @@
|
|||
offset->y = cff_parse_fixed_scaled( data, scaling );
|
||||
|
||||
*upm = power_tens[scaling];
|
||||
|
||||
FT_TRACE4(( " font matrix: [%f %f %f %f]\n",
|
||||
(double)matrix->xx / *upm / 65536,
|
||||
(double)matrix->xy / *upm / 65536,
|
||||
(double)matrix->yx / *upm / 65536,
|
||||
(double)matrix->yy / *upm / 65536 ));
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
@ -518,6 +528,12 @@
|
|||
bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) );
|
||||
bbox->yMax = FT_RoundFix( cff_parse_fixed( data ) );
|
||||
error = CFF_Err_Ok;
|
||||
|
||||
FT_TRACE4(( " bbox: [%d %d %d %d]\n",
|
||||
bbox->xMin / 65536,
|
||||
bbox->yMin / 65536,
|
||||
bbox->xMax / 65536,
|
||||
bbox->yMax / 65536 ));
|
||||
}
|
||||
|
||||
return error;
|
||||
|
@ -566,6 +582,11 @@
|
|||
FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
|
||||
dict->cid_supplement ));
|
||||
error = CFF_Err_Ok;
|
||||
|
||||
FT_TRACE4(( " ROS: registry sid %d, ordering sid %d, supplement %d\n",
|
||||
dict->cid_registry,
|
||||
dict->cid_ordering,
|
||||
dict->cid_supplement ));
|
||||
}
|
||||
|
||||
return error;
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
/* */
|
||||
/* PostScript Type 1 decoding routines (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 */
|
||||
/* 2010 by */
|
||||
/* Copyright 2000-2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -28,6 +27,8 @@
|
|||
|
||||
#include "psauxerr.h"
|
||||
|
||||
/* ensure proper sign extension */
|
||||
#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) )
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -396,7 +397,7 @@
|
|||
FT_ASSERT( ( decoder->len_buildchar == 0 ) ==
|
||||
( decoder->buildchar == NULL ) );
|
||||
|
||||
if ( decoder->len_buildchar > 0 )
|
||||
if ( decoder->buildchar && decoder->len_buildchar > 0 )
|
||||
ft_memset( &decoder->buildchar[0],
|
||||
0,
|
||||
sizeof( decoder->buildchar[0] ) * decoder->len_buildchar );
|
||||
|
@ -662,7 +663,7 @@
|
|||
if ( large_int )
|
||||
FT_TRACE4(( " %ld", value ));
|
||||
else
|
||||
FT_TRACE4(( " %ld", (FT_Int32)( value >> 16 ) ));
|
||||
FT_TRACE4(( " %ld", Fix2Int( value ) ));
|
||||
#endif
|
||||
|
||||
*top++ = value;
|
||||
|
@ -684,8 +685,8 @@
|
|||
|
||||
top -= 2;
|
||||
|
||||
subr_no = (FT_Int)( top[1] >> 16 );
|
||||
arg_cnt = (FT_Int)( top[0] >> 16 );
|
||||
subr_no = Fix2Int( top[1] );
|
||||
arg_cnt = Fix2Int( top[0] );
|
||||
|
||||
/***********************************************************/
|
||||
/* */
|
||||
|
@ -724,6 +725,24 @@
|
|||
|
||||
switch ( subr_no )
|
||||
{
|
||||
case 0: /* end flex feature */
|
||||
if ( arg_cnt != 3 )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
||||
if ( decoder->flex_state == 0 ||
|
||||
decoder->num_flex_vectors != 7 )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_charstrings:"
|
||||
" unexpected flex end\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
/* the two `results' are popped by the following setcurrentpoint */
|
||||
top[0] = x;
|
||||
top[1] = y;
|
||||
known_othersubr_result_cnt = 2;
|
||||
break;
|
||||
|
||||
case 1: /* start flex feature */
|
||||
if ( arg_cnt != 0 )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
@ -757,24 +776,6 @@
|
|||
}
|
||||
break;
|
||||
|
||||
case 0: /* end flex feature */
|
||||
if ( arg_cnt != 3 )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
||||
if ( decoder->flex_state == 0 ||
|
||||
decoder->num_flex_vectors != 7 )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_charstrings:"
|
||||
" unexpected flex end\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
/* the two `results' are popped by the following setcurrentpoint */
|
||||
top[0] = x;
|
||||
top[1] = y;
|
||||
known_othersubr_result_cnt = 2;
|
||||
break;
|
||||
|
||||
case 3: /* change hints */
|
||||
if ( arg_cnt != 1 )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
@ -818,17 +819,18 @@
|
|||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
/* we want to compute: */
|
||||
/* We want to compute */
|
||||
/* */
|
||||
/* a0*w0 + a1*w1 + ... + ak*wk */
|
||||
/* */
|
||||
/* but we only have the a0, a1-a0, a2-a0, .. ak-a0 */
|
||||
/* however, given that w0 + w1 + ... + wk == 1, we can */
|
||||
/* rewrite it easily as: */
|
||||
/* but we only have a0, a1-a0, a2-a0, ..., ak-a0. */
|
||||
/* */
|
||||
/* a0 + (a1-a0)*w1 + (a2-a0)*w2 + .. + (ak-a0)*wk */
|
||||
/* However, given that w0 + w1 + ... + wk == 1, we can */
|
||||
/* rewrite it easily as */
|
||||
/* */
|
||||
/* where k == num_designs-1 */
|
||||
/* a0 + (a1-a0)*w1 + (a2-a0)*w2 + ... + (ak-a0)*wk */
|
||||
/* */
|
||||
/* where k == num_designs-1. */
|
||||
/* */
|
||||
/* I guess that's why it's written in this `compact' */
|
||||
/* form. */
|
||||
|
@ -862,7 +864,7 @@
|
|||
if ( arg_cnt != 1 || blend == NULL )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
||||
idx = (FT_Int)( top[0] >> 16 );
|
||||
idx = Fix2Int( top[0] );
|
||||
|
||||
if ( idx < 0 ||
|
||||
idx + blend->num_designs > decoder->len_buildchar )
|
||||
|
@ -930,7 +932,7 @@
|
|||
if ( arg_cnt != 2 || blend == NULL )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
||||
idx = (FT_Int)( top[1] >> 16 );
|
||||
idx = Fix2Int( top[1] );
|
||||
|
||||
if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
@ -951,7 +953,7 @@
|
|||
if ( arg_cnt != 1 || blend == NULL )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
||||
idx = (FT_Int)( top[0] >> 16 );
|
||||
idx = Fix2Int( top[0] );
|
||||
|
||||
if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
|
||||
goto Unexpected_OtherSubr;
|
||||
|
@ -1009,11 +1011,15 @@
|
|||
break;
|
||||
|
||||
default:
|
||||
if ( arg_cnt >= 0 && subr_no >= 0 )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_charstrings:"
|
||||
" unknown othersubr [%d %d], wish me luck\n",
|
||||
arg_cnt, subr_no ));
|
||||
unknown_othersubr_result_cnt = arg_cnt;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
Unexpected_OtherSubr:
|
||||
FT_ERROR(( "t1_decoder_parse_charstrings:"
|
||||
|
@ -1139,8 +1145,8 @@
|
|||
top[0],
|
||||
top[1],
|
||||
top[2],
|
||||
(FT_Int)( top[3] >> 16 ),
|
||||
(FT_Int)( top[4] >> 16 ) );
|
||||
Fix2Int( top[3] ),
|
||||
Fix2Int( top[4] ) );
|
||||
|
||||
case op_sbw:
|
||||
FT_TRACE4(( " sbw" ));
|
||||
|
@ -1324,7 +1330,7 @@
|
|||
|
||||
FT_TRACE4(( " callsubr" ));
|
||||
|
||||
idx = (FT_Int)( top[0] >> 16 );
|
||||
idx = Fix2Int( top[0] );
|
||||
if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
|
||||
{
|
||||
FT_ERROR(( "t1_decoder_parse_charstrings:"
|
||||
|
|
|
@ -662,6 +662,7 @@
|
|||
if ( face->format_tag == TTAG_true )
|
||||
{
|
||||
FT_TRACE2(( "This is an SFNT Mac font.\n" ));
|
||||
|
||||
has_outline = 0;
|
||||
error = SFNT_Err_Ok;
|
||||
}
|
||||
|
@ -998,10 +999,8 @@
|
|||
/* table cannot be used to compute the text height reliably! */
|
||||
/* */
|
||||
|
||||
/* The ascender/descender/height are computed from the OS/2 table */
|
||||
/* when found. Otherwise, they're taken from the horizontal */
|
||||
/* header. */
|
||||
/* */
|
||||
/* The ascender and descender are taken from the `hhea' table. */
|
||||
/* If zero, they are taken from the `OS/2' table. */
|
||||
|
||||
root->ascender = face->horizontal.Ascender;
|
||||
root->descender = face->horizontal.Descender;
|
||||
|
@ -1009,29 +1008,27 @@
|
|||
root->height = (FT_Short)( root->ascender - root->descender +
|
||||
face->horizontal.Line_Gap );
|
||||
|
||||
#if 0
|
||||
/* if the line_gap is 0, we add an extra 15% to the text height -- */
|
||||
/* this computation is based on various versions of Times New Roman */
|
||||
if ( face->horizontal.Line_Gap == 0 )
|
||||
root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 );
|
||||
#endif /* 0 */
|
||||
|
||||
#if 0
|
||||
/* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */
|
||||
/* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */
|
||||
if ( face->os2.version != 0xFFFFU && root->ascender )
|
||||
if ( !( root->ascender || root->descender ) )
|
||||
{
|
||||
if ( face->os2.version != 0xFFFFU )
|
||||
{
|
||||
if ( face->os2.sTypoAscender || face->os2.sTypoDescender )
|
||||
{
|
||||
FT_Int height;
|
||||
|
||||
|
||||
root->ascender = face->os2.sTypoAscender;
|
||||
root->descender = -face->os2.sTypoDescender;
|
||||
root->descender = face->os2.sTypoDescender;
|
||||
|
||||
height = root->ascender + root->descender + face->os2.sTypoLineGap;
|
||||
if ( height > root->height )
|
||||
root->height = height;
|
||||
root->height = (FT_Short)( root->ascender - root->descender +
|
||||
face->os2.sTypoLineGap );
|
||||
}
|
||||
else
|
||||
{
|
||||
root->ascender = (FT_Short)face->os2.usWinAscent;
|
||||
root->descender = -(FT_Short)face->os2.usWinDescent;
|
||||
|
||||
root->height = (FT_UShort)( root->ascender - root->descender );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
root->max_advance_width = face->horizontal.advance_Width_Max;
|
||||
root->max_advance_height = (FT_Short)( face->vertical_info
|
||||
|
|
|
@ -246,7 +246,10 @@
|
|||
FT_Request_Metrics( size->face, req );
|
||||
|
||||
if ( FT_IS_SCALABLE( size->face ) )
|
||||
{
|
||||
error = tt_size_reset( ttsize );
|
||||
ttsize->root.metrics = ttsize->metrics;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -409,6 +409,54 @@
|
|||
}
|
||||
|
||||
|
||||
/* Check whether `.notdef' is the only glyph in the `loca' table. */
|
||||
static FT_Bool
|
||||
tt_check_single_notdef( FT_Face ttface )
|
||||
{
|
||||
FT_Bool result = FALSE;
|
||||
|
||||
TT_Face face = (TT_Face)ttface;
|
||||
FT_UInt asize;
|
||||
FT_ULong i;
|
||||
FT_ULong glyph_index = 0;
|
||||
FT_UInt count = 0;
|
||||
|
||||
|
||||
for( i = 0; i < face->num_locations; i++ )
|
||||
{
|
||||
tt_face_get_location( face, i, &asize );
|
||||
if ( asize > 0 )
|
||||
{
|
||||
count += 1;
|
||||
if ( count > 1 )
|
||||
break;
|
||||
glyph_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* Only have a single outline. */
|
||||
if ( count == 1 )
|
||||
{
|
||||
if ( glyph_index == 0 )
|
||||
result = TRUE;
|
||||
else
|
||||
{
|
||||
/* FIXME: Need to test glyphname == .notdef ? */
|
||||
FT_Error error;
|
||||
char buf[8];
|
||||
|
||||
|
||||
error = FT_Get_Glyph_Name( ttface, glyph_index, buf, 8 );
|
||||
if ( !error &&
|
||||
buf[0] == '.' && !ft_strncmp( buf, ".notdef", 8 ) )
|
||||
result = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -504,6 +552,20 @@
|
|||
if ( !error )
|
||||
error = tt_face_load_prep( face, stream );
|
||||
|
||||
/* Check the scalable flag based on `loca'. */
|
||||
if ( !ttface->internal->incremental_interface &&
|
||||
ttface->num_fixed_sizes &&
|
||||
face->glyph_locations &&
|
||||
tt_check_single_notdef( ttface ) )
|
||||
{
|
||||
FT_TRACE5(( "tt_face_init:"
|
||||
" Only the `.notdef' glyph has an outline.\n"
|
||||
" "
|
||||
" Resetting scalable flag to FALSE.\n" ));
|
||||
|
||||
ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if ( !error )
|
||||
|
@ -515,6 +577,19 @@
|
|||
if ( !error )
|
||||
error = tt_face_load_prep( face, stream );
|
||||
|
||||
/* Check the scalable flag based on `loca'. */
|
||||
if ( ttface->num_fixed_sizes &&
|
||||
face->glyph_locations &&
|
||||
tt_check_single_notdef( ttface ) )
|
||||
{
|
||||
FT_TRACE5(( "tt_face_init:"
|
||||
" Only the `.notdef' glyph has an outline.\n"
|
||||
" "
|
||||
" Resetting scalable flag to FALSE.\n" ));
|
||||
|
||||
ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 font loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
|
||||
/* 2010 by */
|
||||
/* Copyright 1996-2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -922,6 +921,9 @@
|
|||
PS_Blend blend = face->blend;
|
||||
|
||||
|
||||
if ( blend && blend->num_designs == 0 )
|
||||
blend = NULL;
|
||||
|
||||
/* if the keyword has a dedicated callback, call it */
|
||||
if ( field->type == T1_FIELD_TYPE_CALLBACK )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue