| Index: third_party/freetype/src/truetype/ttobjs.c
|
| diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/truetype/ttobjs.c b/third_party/freetype/src/truetype/ttobjs.c
|
| similarity index 94%
|
| rename from core/src/fxge/fx_freetype/fxft2.5.01/src/truetype/ttobjs.c
|
| rename to third_party/freetype/src/truetype/ttobjs.c
|
| index 4a6a7c1eeecaa6f9acb3a6057273d01dc9a19bdc..a73529d8487ef3423b226e5fbde38484910192ee 100644
|
| --- a/core/src/fxge/fx_freetype/fxft2.5.01/src/truetype/ttobjs.c
|
| +++ b/third_party/freetype/src/truetype/ttobjs.c
|
| @@ -16,12 +16,12 @@
|
| /***************************************************************************/
|
|
|
|
|
| -#include "../../include/ft2build.h"
|
| -#include "../../include/freetype/internal/ftdebug.h"
|
| -#include "../../include/freetype/internal/ftstream.h"
|
| -#include "../../include/freetype/tttags.h"
|
| -#include "../../include/freetype/internal/sfnt.h"
|
| -#include "../../include/freetype/ftttdrv.h"
|
| +#include <ft2build.h>
|
| +#include FT_INTERNAL_DEBUG_H
|
| +#include FT_INTERNAL_STREAM_H
|
| +#include FT_TRUETYPE_TAGS_H
|
| +#include FT_INTERNAL_SFNT_H
|
| +#include FT_TRUETYPE_DRIVER_H
|
|
|
| #include "ttgload.h"
|
| #include "ttpload.h"
|
| @@ -33,7 +33,7 @@
|
| #endif
|
|
|
| #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
|
| -#include "../../include/freetype/ttunpat.h"
|
| +#include FT_TRUETYPE_UNPATENTED_H
|
| #endif
|
|
|
| #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
| @@ -150,20 +150,21 @@
|
| tt_check_trickyness_family( FT_String* name )
|
| {
|
|
|
| -#define TRICK_NAMES_MAX_CHARACTERS 16
|
| -#define TRICK_NAMES_COUNT 8
|
| +#define TRICK_NAMES_MAX_CHARACTERS 19
|
| +#define TRICK_NAMES_COUNT 9
|
|
|
| static const char trick_names[TRICK_NAMES_COUNT]
|
| [TRICK_NAMES_MAX_CHARACTERS + 1] =
|
| {
|
| - "DFKaiSho-SB", /* dfkaisb.ttf */
|
| + "DFKaiSho-SB", /* dfkaisb.ttf */
|
| "DFKaiShu",
|
| - "DFKai-SB", /* kaiu.ttf */
|
| - "HuaTianKaiTi?", /* htkt2.ttf */
|
| - "HuaTianSongTi?", /* htst3.ttf */
|
| - "MingLiU", /* mingliu.ttf & mingliu.ttc */
|
| - "PMingLiU", /* mingliu.ttc */
|
| - "MingLi43", /* mingli.ttf */
|
| + "DFKai-SB", /* kaiu.ttf */
|
| + "HuaTianKaiTi?", /* htkt2.ttf */
|
| + "HuaTianSongTi?", /* htst3.ttf */
|
| + "Ming(for ISO10646)", /* hkscsiic.ttf & iicore.ttf */
|
| + "MingLiU", /* mingliu.ttf & mingliu.ttc */
|
| + "PMingLiU", /* mingliu.ttc */
|
| + "MingLi43", /* mingli.ttf */
|
| };
|
|
|
| int nn;
|
| @@ -532,6 +533,10 @@
|
|
|
| /* check that we have a valid TrueType file */
|
| error = sfnt->init_face( stream, face, face_index, num_params, params );
|
| +
|
| + /* Stream may have changed. */
|
| + stream = face->root.stream;
|
| +
|
| if ( error )
|
| goto Exit;
|
|
|
| @@ -544,17 +549,7 @@
|
| {
|
| FT_TRACE2(( " not a TTF font\n" ));
|
| goto Bad_Format;
|
| - }
|
| - else
|
| - {
|
| - FT_ULong table_len;
|
| - if (face->goto_table( face, TTAG_CFF, stream, &table_len) != TT_Err_Table_Missing &&
|
| - face->goto_table( face, TTAG_loca, stream, &table_len) == TT_Err_Table_Missing)
|
| - {
|
| - FT_TRACE2(( "[not a valid TTF font]\n" ));
|
| - goto Bad_Format;
|
| - }
|
| - }
|
| + }
|
|
|
| #ifdef TT_USE_BYTECODE_INTERPRETER
|
| ttface->face_flags |= FT_FACE_FLAG_HINTER;
|
| @@ -765,7 +760,9 @@
|
| if ( !exec )
|
| return FT_THROW( Could_Not_Find_Context );
|
|
|
| - TT_Load_Context( exec, face, size );
|
| + error = TT_Load_Context( exec, face, size );
|
| + if ( error )
|
| + return error;
|
|
|
| exec->callTop = 0;
|
| exec->top = 0;
|
| @@ -806,18 +803,16 @@
|
|
|
| if ( face->font_program_size > 0 )
|
| {
|
| - error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
|
| + TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
|
|
|
| - if ( !error )
|
| - {
|
| - FT_TRACE4(( "Executing `fpgm' table.\n" ));
|
| -
|
| - error = face->interpreter( exec );
|
| - }
|
| + FT_TRACE4(( "Executing `fpgm' table.\n" ));
|
| + error = face->interpreter( exec );
|
| }
|
| else
|
| error = FT_Err_Ok;
|
|
|
| + size->bytecode_ready = error;
|
| +
|
| if ( !error )
|
| TT_Save_Context( exec, size );
|
|
|
| @@ -859,7 +854,9 @@
|
| if ( !exec )
|
| return FT_THROW( Could_Not_Find_Context );
|
|
|
| - TT_Load_Context( exec, face, size );
|
| + error = TT_Load_Context( exec, face, size );
|
| + if ( error )
|
| + return error;
|
|
|
| exec->callTop = 0;
|
| exec->top = 0;
|
| @@ -877,9 +874,9 @@
|
|
|
| if ( face->cvt_program_size > 0 )
|
| {
|
| - error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
|
| + TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
|
|
|
| - if ( !error && !size->debug )
|
| + if ( !size->debug )
|
| {
|
| FT_TRACE4(( "Executing `prep' table.\n" ));
|
|
|
| @@ -889,6 +886,8 @@
|
| else
|
| error = FT_Err_Ok;
|
|
|
| + size->cvt_ready = error;
|
| +
|
| /* UNDOCUMENTED! The MS rasterizer doesn't allow the following */
|
| /* graphics state variables to be modified by the CVT program. */
|
|
|
| @@ -917,10 +916,6 @@
|
| return error;
|
| }
|
|
|
| -#endif /* TT_USE_BYTECODE_INTERPRETER */
|
| -
|
| -
|
| -#ifdef TT_USE_BYTECODE_INTERPRETER
|
|
|
| static void
|
| tt_size_done_bytecode( FT_Size ftsize )
|
| @@ -958,8 +953,8 @@
|
| size->max_func = 0;
|
| size->max_ins = 0;
|
|
|
| - size->bytecode_ready = 0;
|
| - size->cvt_ready = 0;
|
| + size->bytecode_ready = -1;
|
| + size->cvt_ready = -1;
|
| }
|
|
|
|
|
| @@ -973,14 +968,13 @@
|
| TT_Size size = (TT_Size)ftsize;
|
| TT_Face face = (TT_Face)ftsize->face;
|
| FT_Memory memory = face->root.memory;
|
| - FT_Int i;
|
|
|
| FT_UShort n_twilight;
|
| TT_MaxProfile* maxp = &face->max_profile;
|
|
|
|
|
| - size->bytecode_ready = 1;
|
| - size->cvt_ready = 0;
|
| + size->bytecode_ready = -1;
|
| + size->cvt_ready = -1;
|
|
|
| size->max_function_defs = maxp->maxFunctionDefs;
|
| size->max_instruction_defs = maxp->maxInstructionDefs;
|
| @@ -1002,9 +996,11 @@
|
| metrics->rotated = FALSE;
|
| metrics->stretched = FALSE;
|
|
|
| - /* set default compensation (all 0) */
|
| - for ( i = 0; i < 4; i++ )
|
| - metrics->compensations[i] = 0;
|
| + /* set default engine compensation */
|
| + metrics->compensations[0] = 0; /* gray */
|
| + metrics->compensations[1] = 0; /* black */
|
| + metrics->compensations[2] = 0; /* white */
|
| + metrics->compensations[3] = 0; /* reserved */
|
| }
|
|
|
| /* allocate function defs, instruction defs, cvt, and storage area */
|
| @@ -1041,10 +1037,6 @@
|
|
|
| /* Fine, now run the font program! */
|
| error = tt_size_run_fpgm( size, pedantic );
|
| - /* It seems fpgm proc is causing some problem for some font, so we ignore the error. TESTDOC: Bug #12690 - Restaurantkarte_Oktober09+Wild.pdf*/
|
| - if ( error )
|
| - tt_size_done_bytecode( ftsize );
|
| - return TT_Err_Ok;
|
|
|
| Exit:
|
| if ( error )
|
| @@ -1061,15 +1053,14 @@
|
| FT_Error error = FT_Err_Ok;
|
|
|
|
|
| - if ( !size->bytecode_ready )
|
| - {
|
| + if ( size->bytecode_ready < 0 )
|
| error = tt_size_init_bytecode( (FT_Size)size, pedantic );
|
| - if ( error )
|
| - goto Exit;
|
| - }
|
| +
|
| + if ( error || size->bytecode_ready )
|
| + goto Exit;
|
|
|
| /* rescale CVT when needed */
|
| - if ( !size->cvt_ready )
|
| + if ( size->cvt_ready < 0 )
|
| {
|
| FT_UInt i;
|
| TT_Face face = (TT_Face)size->root.face;
|
| @@ -1095,10 +1086,7 @@
|
|
|
| size->GS = tt_default_graphics_state;
|
|
|
| - tt_size_run_prep( size, pedantic );/* It seems prep proc is causing some problem for some font, so we ignore the error. TESTDOC: Bug #5025 - naredba-rd-16-296.pdf */
|
| - /* However we can't disable the prep. TESTDOC: Bug #0063 - 050826_differ_table.pdf, page #4 */
|
| - if ( !error )
|
| - size->cvt_ready = 1;
|
| + error = tt_size_run_prep( size, pedantic );
|
| }
|
|
|
| Exit:
|
| @@ -1129,8 +1117,8 @@
|
| FT_Error error = FT_Err_Ok;
|
|
|
| #ifdef TT_USE_BYTECODE_INTERPRETER
|
| - size->bytecode_ready = 0;
|
| - size->cvt_ready = 0;
|
| + size->bytecode_ready = -1;
|
| + size->cvt_ready = -1;
|
| #endif
|
|
|
| size->ttmetrics.valid = FALSE;
|
| @@ -1158,7 +1146,7 @@
|
|
|
|
|
| #ifdef TT_USE_BYTECODE_INTERPRETER
|
| - if ( size->bytecode_ready )
|
| + if ( size->bytecode_ready >= 0 )
|
| tt_size_done_bytecode( ttsize );
|
| #endif
|
|
|
| @@ -1239,7 +1227,7 @@
|
| }
|
|
|
| #ifdef TT_USE_BYTECODE_INTERPRETER
|
| - size->cvt_ready = 0;
|
| + size->cvt_ready = -1;
|
| #endif /* TT_USE_BYTECODE_INTERPRETER */
|
|
|
| if ( !error )
|
|
|