src/cff


Log

Author Commit Date CI Message
Werner Lemberg 5f577462 2013-12-25T08:50:50 Fix Savannah bug #40997. * src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already be set. * src/cff/cffobjs.c (cff_face_init): Ditto. * src/cid/cidobjs.c (cid_face_init): Ditto. * src/pcf/pcfread.c (pcf_load_font): Ditto. * src/pfr/pfrobjs.c (pfr_face_init): Ditto. * src/type1/t1objs.c (T1_Face_Init): Ditto. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/winfonts/winfnt.c (FNT_Face_Init): Ditto.
Dave Arnold dd21301e 2013-11-08T10:52:51 [cff] Fix for hints that touch. * src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for finding index value of insertion point.
Dave Arnold e845a85e 2013-10-03T23:04:29 * src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero.
Dave Arnold 0b330452 2013-10-02T11:04:06 * src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount. This line was lost in commit 89ca1fd6 (from 2013-06-25). The effect is to use a previous darkening amount when producing an unhinted, unscaled outline. This can cause autohint samples in ftgrid and ftview to be based on darkened CFF outlines instead of unhinted, undarkened ones.
Dave Arnold 3a2cb0f8 2013-09-29T16:17:02 Fix Savannah bug #39295. The bug was caused by switching to the initial hintmap (the one in effect when `moveto' executes) just before drawing the final element in the charstring. This ensured that the path was closed (in both Character Space and Device Space). But if the final element was a curve and if the final hintmap was different enough from the initial one, then the curve was visibly distorted. The first part of the fix is to draw the final curve using the final hintmap as specified by the charstring. This corrects the distortion but does not ensure closing in Device Space. It may require the rasterizer to automatically generate an extra closing line. Depending on the hintmap differences, this line could be from zero to a couple pixels in length. The second part of the fix covers the case where the charstring subpath is closed with an explicit line. We now modify that line's end point to avoid the distortion. Some glyphs in the bug report font (TexGyreHeros-Regular) that show the change are: 25ppem S (98) 24ppem eight (52) 25.5ppem p (85) Curves at the *end* of a subpath are no longer distorted. However, some of these glyphs have bad hint substitutions in the middle of a subpath, and these are not affected. The patch has been tested with a set of 106 fonts that shipped with Adobe Creative Suite 4, together with 756 Open Source CFF fonts from Google Fonts. There are 1.5 million glyphs, of which some 20k are changed with the fix. A sampling of a few hundred of these changes have been examined more closely, and the changes look good (or at least acceptable). * src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing' to indicate that we synthesize a closepath line. * src/cff/cf2hints.c (cf2_glyphpath_init): Updated. (cf2_glyphpath_pushPrevElem): If closing, use first hint map (for `lineto' operator) and adjust hint zone. For synthesized closing lines, use end point in first hint zone. (cf2_glyphpath_lineTo): Take care of synthesized closing lines. In particular, shift the detection of zero-length lines from character space to device space. (cf2_glyphpath_closeOpenPath): Remove assertion. Updated.
Werner Lemberg ffee64af 2013-08-26T12:55:48 Better tracing of loaded glyphs. Previously, the loading of a glyph was traced at level 4, if at all. With this change, all font loading routines emit a tracing message at level 1, making it easier to select tracing output (for example using F2_DEBUG="any:1 afhints:7 aflatin:7"). * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message. * src/cff/cffdrivr.c (cff_glyph_load): Ditto. * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing messages. * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing message. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message. * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. * src/type1/t1gload.c (T1_Load_Glyph): Ditto. * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto. * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
John Tytgat 9bcfab87 2013-08-06T08:55:19 Fix Savannah bug #39702. * src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset != 0'; this stronger test is mandated by the CFF specification. Fix test for INDEX structures which have one or more empty entries at the end.
Werner Lemberg e8ed2d62 2013-08-01T12:20:20 Another round of cppcheck nitpicks. The call was (from the top-level of the FreeType tree): cppcheck --force \ --enable=all \ -I /usr/include \ -I /usr/local/include \ -I /usr/lib/gcc/i586-suse-linux/4.7/include \ -I include \ -I include/freetype \ -I include/freetype/config \ -I include/freetype/internal \ -DFT2_BUILD_LIBRARY \ . &> cppcheck.log using cppcheck git commit f7e93f99. Note that cppcheck still can't handle `#include FOO' (with `FOO' a macro). */* Improve variable scopes. */* Remove redundant initializations which get overwritten. * src/gxvalid/*: Comment out redundant code or guard it with FT_DEBUG_LEVEL_TRACE.
Werner Lemberg b8850fc1 2013-06-26T12:22:10 [cff] Add darkening limit to `darkening-parameters'. * src/cff/cffdrivr.c (cff_property_set): Add check.
Werner Lemberg 89ca1fd6 2013-06-25T23:28:02 [cff] Add `darkening-parameters' property. * include/freetype/ftcffdrv.h: Document it. * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle `darkening-parameters' property. * src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array. * src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams' argument and use it. Update all callers. * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy `darken_params' values. * src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array. * src/cff/cffobjs.c (cff_driver_init): Set default values for `darken_params'.
Werner Lemberg 3da51828 2013-06-23T09:48:20 Fix comment.
Dave Arnold cb23a628 2013-06-13T07:46:32 [cff] Add code to Adobe's engine to handle ppem > 2000. * src/cff/cffgload.c (cff_slot_load): If we get FT_Err_Glyph_Too_Big, retry unhinted and scale up later on.
Werner Lemberg c06889eb 2013-06-12T10:58:06 More compiler warning fixes. */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
Werner Lemberg 85fd84b8 2013-06-07T17:10:21 [cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/. * src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
Werner Lemberg 4447b2c8 2013-06-06T21:28:36 [cff] Add early exit feature for width-only calls. This is for `FT_Get_Advance'. There are 7 places where the spec says the width can be defined: hstem/hstemhm vstem/vstemhm cntrmask/hintmask hmoveto vmoveto rmoveto endchar * src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls, if possible. (cf2_interpT2CharString) <cf2_cmdHSTEM>, <cf2_cmdVSTEM>, <cf2_cmdVMOVETO>, <cf2_cmdENDCHAR>, <cf2_cmdHINTMASK>, <cf2_cmdRMOVETO>, <cf2_cmdHMOVETO>: Exit early for width-only calls.
Werner Lemberg badf3178 2013-06-06T09:16:38 Next round of compiler fixes. * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init): Add proper cast. * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix cast. * include/freetype/internal/ftstream.h: Decorate stream and frame macros with `FT_Long' and `FT_ULong' as appropriate. * src/base/ftrfork.c (raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Use cast. * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast. * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast. * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto. * src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast. * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto. * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto. * src/cid/cidparse.c (cid_parser_new): Use cast. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast. * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type. * src/raster/ftraster.c (ft_black_reset): Use cast. * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast. (ALL_POINTS): Fix cast. * src/type1/t1driver.c (t1_ps_get_font_value): Add casts. * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
Dave Arnold c378249e 2013-06-05T19:57:55 Fix more MSVC Win32 compiler warnings. * src/base/ftobjs.c: Fix typo in MS pragma. * src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property): `lineno' is only used in debug mode. * src/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in debug mode.
Werner Lemberg 9ef0bc00 2013-06-05T14:53:27 Minor formatting.
Werner Lemberg 45392b77 2013-06-05T13:43:20 Fix compiler warnings. * include/freetype/internal/ftmemory.h: Decorate memory allocation macros with `FT_Long' where appropriate. Remove duplicate of FT_MEM_QRENEW_ARRAY definition. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use cast. * src/base/ftobjs.c: Add warning disabling pragma for MSVC while including `md5.c'. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add cast. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts. (tt_sbit_decoder_load_bitmap): Beautification. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize variables (earlier). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants where appropriate. * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
Werner Lemberg d963498f 2013-06-04T20:18:57 * src/cff/cf2font.c (cf2_getGlyphWidth): Initialize `advWidth'. Problem reported by Ingmar Sittl <ingmar.sittl@elektrobit.com>.
Werner Lemberg dc624ca4 2013-06-04T10:30:48 Apply fixes for cppcheck nitpicks. http://cppcheck.sourceforge.net/ Note that the current version heavily chokes on FreeType, delivering even wrong results. I will report those issues to the cppcheck team so that a newer version gives improved results hopefully. */* Improve variable scopes. */* Remove redundant initializations which get overwritten. * src/base/ftmac.c ,builds/mac/ftmac.c (count_faces_scalable): Remove unused variable. * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero. * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate): Remove functionless code. * src/tools/ftrandom.c (main): Fix memory leak.
Werner Lemberg 2429dc3d 2013-06-03T12:41:58 Add CFF_CONFIG_OPTION_OLD_ENGINE configuration option. This controls whether the old FreeType CFF engine gets compiled into FreeType. It is now disabled by default. * devel/ftoption.h, include/freetype/config/ftoption.h (CFF_CONFIG_OPTION_OLD_ENGINE): New macro. * src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c (CFF_Operator, cff_argument_counts, cff_builder_add_point, cff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load), src/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use CFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code. * docs/CHANGES: Updated.
Werner Lemberg 7441dd87 2013-05-13T09:12:46 * src/cff/cf2font.c (cf2_getGlyphWidth): Fix uninitialized variable. Fix suggested by Vaibhav Nagarnaik <vnagarnaik@gmail.com>.
Werner Lemberg f6aa089f 2013-05-10T07:58:47 */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
Werner Lemberg e6e83627 2013-05-04T18:57:56 Fix clang fixes. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use correct types. * src/cff/cf2intrp.c (cf2_interpT2CharString) <default>: Force unsigned for computations. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto. * src/cff/cffparse.c (cff_parse_integer): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
Werner Lemberg 77c39b1d 2013-05-04T18:04:07 [cff] Make Adobe CFF engine work correctly on 64bit hosts. Reported by numerous people on the `freetype-devel' list. Without this fix, glyphs aren't properly aligned on a common baseline. On 64bit systems, `FT_Pos' expands to `long int', having a width of 64bit. `CF2_Fixed' expands to `int' which is normally 32bit wide on 64bit hosts also. Wrong casts filled up the blues arrays with incorrect values. Note that all blues values are accessed with the `cf2_blueToFixed' macro which handles the 64bit to 32bit conversion. * src/cff/cf2ft.h (cf2_getBlueValues, cf2_getOtherBlues, cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Use `FT_Pos' for `data', not `CF2_Fixed'. * src/cff/cf2ft.c (cf2_getBlueValues, cf2_getOtherBlues, cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated. * src/cff/cf2blues.c (cf2_blues_init): Updated.
Werner Lemberg 94152819 2013-05-04T16:40:12 More fixes for clang's `sanitize' feature. * src/base/ftcalc.c (FT_DivFix): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, FT_Vector_Length, FT_Vector_Polarize): Ditto. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. * src/cff/cffload.c (cff_subfont_load): Fix constant. * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, cff_parse_fixed_dynamic): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/cid/cidload.c (cid_get_offset): Ditto. * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
Werner Lemberg afaeeee9 2013-05-04T14:05:24 Fix errors reported by clang's `sanitize' feature. * include/freetype/internal/ftstream.h: Simplify and fix integer extraction macros. (FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32, FT_INT8_I32, FT_INT8_U32): Removed. (FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE, FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for computations and convert to signed as the last step. * src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt, cf2_fracToFixed): Avoid shifts of negative values. (cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed, unused. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR, default>: Use unsigned values for computations and convert to signed as the last step. Use proper types in tracing messages. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned values for computation of operands and convert to signed as the last step. Use proper type in tracing message.
Werner Lemberg 99033fef 2013-05-03T17:39:24 * src/cff/cf2blues.c: Remove dead code.
Chris Liddell 9bf75e08 2013-05-02T11:09:15 * src/cff/cffgload.c: Include FT_CFF_DRIVER_H.
Werner Lemberg 06474c3e 2013-04-13T18:53:28 [cff] Add a new Type 2 interpreter and hinter. This work, written by Dave Arnold <darnold@adobe.com> and fully integrated into FreeType by me, is a donation by Adobe in collaboration with Google. It is vastly superior to the old CFF engine, and it will replace it soon. Right now, it is still off by default, and you have to explicitly select it using the new `hinting-engine' property of the cff driver. For convenience, (most of) the new files are committed separately. * include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro. * include/freetype/ftcffdrv.h: New file to access CFF driver properties. * include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error code. * include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints', and `cf2interp'. * src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'. * src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine' and `no_stem_darkening'. * src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'. * src/cff/cff.c: Include new files. * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle `hinting-engine' and `no-stem-darkening' properties (only the Adobe engine listens to them). * src/cff/cffgload.c: Include `cf2ft.h'. (cff_decoder_prepare): Initialize `current_subfont'. (cff_build_add_point): Handle Adobe engine which uses 16.16 coordinates. (cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING separately. Choose rendering engine based on `hinting_engine' property. * src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe engine. * src/cff/cffobjs.c: Include FT_CFF_DRIVER_H. (cff_driver_init): Set default property values. * src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files. * src/cff/cf2*.*: New files, containing the Adobe engine.
Werner Lemberg 283c8ed8 2013-04-13T15:02:31 [cff] New files for Adobe's Type 2 interpreter and hinting engine.
Werner Lemberg 831dac88 2013-04-12T21:13:49 [cff] Minor code administration issues. * src/cff/cffgload.c (check_points): Rename to... (cff_check_points): ...this and make it FT_LOCAL. (cff_builder_add_point, cff_builder_add_point1, cff_builder_start_point, cff_builder_close_contour, cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data, cff_free_glyph_data): Make them FT_LOCAL. * src/cff/cffgload.h: Updated.
Werner Lemberg fc185ef4 2013-04-12T19:48:06 Add framework for CFF properties. * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC7): New macro. * src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H. (cff_property_set, cff_property_get): New function, still empty. Define `cff_service_properties' service. Update `cff_services'. * src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H. (CFF_SERVICE_PROPERTIES_GET): New macro. CffModulePIC: Add `cff_service_properties'.
Werner Lemberg 5ea06ce0 2013-03-17T08:14:46 Whitespace.
Werner Lemberg 89f50647 2013-03-14T17:50:49 */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. FT_Err_XXX and friends are no longer directly used in the source code.
Werner Lemberg e3c93015 2013-03-14T11:21:17 */*: Use FT_Err_Ok only. This is a purely mechanical conversion.
Werner Lemberg 059bc335 2013-03-14T10:27:35 */*: Use `FT_THROW'. This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
Werner Lemberg d6bc524b 2013-03-11T09:50:53 Always use module related error codes. * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use `FT_ERROR_BASE'. * src/type1/t1load.c (parse_encoding): Use T1_Err_Unknown_File_Format.
Werner Lemberg 2d882540 2013-03-08T21:23:45 [cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also. * src/cff/cffgload.c (cff_slot_load): Implement it.
Werner Lemberg 55127272 2012-11-13T09:22:11 [cff] Add support for OpenType Collections (OTC). * src/cff/cffload.c (cff_font_load): Separate subfont and face index handling to load both pure CFFs with multiple subfonts and OTCs (with multiple faces where each face holds exactly one subfont). * src/cff/cffobjs.c (cff_face_init): Updated.
Werner Lemberg ad4eecca 2012-10-20T21:27:17 [cff] Improve parsing of invalid real numbers. * src/cff/cffparse.c (cff_parse_real): Always parse complete number, even in case of overflow or underflow. Also trace one more underflow.
Werner Lemberg 4404ec4e 2012-10-19T09:06:53 [cff] Fix more value errors and improve tracing. * src/cff/cffparse.c (cff_parse_integer): Emit tracing message in case of error. (cff_parse_real): Handle and trace overflow, underflow, and bad data consistently. (do_fixed): New helper function, handling and tracing overflow. (cff_parse_fixed, cff_parse_fixed_scaled): Use `do_fixed'.
Bram Tassyns 76accc18 2012-10-17T19:55:20 [cff] Fix value overflow. * src/cff/cffparse.c (cff_parse_fixed_scaled): Implement it.
Werner Lemberg 328aa3b2 2012-08-27T11:23:41 [FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER), include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE), include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2, FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4, FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6), src/autofit/afpic.c (autofit_module_class_pic_init), src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c (ft_create_default_module_classes), src/cff/cffparse.c (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c (cff_driver_class_pic_init), src/pshinter/pshpic.c (pshinter_module_class_pic_init), src/psnames/pspic.c (psnames_module_class_pic_init), src/raster/rastpic.c (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c (sfnt_module_class_pic_init), src/sfnt/ttcmap.c (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c (tt_driver_class_pic_init): Initialize allocation variable.
Werner Lemberg d9bf44a4 2012-08-27T08:41:43 [autofit, cff, pshinter, psnames] More renamings for orthogonality. * src/autofit/afmodule.c, src/autofit/afpic.h: s/AF_AUTOFITTER_/AF_/. * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c, src/cff/cffpic.h: s/FT_CFF_/CFF_/. * src/pshinter/pshmod.c, src/pshinter/pshpic.h: s/FT_PSHINTER_/PSHINTER_/. * src/psnames/psmodule.c, src/psnames/pspic.h: s/FT_PSCMAPS/PSCMAPS_/.
Werner Lemberg 56751532 2012-06-25T10:58:20 [cff] Fix Savannah bug #36705. Handle numbers like 2.001 correctly. * src/cff/cffparse.c (cff_parse_real): Avoid negative values for `shift'.
Vinnie Falco 26dfeb6d 2012-03-08T06:04:03 Prepare source code for amalgamation. * src\autofit\aferrors.h, src\bdf\bdferror.h, src\bzip2\ftbzip2.c, src\cache\ftcerror.h, src\cff\cfferrs.h, src\cid\ciderrs.h, src\gxvalid\gxverror.h, src\gzip\ftgzip.c, src\lzw\ftlzw.c, src\otvalid\otverror.h, src\pcf\pcferror.h, src\pfr\pfrerror.h, src\psaux\psauxerr.h, src\pshinter\pshnterr.h, src\psnames\psnamerr.h, src\raster\rasterrs.h, src\sfnt\sferrors.h, src\smooth\ftsmerrs.h, src\truetype\tterrors.h, src\type1\t1errors.h, src\type42\t42error.h, src\winfonts\fnterrs.h: Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX.
Werner Lemberg 8a2b444d 2012-03-04T08:35:03 Revert "[cff] One more check against malformed font matrix." As Alexei points out, this test is completely nonsense. This reverts commit 35bb214ae620400cd09a2cfaf3bacd66e179a1f6.
Werner Lemberg 35bb214a 2012-03-03T12:29:53 [cff] One more check against malformed font matrix. * src/cff/cffparse.c (cff_parse_font_matrix): Guard against `xx' and `yy' matrix coefficients being zero.
Alexei Podtelezhnikov b25265c5 2012-02-29T13:45:24 Avoid modulo operators against a power-of-two denominator. * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>, src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE), src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with `&' operator.
Werner Lemberg 6b5b6f39 2012-02-24T12:26:25 Prepare source code for amalgamation (6/6). * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/. * src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/. s/t1_init_loader/cid_init_loader/. s/t1_done_loader/cid_done_loader/. * src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/. * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/. * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
Werner Lemberg 0b7daff0 2012-02-07T08:52:41 * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts.
suzuki toshiya 1749d8bc 2012-01-17T02:00:24 Remove trailing spaces.
suzuki toshiya c24f77ac 2012-01-16T21:13:05 Formatting PIC related sources. * src/autofit/afpic.c: Harmonize to FT2 coding conventions. * src/base/basepic.c: Ditto. * src/base/ftpic.c: Ditto. * src/cff/cffpic.c: Ditto. * src/pshinter/pshpic.c: Ditto. * src/psnames/pspic.c: Ditto. * src/raster/rastpic.c: Ditto. * src/sfnt/sfntpic.c: Ditto. * src/smooth/ftspic.c: Ditto. * src/truetype/ttpic.c: Ditto.
suzuki toshiya 4880a0ed 2012-01-16T18:51:15 [cff] Remove redundant declarations of cff_cmap_XXX_class_rec. * src/cff/cffpic.c: The declarations of FT_Init_Class_cff_cmap_encoding_class_rec() and FT_Init_Class_cff_cmap_unicode_class_rec() are removed. They can be obtained by the inclusion of cffcmap.h. cffcmap.h invokes FT_DECLARE_CMAP_CLASS() and it declares FT_Init_Class_cff_cmap_encoding_class_rec() etc in PIC mode.
suzuki toshiya 3c966818 2012-01-15T23:35:31 Fix redundant declaration warning in PIC mode. Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were designed to declare xxx_pic_{free,init} by themselves. Because these macros are used at the end of the module interface (e.g. ttdriver.c) and the wrapper source to build a module as a single object (e.g. truetype.c) includes the PIC file (e.g. ttpic.c) before the module interface, these macros are expanded AFTER xxx_pic_{free,init} body when the modules are built as single object. The declaration after the implementation causes the redundant declaration warnings, so the declarations are moved to module PIC headers (e.g. ttpic.h). Separating to other header files are needed for multi build. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): Remove class_##_pic_free and class_##_pic_init declarations. * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE): Ditto. * src/base/basepic.h: Insert a comment and fix coding style. * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, init}. * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, init}. * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, init}. * src/raster/rastpic.h: Declare ft_raster{1,5}_renderer_class_pic_{free,init} * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. * src/smooth/ftspic.h: Declare ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
suzuki toshiya 226f3619 2012-01-14T06:40:03 Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6. Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET take no arguments but derefer the variable named `library' internally. * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and set it if non-NULL driver is passed. * src/truetype/ttdriver.c (tt_get_interface): Ditto. * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library' under PIC configuration, and set it if non-NULL module is given. * src/psnames/psmodule.c (psnames_get_interface): Ditto.
suzuki toshiya 4b733517 2012-01-14T06:32:50 Make PIC files to include module error headers, to use the error codes with per-module prefix. * src/autofit/afpic.c: Include `aferrors.h'. * src/cff/cffpic.c: Include `cfferrs.h'. * src/pshinter/pshpic.c: Include `pshnterr.h'. * src/raster/rastpic.c: Include `rasterrs.h'. * src/sfnt/sfntpic.c: Include `sferrors.h'. * src/smooth/ftspic.c: Include `ftsmerrs.h'. * src/truetype/ttpic.c: Include `tterrors.h'.
Werner Lemberg 24b77764 2011-12-08T09:51:52 Whitespace.
Werner Lemberg c52f44d4 2011-11-30T10:46:53 Whitespace.
Werner Lemberg 70cf8c5e 2011-11-26T20:09:39 Improve tracing. * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c (PCF_Face_Done): Remove tracing message. * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add `greeting' message. * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c (T42_Open_Face): Improve tracing.
Werner Lemberg d05d56ff 2011-11-26T18:13:09 [cff] Fix error code. * src/cff/cffload.c (cff_font_load): Do it.
Werner Lemberg f8f576d1 2011-11-26T18:07:30 Addition to last commit.
Werner Lemberg 930e9bf8 2011-11-26T13:38:26 Add new error code FT_Err_Missing_Module. Previously, FreeType misleadingly returned FT_Err_Unknown_File_Format if a module was missing (or a test was missing completely). * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define. * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated. * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now redundant test for `psaux'.
Chris Liddell 8b90cf0b 2011-11-13T16:30:59 Add FT_Get_PS_Font_Value() API. This allows a Type 1 font face to be interrogated to retrieve most of the dictionary keys (keys not relevant to FreeType's Type 1 interpreter are not available). * include/freetype/internal/services/svpsinfo.h (PS_GetFontValueFunc): New typedef. (PSInfo): Add `ps_get_font_value'. (FT_DEFINE_SERVICE_PSINFOREC): Updated. * include/freetype/internal/t1types.h (T1_EncodingType): Moved to... * include/freetype/t1tables.h: Here. (PS_Dict_Keys): New enumeration. (FT_Get_PS_Font_Value): New declaration. * src/base/fttype1.c (FT_Get_PS_Font_Value): New function. * src/type1/t1driver.c (t1_ps_get_font_value): This new function does the real job. (t1_service_ps_info): Add it. * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info): Updated.
Werner Lemberg 34d2818a 2011-09-26T08:59:21 [cff] Dump SIDs while tracing. * src/cff/cffobjs.c (cff_face_init): Do it. * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE] <cff_kind_string>: Identify as SID.
Werner Lemberg bb211ce6 2011-09-07T15:01:20 Fix Savannah bug #33816. * src/cff/cfftypes.h (CFF_FontRecDictRec): New member `has_font_matrix'. * src/cff/cffparse.c (cff_parse_font_matrix): Set it. Update tracing output. * src/cff/cffobjs.c (cff_face_init): Use it so that the heuristics can be removed.
Werner Lemberg 35ab70c1 2011-08-25T13:41:16 [cff] Better tracing of the parsing process. * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with FT_TRACE. * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, cff_parse_private_dict, cff_parse_cid_ros): Updated. (CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000, CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD, CFF_FIELD_DELTA): Add argument for ID. (cff_parser_run): Decorate with FT_TRACE. * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add `id' member. * src/cff/cfftoken.h: Add IDs to all fields.
Werner Lemberg aeaa1619 2011-08-24T20:50:25 [cff] Formatting, minor code clean-ups.
Werner Lemberg b91e7853 2011-08-09T17:48:44 Fix Savannah bug #33975. * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo.
Werner Lemberg e7d42366 2011-07-29T06:15:20 [cff] Add some more tracing infos. * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, cff_parse_cid_ros): Add tracing.
suzuki toshiya e62c876b 2011-06-15T02:48:33 Fix g++4.6 compiler warnings in module drivers. The background is same with previous commit. * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Init `points'. (TT_Vary_Get_Glyph_Deltas): Init `delta_xy'. (TT_Get_MM_Var): Init `mmvar'. * src/type1/t1load.c (T1_Get_MM_Var): Ditto. * src/cff/cffdrivr.c (cff_ps_get_font_info): Init `font_info'. * src/cff/cffload.c (cff_index_get_pointers): Init `t'. (cff_font_load): Init `sub'. * src/cff/cffobjs.c (cff_size_init): Init `internal'. (cff_face_init): Init `cff'. * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps): Init `snaps'. * src/pcf/pcfread.c (pcf_get_properties): Init `properties'. (pcf_get_bitmaps): Init `offsets'. (pcf_get_encodings): Init `tmpEncoding'. * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'. * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'. * src/cache/ftcmru.c (FTC_MruList_New): Init `node'. * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and `zip_buff'. * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'. * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
Daniel Zimmermann 3ad8f355 2011-05-24T06:22:32 Reduce warnings for MS Visual Studio 2010. * src/autofit/afhints.c (af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide return value. * src/cff/cffgload.c (cff_slot_load): Add cast. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper loop variable type.
Werner Lemberg 360646c9 2011-03-24T09:29:23 * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256. This limit is given on p. 37 of Adobe Tech Note #5014.
Bram Tassyns 3fd158d0 2011-03-07T09:33:53 Fix Savannah bug #27988. * src/cff/cffobjs.c (remove_style): New function. (cff_face_init): Use it to strip off the style part of the family name.
Werner Lemberg 4d0586f0 2011-03-06T18:22:08 Whitespace.
John Tytgat 18fffa45 2011-02-19T07:11:17 [cff] Fix subset prefix removal. * src/cff/cffobjs.c (remove_subset_prefix): Update length after subset prefix removal.
Werner Lemberg 75df7060 2011-02-01T07:36:27 [cff] Ignore unknown operators in charstrings. Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing message for unknown operators and continue instead of exiting with a syntax error.
Werner Lemberg f3ce2370 2011-01-03T07:11:54 */rules.mk: Handle `*pic.c' files.
Werner Lemberg 91843dfc 2010-12-31T19:30:53 * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64. Problem reported by Tom Bishop <wenlin@wenlin.com>.
Werner Lemberg 396b11b8 2010-12-09T23:16:18 [cff] Allow `hlineto' and `vlineto' without arguments. We simply ignore such instructions. This is invalid, but it doesn't harm; and indeed, there exist such subsetted fonts in PDFs. Reported by Albert Astals Cid <aacid@kde.org>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) [cff_op_hlineto]: Ignore instruction if there aren't any arguments on the stack.
Werner Lemberg d38ba0c9 2010-09-19T20:51:19 Minor fixes. * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]' is `FT_UShort'. (cff_index_access_element): Don't use additions in comparison. * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type `FT_Long'. Don't use additions in comparison. Improve tracing messages. (load_format_25, load_post_names): Make `post_limit' of type `FT_Long'.
suzuki toshiya 73aa20ca 2010-09-20T01:30:38 [cff] Truncate the element length at the end of the stream. See Savannah bug #30975. * src/cff/cffload.c (cff_index_access_element): `off2', the offset to the next element is truncated at the end of the stream to prevent invalid I/O. As `off1', the offset to the requested element has been checked by FT_STREAM_SEEK(), `off2' should be checked similarly.
suzuki toshiya d2d843a0 2010-09-20T01:28:17 [cff] Ignore CID > 0xFFFFU. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if greater than 0xFFFFU. CFF font spec does not mention about maximum CID in the font, but PostScript and PDF spec define that maximum CID is 0xFFFFU.
suzuki toshiya a0f43f20 2010-09-20T01:26:56 [cff] Make trace message in cff_charset_load() verbose. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_load): Report the original `nleft' and truncated `nleft'.
suzuki toshiya b3e1954d 2010-09-20T01:22:34 [cff] Correct `max_cid' from CID array length to max CID. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_compute_cids): Don't increment max_cid after detecting max CID. The array CFF_Charset->cids is allocated by max_cid + 1. (cff_charset_cid_to_gindex): Permit CID is less than or equal to CFF_Charset->max_cid. * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is calculated as CFF_Charset->max_cid + 1.
Werner Lemberg 5220ef58 2010-09-13T07:32:22 Fix minor issues reported by <muktha.narayan@wipro.com>. * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove redundant conditional check. * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. * src/cff/cffload.c (cff_encoding_load): Remove conditional check which always evaluates to `true'. * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): Ditto. * src/truetype/ttinterp.c (Ins_IUP): Ditto. * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if value is already dereferenced. * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
Werner Lemberg 0e95b3d1 2010-08-29T10:46:26 [cff] Allow SIDs >= 65000. * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20: The threshold for SIDs is not applicable here. I misinterpreted the `SID values 65000 and above are available for implementation use' sentence in the CFF specification. Problem reported by Ivan Ninčić <inincic@pdftron.com>.
Werner Lemberg 223cb1b5 2010-08-06T06:55:09 [cff] Add comment to clarify current implementation of `pop' operator.
suzuki toshiya d9b3e394 2010-08-05T17:10:32 [cff] Don't use any values in decoder after parsing error. * src/cff/cffgload.c (cff_slot_load): Skip the evaluations of the values in decoder, if cff_decoder_parse_charstrings() returns any error.
Suzuki, Toshiya (鈴木俊哉) 11d65e8a 2010-08-04T14:43:29 [cff] Improve stack overflow test. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack after execution of operations too.
Werner Lemberg 2de6b8a3 2010-07-17T13:39:50 [cff] Final try to fix `hintmask' and `cntrmask' limit check. Problem reported by Tobias Wolf <towolf@gmail.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Sigh. I'm apparently too silly to fix this correctly in less than three tries.
suzuki toshiya d594202e 2010-07-11T00:31:17 Fix another case reported in Savannah bug #30373. Permit a face for Type1, Type42 and CFF without charmap, patch by Tor Andersson. * src/type1/t1objs.c (T1_Face_Init): Reset the error if it is FT_Err_No_Unicode_Glyph_Name. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/cff/cffobjs.c (cff_face_init): Ditto.
suzuki toshiya 840f208d 2010-07-09T12:26:33 Use defined macros to set {platform,encoding}_id. * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to set charmap.{platfom,encoding}_id. * src/pcf/pcfdrivr.c: Ditto. * src/winfonts/winfnt.c: Ditto. * src/type1/t1objs.c: Ditto. * src/type42/t42objs.c: Ditto. * src/cff/cffobjs.c: Ditto. * src/pfr/pfrobjs.c: Ditto.
suzuki toshiya dfba8cfe 2010-07-09T12:25:36 Apple Unicode is not deprecated now.
suzuki toshiya b8ca6de3 2010-07-09T11:36:00 Fix Savannah bug #30373. Too serious check of errors by `FT_CMap_New' since 2010-07-04 is fixed. Reported by Tor Andersson. * include/freetype/fterrdef.h (PSnames_Err_No_Unicode_Glyph_Name): New error code to indicate the Unicode charmap synthesis failed because no Unicode glyph name is found. * src/psnames/psmodule.c (ps_unicodes_init): Return PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name is found in the font. * src/cff/cffcmap.c (cff_cmap_unicode_init): Return CFF_Err_No_Unicode_Glyph_Name when no SID is available. * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New' is failed by the lack of Unicode glyph name. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/cff/cffobjs.c (cff_face_init): Ditto.
Werner Lemberg c73e1605 2010-07-06T10:44:56 Pacify compiler. * src/cff/cffload.c (cff_index_get_pointers): Initialize `new_bytes'.
Werner Lemberg 2dc76a46 2010-07-05T06:40:02 [cff] Next try to fix `hintmask' and `cntrmask' limit check. Problem reported by malc <av1474@comtv.ru>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: It is possible that there is just a single byte after the `hintmask' or `cntrmask', e.g., a `return' instruction.
suzuki toshiya 0ae32718 2010-07-04T20:14:18 Restrict the number of the charmaps in a rogue-compatible mode. Fix for Savannah bug #30059. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the minimum character code passed by a legacy rogue client by... * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE): This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is undefined (thus the rogue client compatibility is not required). * src/cff/cffobjs.c (cff_face_init): Abort the automatic selection or synthesis of Unicode cmap subtable when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (find_variant_selector_charmap): When UVS charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (FT_Select_Charmap): When a charmap matching with requested encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Set_Charmap): When a charmap matching with requested charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Get_Charmap_Index): When a requested charmap is found after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap index.