summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/type1/t1gload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/type1/t1gload.c')
-rw-r--r--src/3rdparty/freetype/src/type1/t1gload.c90
1 files changed, 47 insertions, 43 deletions
diff --git a/src/3rdparty/freetype/src/type1/t1gload.c b/src/3rdparty/freetype/src/type1/t1gload.c
index f3fad4f5df..af102fd85e 100644
--- a/src/3rdparty/freetype/src/type1/t1gload.c
+++ b/src/3rdparty/freetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
+/* Copyright 1996-2006, 2008-2010, 2013, 2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,7 +61,7 @@
{
T1_Face face = (T1_Face)decoder->builder.face;
T1_Font type1 = &face->type1;
- FT_Error error = T1_Err_Ok;
+ FT_Error error = FT_Err_Ok;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_Incremental_InterfaceRec *inc =
@@ -194,7 +194,7 @@
for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )
{
/* now get load the unscaled outline */
- error = T1_Parse_Glyph( &decoder, glyph_index );
+ (void)T1_Parse_Glyph( &decoder, glyph_index );
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
@@ -203,17 +203,18 @@
psaux->t1_decoder_funcs->done( &decoder );
- return T1_Err_Ok;
+ return FT_Err_Ok;
}
FT_LOCAL_DEF( FT_Error )
- T1_Get_Advances( T1_Face face,
+ T1_Get_Advances( FT_Face t1face, /* T1_Face */
FT_UInt first,
FT_UInt count,
- FT_ULong load_flags,
+ FT_Int32 load_flags,
FT_Fixed* advances )
{
+ T1_Face face = (T1_Face)t1face;
T1_DecoderRec decoder;
T1_Font type1 = &face->type1;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -226,7 +227,7 @@
for ( nn = 0; nn < count; nn++ )
advances[nn] = 0;
- return T1_Err_Ok;
+ return FT_Err_Ok;
}
error = psaux->t1_decoder_funcs->init( &decoder,
@@ -260,19 +261,20 @@
advances[nn] = 0;
}
- return T1_Err_Ok;
+ return FT_Err_Ok;
}
FT_LOCAL_DEF( FT_Error )
- T1_Load_Glyph( T1_GlyphSlot glyph,
- T1_Size size,
+ T1_Load_Glyph( FT_GlyphSlot t1glyph, /* T1_GlyphSlot */
+ FT_Size t1size, /* T1_Size */
FT_UInt glyph_index,
FT_Int32 load_flags )
{
+ T1_GlyphSlot glyph = (T1_GlyphSlot)t1glyph;
FT_Error error;
T1_DecoderRec decoder;
- T1_Face face = (T1_Face)glyph->root.face;
+ T1_Face face = (T1_Face)t1glyph->face;
FT_Bool hinting;
T1_Font type1 = &face->type1;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -294,19 +296,21 @@
if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- error = T1_Err_Invalid_Argument;
+ error = FT_THROW( Invalid_Argument );
goto Exit;
}
+ FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index ));
+
FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );
if ( load_flags & FT_LOAD_NO_RECURSE )
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
- if ( size )
+ if ( t1size )
{
- glyph->x_scale = size->root.metrics.x_scale;
- glyph->y_scale = size->root.metrics.y_scale;
+ glyph->x_scale = t1size->metrics.x_scale;
+ glyph->y_scale = t1size->metrics.y_scale;
}
else
{
@@ -314,18 +318,18 @@
glyph->y_scale = 0x10000L;
}
- glyph->root.outline.n_points = 0;
- glyph->root.outline.n_contours = 0;
+ t1glyph->outline.n_points = 0;
+ t1glyph->outline.n_contours = 0;
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
( load_flags & FT_LOAD_NO_HINTING ) == 0 );
- glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+ t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
error = decoder_funcs->init( &decoder,
- (FT_Face)face,
- (FT_Size)size,
- (FT_GlyphSlot)glyph,
+ t1glyph->face,
+ t1size,
+ t1glyph,
(FT_Byte**)type1->glyph_names,
face->blend,
FT_BOOL( hinting ),
@@ -368,19 +372,19 @@
/* bearing the yMax */
if ( !error )
{
- glyph->root.outline.flags &= FT_OUTLINE_OWNER;
- glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;
+ t1glyph->outline.flags &= FT_OUTLINE_OWNER;
+ t1glyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
/* for composite glyphs, return only left side bearing and */
/* advance width */
if ( load_flags & FT_LOAD_NO_RECURSE )
{
- FT_Slot_Internal internal = glyph->root.internal;
+ FT_Slot_Internal internal = t1glyph->internal;
- glyph->root.metrics.horiBearingX =
+ t1glyph->metrics.horiBearingX =
FIXED_TO_INT( decoder.builder.left_bearing.x );
- glyph->root.metrics.horiAdvance =
+ t1glyph->metrics.horiAdvance =
FIXED_TO_INT( decoder.builder.advance.x );
internal->glyph_matrix = font_matrix;
@@ -390,45 +394,45 @@
else
{
FT_BBox cbox;
- FT_Glyph_Metrics* metrics = &glyph->root.metrics;
+ FT_Glyph_Metrics* metrics = &t1glyph->metrics;
FT_Vector advance;
/* copy the _unscaled_ advance width */
metrics->horiAdvance =
FIXED_TO_INT( decoder.builder.advance.x );
- glyph->root.linearHoriAdvance =
+ t1glyph->linearHoriAdvance =
FIXED_TO_INT( decoder.builder.advance.x );
- glyph->root.internal->glyph_transformed = 0;
+ t1glyph->internal->glyph_transformed = 0;
- if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
+ if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
/* make up vertical ones */
metrics->vertAdvance = ( face->type1.font_bbox.yMax -
face->type1.font_bbox.yMin ) >> 16;
- glyph->root.linearVertAdvance = metrics->vertAdvance;
+ t1glyph->linearVertAdvance = metrics->vertAdvance;
}
else
{
metrics->vertAdvance =
FIXED_TO_INT( decoder.builder.advance.y );
- glyph->root.linearVertAdvance =
+ t1glyph->linearVertAdvance =
FIXED_TO_INT( decoder.builder.advance.y );
}
- glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+ t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
- if ( size && size->root.metrics.y_ppem < 24 )
- glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+ if ( t1size && t1size->metrics.y_ppem < 24 )
+ t1glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
#if 1
/* apply the font matrix, if any */
if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx ||
font_matrix.xy != 0 || font_matrix.yx != 0 )
- FT_Outline_Transform( &glyph->root.outline, &font_matrix );
+ FT_Outline_Transform( &t1glyph->outline, &font_matrix );
if ( font_offset.x || font_offset.y )
- FT_Outline_Translate( &glyph->root.outline,
+ FT_Outline_Translate( &t1glyph->outline,
font_offset.x,
font_offset.y );
@@ -466,7 +470,7 @@
}
/* compute the other metrics */
- FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
+ FT_Outline_Get_CBox( &t1glyph->outline, &cbox );
metrics->width = cbox.xMax - cbox.xMin;
metrics->height = cbox.yMax - cbox.yMin;
@@ -474,7 +478,7 @@
metrics->horiBearingX = cbox.xMin;
metrics->horiBearingY = cbox.yMax;
- if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
+ if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
{
/* make up vertical ones */
ft_synthesize_vertical_metrics( metrics,
@@ -484,8 +488,8 @@
/* Set control data to the glyph charstrings. Note that this is */
/* _not_ zero-terminated. */
- glyph->root.control_data = (FT_Byte*)glyph_data.pointer;
- glyph->root.control_len = glyph_data.length;
+ t1glyph->control_data = (FT_Byte*)glyph_data.pointer;
+ t1glyph->control_len = glyph_data.length;
}
@@ -500,8 +504,8 @@
/* Set the control data to null - it is no longer available if */
/* loaded incrementally. */
- glyph->root.control_data = 0;
- glyph->root.control_len = 0;
+ t1glyph->control_data = 0;
+ t1glyph->control_len = 0;
}
#endif