Index: third_party/freetype/src/type1/t1gload.c |
diff --git a/third_party/freetype/src/type1/t1gload.c b/third_party/freetype/src/type1/t1gload.c |
index af102fd85e3437561cb34c1f1b0774ffde883c75..85ada2ea6a91c6e0a59a27ab5a48bece27fd1f75 100644 |
--- a/third_party/freetype/src/type1/t1gload.c |
+++ b/third_party/freetype/src/type1/t1gload.c |
@@ -4,7 +4,7 @@ |
/* */ |
/* Type 1 Glyph Loader (body). */ |
/* */ |
-/* Copyright 1996-2006, 2008-2010, 2013, 2014 by */ |
+/* Copyright 1996-2015 by */ |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
/* */ |
/* This file is part of the FreeType project, and may only be used, */ |
@@ -54,7 +54,7 @@ |
/*************************************************************************/ |
- FT_LOCAL_DEF( FT_Error ) |
+ static FT_Error |
T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder, |
FT_UInt glyph_index, |
FT_Data* char_string ) |
@@ -92,7 +92,7 @@ |
if ( !error ) |
error = decoder->funcs.parse_charstrings( |
decoder, (FT_Byte*)char_string->pointer, |
- char_string->length ); |
+ (FT_UInt)char_string->length ); |
#ifdef FT_CONFIG_OPTION_INCREMENTAL |
@@ -194,7 +194,7 @@ |
for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) |
{ |
/* now get load the unscaled outline */ |
- (void)T1_Parse_Glyph( &decoder, glyph_index ); |
+ (void)T1_Parse_Glyph( &decoder, (FT_UInt)glyph_index ); |
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) |
*max_advance = decoder.builder.advance.x; |
@@ -395,7 +395,6 @@ |
{ |
FT_BBox cbox; |
FT_Glyph_Metrics* metrics = &t1glyph->metrics; |
- FT_Vector advance; |
/* copy the _unscaled_ advance width */ |
@@ -427,23 +426,26 @@ |
#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 ) |
+ if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L || |
+ font_matrix.xy != 0 || font_matrix.yx != 0 ) |
+ { |
FT_Outline_Transform( &t1glyph->outline, &font_matrix ); |
+ metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, |
+ font_matrix.xx ); |
+ metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, |
+ font_matrix.yy ); |
+ } |
+ |
if ( font_offset.x || font_offset.y ) |
+ { |
FT_Outline_Translate( &t1glyph->outline, |
font_offset.x, |
font_offset.y ); |
- advance.x = metrics->horiAdvance; |
- advance.y = 0; |
- FT_Vector_Transform( &advance, &font_matrix ); |
- metrics->horiAdvance = advance.x + font_offset.x; |
- advance.x = 0; |
- advance.y = metrics->vertAdvance; |
- FT_Vector_Transform( &advance, &font_matrix ); |
- metrics->vertAdvance = advance.y + font_offset.y; |
+ metrics->horiAdvance += font_offset.x; |
+ metrics->vertAdvance += font_offset.y; |
+ } |
#endif |
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) |
@@ -504,7 +506,7 @@ |
/* Set the control data to null - it is no longer available if */ |
/* loaded incrementally. */ |
- t1glyph->control_data = 0; |
+ t1glyph->control_data = NULL; |
t1glyph->control_len = 0; |
} |
#endif |