Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/freetype/src/cff/cf2ft.c

Issue 1416993005: Merge to XFA: Update bundled freetype to 2.6.1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/freetype/src/cff/cf2ft.h ('k') | third_party/freetype/src/cff/cf2hints.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype/src/cff/cf2ft.c
diff --git a/third_party/freetype/src/cff/cf2ft.c b/third_party/freetype/src/cff/cf2ft.c
index ebba4694ce8339e1d37af9f1023d42d59ad2ff37..d2544a234516e6355f339dc2ed7cb99efd2defa5 100644
--- a/third_party/freetype/src/cff/cf2ft.c
+++ b/third_party/freetype/src/cff/cf2ft.c
@@ -551,7 +551,7 @@
FT_ZERO( buf );
- idx += decoder->globals_bias;
+ idx += (CF2_UInt)decoder->globals_bias;
if ( idx >= decoder->num_globals )
return TRUE; /* error */
@@ -569,7 +569,7 @@
/* used for seac component */
FT_LOCAL_DEF( FT_Error )
cf2_getSeacComponent( CFF_Decoder* decoder,
- CF2_UInt code,
+ CF2_Int code,
CF2_Buffer buf )
{
CF2_Int gid;
@@ -582,12 +582,21 @@
FT_ZERO( buf );
- gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
- if ( gid < 0 )
- return FT_THROW( Invalid_Glyph_Format );
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ /* Incremental fonts don't necessarily have valid charsets. */
+ /* They use the character code, not the glyph index, in this case. */
+ if ( decoder->builder.face->root.internal->incremental_interface )
+ gid = code;
+ else
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
+ if ( gid < 0 )
+ return FT_THROW( Invalid_Glyph_Format );
+ }
error = cff_get_glyph_data( decoder->builder.face,
- gid,
+ (CF2_UInt)gid,
&charstring,
&len );
/* TODO: for now, just pass the FreeType error through */
@@ -626,7 +635,7 @@
FT_ZERO( buf );
- idx += decoder->locals_bias;
+ idx += (CF2_UInt)decoder->locals_bias;
if ( idx >= decoder->num_locals )
return TRUE; /* error */
« no previous file with comments | « third_party/freetype/src/cff/cf2ft.h ('k') | third_party/freetype/src/cff/cf2hints.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698