diff options
author | Oliver Chang <ochang@chromium.org> | 2015-11-05 16:00:40 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2015-11-05 16:00:40 -0800 |
commit | cec3f6878e37fcd1c6c15e0e2ab011931d55549e (patch) | |
tree | fb3a01b9b966e59f8851ea4438243b1813a951e7 /third_party/freetype/src/cff/cf2ft.c | |
parent | cca5b7684f48e2e933bf08ed573f7caca8e1d1ad (diff) | |
download | pdfium-cec3f6878e37fcd1c6c15e0e2ab011931d55549e.tar.xz |
Merge to XFA: Update bundled freetype to 2.6.1
Also adds a README.pdfium and 0000-include.patch that
details the local modifications made.
Also rolls testing/corpus to 45f88c6914fcac26ad930bb0ebbfa468c21db0a5
which includes regenerated corpus expectations.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1413673003 .
(cherry picked from commit 87ee069d05ca06f60d6cfacd9e426739d8f2053d)
Review URL: https://codereview.chromium.org/1416993005 .
Diffstat (limited to 'third_party/freetype/src/cff/cf2ft.c')
-rw-r--r-- | third_party/freetype/src/cff/cf2ft.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/third_party/freetype/src/cff/cf2ft.c b/third_party/freetype/src/cff/cf2ft.c index ebba4694ce..d2544a2345 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 */ |