src/psaux/psobjs.c


Log

Author Commit Date CI Message
Werner Lemberg d924a66a 2021-02-04T07:44:06 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. This ensures good logging output, with all lines having a proper prefix (if requested). This is a continuation of a similar patch from 2020-12-02, which missed some locations.
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Priyesh Kumar 53be1753 2020-07-28T07:33:40 Fix `-Wformat' compiler warnings. * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
Werner Lemberg 16586859 2020-06-13T21:15:45 Remove redundant inclusion of `ft2build.h'. * */*: Remove `#include <ft2build.h>' where possible. * include/freetype/freetype.h: Remove cpp error about missing inclusion of `ft2build.h'.
David Turner e1339133 2020-06-08T13:31:55 Make macros for header file names optional. We no longer have to take care of the 8.3 file name limit; this allows us (a) to introduce longer, meaningful file names, and (b) to avoid macro names in `#include' lines altogether since some compilers (most notably Visual C++) doesn't support this properly. */*: Replace #include FOO_H with #include <freetype/foo.h> or something similar. Also update the documentation.
Werner Lemberg e5038be7 2020-01-19T17:05:19 Update all copyright notices.
Werner Lemberg 2c9a2d58 2019-12-13T23:56:25 Another bunch of UBSan warnings on adding offsets to nullptr. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19427 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19433 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19441 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19451 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19452 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19457 * src/autofit/aflatin.c (af_latin_hints_compute_segments, af_latin_hints_compute_edges): Use `FT_OFFSET'. * src/base/ftstream.c (FT_Stream_EnterFrame): Use `FT_OFFSET'. * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Exit early if there is no charstring. * src/psaux/psobjs.c (t1_decrypt): Use `FT_OFFSET'. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Exit early for zero bitmap dimensions.
Dominik Röttsches 11d4ce23 2019-12-09T12:40:42 Fix more UBSan warnings on adding offset to nullptr (#57384) * src/smooth/ftsmooth.c (ft_smooth_render_generic), src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'.
Alexei Podtelezhnikov 78c02bc1 2019-06-10T23:09:49 [type1,type42] Use `const' for string literals. * include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated. * include/freetype/internal/t1types.h (T1_EncodingRec): Updated. * src/psaux/psobjs.[ch] (ps_table_add): Updated. * src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated. * src/type42/t42objs.c (T42_Open_Face): Updated. * src/type42/t42parse.c (t42_parse_encoding): Updated. * src/cff/cffobjs.c (cff_face_init): Minor.
Werner Lemberg 75859970 2019-02-23T10:07:09 Update all copyright notices.
Werner Lemberg f686ad46 2019-01-22T20:31:44 Update copyright years.
Werner Lemberg 58e48e92 2018-11-09T12:14:35 [psaux] Add safety guard (#54985). * src/psaux/psobjs.c (cff_builder_close_contour): Do it.
Werner Lemberg 4dc0d48f 2018-08-18T14:39:20 [psaux] Avoid slow PS font parsing in case of error. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9955 * src/psaux/psobjs.c (ps_parser_to_bytes): Set `parser->cursor' even in case of error to avoid potential re-scanning.
Werner Lemberg a0dd16fb 2018-08-15T18:13:17 Don't use `trace_' prefix for FT_COMPONENT arguments. * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
Werner Lemberg 8ed53468 2018-07-25T22:07:22 [psaux, type1] Trace PostScript dictionaries and other things. The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary right now. * src/psaux/psobjs.c (ps_parser_load_field, ps_parser_load_field_table): Add tracing calls. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing output more compact. * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add tracing messages. * src/type1/t1load.c (parse_blend_axis_types, parse_blend_design_positions, parse_blend_design_map, parse_weight_vector, t1_load_keyword, t1_parse_font_matrix, parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add tracing calls. * src/type1/t1objs.c (T1_Face_Init): Add tracing call. * src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more verbose.
Werner Lemberg 9ac9060d 2018-06-03T09:01:17 [GSoC] src/*.*: Convert block comments to `light' style. This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
Werner Lemberg 0a0c2256 2018-01-02T09:33:57 Update copyright year.
Werner Lemberg 98ba0c4a 2017-12-08T18:38:41 New `ftdriver.h' file, covering all driver modules. This reduces redundancy and increases synergy; it also reduces the number of header files. * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro. (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H, FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to FT_DRIVER_H. * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h, include/freetype/ftttdrv.h: Replaced with... * include/freetype/ftdriver.h: ...this new file. (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to... (FT_HINTING_ADOBE): ... this new macro. (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to... (FT_HINTING_FREETYPE): ... this new macro. * src/*/*: Updated accordingly.
Werner Lemberg 63b91548 2017-12-07T14:33:44 Fix `make multi'. * include/freetype/internal/fttrace.h: Remove unused tracing macros. s/pshalgo2/pshalgo/. Add `trace_cffdecode'. * src/pshinter/pshalgo.c (FT_COMPONENT): Updated. * src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and FT_SERVICE_CFF_TABLE_LOAD_H. * src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/psaux/cffdecode.c: Include FT_FREETYPE_H and FT_INTERNAL_DEBUG_H. (FT_COMPONENT): Define. * src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. Declare `cff_builder_funcs' and `ps_builder_funcs'. * src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'. * src/psaux/psobjs.c : Include `psauxmod.h'.
Ewald Hew b9bd2d14 2017-11-22T12:32:47 [psaux] Fix CFF advance widths. (#52466) Glyph advance widths were being written to the new `PS_Decoder' but not saved to the underlying format specific decoder. This caused pure CFF fonts to have bad advance width. * include/freetype/internal/psaux.h (PS_Decoder): Change `glyph_width' field to pointer. Remove unused fields. * src/psaux/psobjs.c (ps_decoder_init): Change `glyph_width' from copy to reference. Remove unused. * src/psaux/psft.c (cf2_setGlyphWidth): Update code.
Ewald Hew dff40d03 2017-10-12T18:13:21 Add T1_CONFIG_OPTION_OLD_ENGINE configuration option. This controls whether the old Type 1 engine gets compiled into FreeType. It is disabled by default. * devel/ftoption.h, include/freetype/config/ftoption.h (T1_CONFIG_OPTION_OLD_ENGINE): New macro. * include/freetype/internal/psaux.h (PS_Decoder): Remove unused field. * include/freetype/internal/psaux.h, src/cid/cidgload.c (cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c (ps_builder_add_point), src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph, t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h, src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround relevant code with macro. Minor code changes.
Werner Lemberg 179caf5a 2017-10-01T01:39:27 [psaux] Formatting, minor fixes, whitespace, copyright notices.
Werner Lemberg 4cdbac05 2017-09-25T09:05:00 Fix compiler warnings. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant test. * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escCALLOTHERSUBR>: Add casts. * src/psaux/psobjs.c (ps_decoder_init): Add cast.
Ewald Hew a1a6a1f6 2017-09-25T08:31:52 Minor fixes. * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}: Rearrange `ps_builder_init' arguments to conventional order. * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and notice for `SubFont' in Type 1 mode.
Ewald Hew 6e7da50b 2017-09-25T08:29:38 Documentation fixes.
Ewald Hew ebb1735a 2017-09-25T08:26:57 Move `psdecode' into `psobjs'. As the former only contains a single procedure, move it into `psobjs' for simplicity. Also change the parameter order to the conventional one. * src/psaux/psdecode.c (ps_decoder_init): Moved to... * src/psaux/psobjs.c: ...Here. * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update `ps_decoder_init' function signature. * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c: Update calls. * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes. * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): Update file references.
Ewald Hew 93e3cffd 2017-09-25T08:08:21 Change subfont synthesis for CID fonts. Change `t1_make_subfont' to take in the Private dict record as an argument. This is because Type 1 and CID font records in FreeType have this in different places. * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to `FT_Face' so that CID is also accepted. Take `PS_Private' as an argument and let caller figure out where the Private dict actually is. Update references. * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update declaration. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update call.
Ewald Hew 6eb03f8f 2017-09-25T06:49:41 Add missing objects (2/2). Synthesize a `SubFont' object for Type 1 fonts. This is used in the interpreter to access Private dict data, which are stored in different places for Type 1 and CFF. This allows the same data to be used in either mode. * src/psaux/psobjs.c (t1_make_subfont): New procedure to copy required values to a dummy `CFF_SubFont' object. This is similar to `cff_make_private_dict'. * src/psaux/psobjs.h: Add the new declaration. * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Ditto. Add this to the PSAux Service for future use with CID fonts. * src/type1/t1gload.c: Include FT_INTERNAL_CFF_TYPES_H. (T1_Parse_Glyph_And_Get_Char_String): Add the call.
Ewald Hew 7e185dcd 2017-09-25T06:40:32 Allow `type1' module to use the Adobe engine. Add the callback and some conditionals to switch between the two engines. * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Change function declarations. * src/psaux/psauxmod.c (T1_Decoder_FuncsRec): Register the callbacks. * src/psaux/psobjs.c (ps_builder_add_point): Add conditionals for number conversion. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add code to choose which renderer to use. * src/cid/cidgload.c (cid_load_glyph): Update call. * src/base/ftobjs.c, src/psaux/psobjs.c, src/type1/t1gload.c: Update includes.
Ewald Hew 645d1b86 2017-09-25T06:28:25 Move and rename `CFF_Driver'. This is so that we can use the same hinting engine parameters for Type 1. * include/freetype/internal/cffotypes.h (CFF_Driver): Rename and move to... * include/freetype/internal/psaux.h (PS_Driver): ...here. * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffload.c, src/cff/cffobjs.c, src/cff/cffobjs.h, src/psaux/psft.c, src/psaux/psobjs.c: Update references.
Ewald Hew d23affe1 2017-09-25T06:22:52 Reorganize object fields. Make some fields more generic, so that we can access them the same way regardless of Type 1 or CFF. * include/freetype/internal/psaux.h (PS_Builder): Change `TT_Face' to `FT_Face'. Remove unused fields. * src/psaux/psft.c: Update all accesses of `PS_Builder.face'. Add some asserts to guard against casting `T1_Face' as `TT_Face'. * src/type1/t1objs.h (T1_GlyphSlot): Reorder fields to follow `CFF_GlyphSlot', so that we can pretend they are the same in the interpreter. * src/psaux/psobjs.c (ps_builder_init, ps_builder_add_point): Updated with above changes.
Ewald Hew 43c01582 2017-09-24T23:00:36 Objects for new interpreter (part 2). Make the new objects copy over values. They are essentially wrapper types for the different decoders/builders. * include/freetype/internal/psaux.h: Update declarations. (PS_Builder): Add `is_t1' flag. (PS_Decoder_{Get,Free}_Glyph_Callback): Renamed to... (CFF_Decoder_{Get,Free}_Glyph_Callback: ... this. (PS_Decoder): Updated. Add `t1_parse_callback' member. (PSAux_ServiceRec): Add `ps_decoder_init' member. * src/psaux/psdecode.h, src/psaux/psobjs.h: Update declarations. * src/psaux/psdecode.c, src/psaux/psobjs.c: Implement copy with two modes. * src/psaux/psauxmod.c: Add builder and decoder functions to `PSAux' service.
Ewald Hew eba54c28 2017-09-24T22:49:56 Add objects for new interpreter. Introduce `PS_Decoder' and `PS_Builder' which include all fields from either Type 1 or CFF decoders/builders. * include/freetype/internal/psaux.h (PS_Builder, PS_Decoder): New structs. * src/psaux/psobjs.c, src/psaux/psobjs.h: Add `PS_Builder' functions. * src/psaux/psdecode.c, src/psaux/psdecode.h: New files to hold `PS_Decoder' initialization functions. * src/psaux/psaux.c, src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): Updated.
Ewald Hew b624868b 2017-09-24T22:32:40 Move `cff_random' into `psaux' service. NOTE: Does not compile! Minor fix to allow both `cff' and `psaux' to use `cff_random'. * src/cff/cffload.c (cff_random): Move to... * src/psaux/psobjs.c: Here. * src/cff/cffload.h: Move corresponding declaration to `src/psaux/psobjs.h'. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Register the function here... * src/psaux/psauxmod.c: And here. * src/cff/cffload.c, src/psaux/cf2intrp.c: Update code.
Ewald Hew 816c9c1f 2017-09-24T21:43:05 Move CFF builder components into `psaux' module. NOTE: Does not compile! * src/cff/cffgload.c (cff_builder_{init,done,add_point,add_point1,add_contour,start_point,close_contour}, cff_check_points): Move to... * src/psaux/psobjs.c: Here. * src/cff/cffgload.h: Move corresponding declarations to `src/psaux/psobjs.h'. * src/cff/cffgload.h (CFF_Builder): Move struct declaration to... * include/freetype/internal/psaux.h: Here.
Werner Lemberg 5412d886 2017-04-22T12:48:50 Introduce `FT_Size_InternalRec' structure. We are going to extend this later on. * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): New structure with a single field `module_data'. * src/base/ftobjs.c (FT_New_Size): Allocate `internal' field of `FT_Size' structure. * src/cff/cffgload.c (cff_builder_init, cff_decoder_prepare): Use `size->internal->module_data' instead of `size->internal'. * src/cff/cffobjs.c (cff_size_done): Deallocate `module_data'. (cff_size_init, cff_size_select, cff_size_request): Use `size->internal->module_data' instead of `size->internal'. * src/cif/cidobjs.c (cid_size_done, cid_size_init, cid_size_request): Use `size->internal->module_data' instead of `size->internal'. * src/psaux/psobjs.c (t1_builder_ini): Use `size->internal->module_data' instead of `size->internal'. * src/type1/t1objs.c (T1_Size_Done, T1_Size_Init, T1_Size_Request): Use `size->internal->module_data' instead of `size->internal'.
Werner Lemberg 3774fc08 2017-03-26T08:32:09 * src/psaux/psobjs.c (t1_builder_close_contour): Add safety guard. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=941
Werner Lemberg 563ae780 2017-01-04T20:16:34 Update copyright year.
Werner Lemberg f80c4473 2016-12-26T23:57:45 Replace `++foo' and `--foo' with `foo++' and `foo--', resp.
Werner Lemberg 4441f7b2 2016-12-26T17:08:17 Replace `foo == NULL' and `foo != NULL' with `!foo' and `foo', resp. Other minor formatting.
Werner Lemberg 37c72f66 2016-12-25T22:55:25 Minor formatting.
Werner Lemberg d583561e 2016-05-21T11:20:42 Minor clang++ fixes. * src/base/ftobjs.c (FT_Add_Module), src/psaux/psobjs.c (ps_parser_load_field), src/type1/t1load.c (parse_subrs): Add initializer. * src/cache/ftccache.h (FTC_CACHE_TRYLOOP_END): Avoid implicit conversion from NULL to boolean.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg 4942c2bb 2015-09-17T17:56:53 [psaux] Fix memory leak (#45986). * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>: Free `temp' in case of error.
Werner Lemberg 7d364b7e 2015-09-17T16:31:58 [psaux] Improve tracing message. * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>: Handle plural correctly.
Werner Lemberg db5a4a9a 2015-09-12T08:32:55 [psaux] Fix potential buffer overflow (#45922). * src/psaux/psobjs.c (ps_parser_skip_PS_token): If a token is enclosed in balanced expressions, ensure that the cursor position doesn't get larger than the current limit.
Alexei Podtelezhnikov eabc8d72 2015-04-12T23:16:48 [psaux,psnames,type1,type42] NULL.
Werner Lemberg 04c22370 2015-02-25T11:20:20 [psaux] Signedness fixes. * include/internal/psaux.h, src/psaux/afmparse.c, src/psaux/afmparse.h, src/psaux/psconv.c, src/psaux/psobjs.c, src/psaux/t1cmap.c, src/psaux/t1decode.c: Apply.
Werner Lemberg 3b5f332c 2015-02-18T11:45:22 [type1] Fix signedness issues. * include/internal/psaux.h, include/internal/t1types.h, src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c, src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1parse.c: Apply.
Werner Lemberg 6bd7d28f 2015-02-18T09:22:06 Don't use `FT_PtrDist' for lengths. Use FT_UInt instead. * include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec, T1_DecoderRec): Do it. * include/internal/t1types.h (T1_FontRec): Ditto. * src/cid/cidload.c (cid_parse_dict): Updated. * src/pfr/pfrload.c (pfr_extra_item_load_font_id): Ditto. * src/psaux/psobjs.c (ps_table_add), src/psaux/psobjs.h: Ditto. * src/type1/t1load.c (parse_blend_axis_types, parse_encoding, parse_chharstrings, parse_dict): Ditto. * src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings, t42_parse_dict): Ditto.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Werner Lemberg 6689a009 2014-11-25T08:53:09 [Savannah bug #43682] Properly handle missing return errors. The functions in this patch *do* return non-trivial errors that must be taken care of. * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render), src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>, src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode (t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c (load_truetype_glyph <subglyph loop>, tt_loader_init, TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend), src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.
Werner Lemberg 8b281f83 2014-01-23T08:14:53 Fix Savannah bug #41309. * src/type1/t1load.c (t1_parse_font_matrix): Properly handle result of `T1_ToFixedArray'. * src/cid/cidload.c (cid_parse_font_matrix): Synchronize with `t1_parse_font_matrix'. * src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with `t1_parse_font_matrix'. (t42_parse_encoding): Synchronize with `t1_parse_encoding'. * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>, <T1_FIELD_TYPE_MMOX>: Properly handle result of `ps_tofixedarray'.
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.
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 2ef0a198 2012-12-23T21:14:37 [type1] Fix handling of /FontBBox in MM fonts. Problem reported by Del Merritt <del@alum.mit.edu> If we have /FontBBox { { 11 12 13 14 15 16 17 18 } { 21 22 23 24 25 26 27 28 } { 31 32 33 34 35 36 37 38 } { 41 42 43 44 45 46 47 48 } } in the /Blend dictionary, then the first BBox is { 11 21 31 41 }, the second { 12 22 32 42 }, etc. * include/freetype/internal/psaux.h (T1_FieldType): Add `T1_FIELD_TYPE_MM_BBOX' (for temporary use). * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>: Implement it.
Werner Lemberg 58cbc465 2012-02-26T05:26:56 [type1] Fix Savannah bug #35606. * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'. * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message only if cur < limit.
Werner Lemberg 9b008750 2011-04-13T13:37:37 Fix Savannah bug #33047. Patch submitted by anonymous reporter. * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer difference.
Werner Lemberg 90b07bd5 2010-06-20T16:27:36 Fix Savannah bug #30145. * src/psaux/psobjs.c (t1_builder_add_contour): Protect against `outline == NULL' which might happen in invalid fonts.
Werner Lemberg 370aea80 2010-06-08T08:37:11 Formatting.
Ken Sharp 54e63755 2010-04-14T23:38:35 Fix Savannah bug #29444. * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid) `lineto' immediately after `hsbw', in accordance with Acrobat, GS, and others.
suzuki toshiya d200982d 2009-08-01T00:30:17 psaux: Use size_t variable to pass the buffer size.
Werner Lemberg 858abbed 2009-06-26T06:15:41 For warning messages, replace FT_ERROR with FT_TRACE0. FT_ERROR is now used only if a function produces a non-zero `error' value. Formatting, improving and harmonizing debug strings.
Werner Lemberg 11cb8c36 2009-06-22T16:56:47 Use 16.16 format while parsing Type 1 charstrings. This fixes Savannah bug #26867. Previously, only integers have been used which can lead to serious rounding errors. However, fractional values are only used internally; after the charstrings (of either Type 1 or 2) have been processed, the resulting coordinates get rounded to integers currently -- before applying scaling. This should be fixed; at the same time a new load flag should be introduced, to be used in combination with FT_LOAD_NO_SCALE, which indicates that font units are returned in 16.16 format. Similarly, the incremental interface should be extended to allow fractional values for metrics. * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift' field. * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc, T1_Hints_SetStem3Func): Use FT_Fixed for coordinates. * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H. (t1_build_add_point): Always convert fixed to integer. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Use 16.16 format everywhere (except for large integers followed by a `div'). [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate code uncoditionally. Add support for random numbers and update remaining code accordingly; this should work now. (t1_operator_seac): Updated. * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H. (ps_hints_t1stem3, t1_hints_stem): Updated. * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H. (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL], (cid_face_compute_max_advance, cid_slot_load_glyph): Updated. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String) [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph): Updated. * src/type1/t1load.c: Include FT_INTERNAL_CALC_H. * src/type1/t1objs.c (T1_Face_Init): Updated.
Werner Lemberg 1f540eff 2009-06-20T13:24:08 Remove unused variables. * include/freetype/internal/psaux.h (T1_BuilderRec), src/cff/cffgload.h (CFF_Builder): Remove `last'. Update all users.
Werner Lemberg 9d83d290 2009-01-09T07:58:08 Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2. * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle `count_offset' if it is zero (i.e., unused). Otherwise, the first element of the structure which holds the data is erroneously modified. Problem reported by Chi Nguyen <chint@necsv.com>.
Werner Lemberg 52cd0fc8 2008-11-24T08:15:05 Fixes from the gnuwin32 port. * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/. * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H. * src/psaux/psobjs.c (ps_table_add): Check `length'.
Werner Lemberg e0ed07d7 2008-11-04T10:37:30 * src/type1/t1load.c (parse_subrs): Use an endless loop. There are fonts (like HELVI.PFB version 003.001, used on OS/2) which define some `subrs' elements more than once. Problem reported by Peter Weilbacher <mozilla@weilbacher.org>.
Werner Lemberg 5563bea0 2008-06-24T05:44:28 * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour if it consists of one point only. Based on a patch from Savannah bug #23683 (from John Tytgat).
Werner Lemberg 7cb9ec0f 2008-06-09T20:49:29 * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and `private_len' unsigned. * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read it as such. (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned. * src/base/ftstream.c (FT_Stream_Skip): Reject negative values. * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis' for sane value. Fix typo. * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly. * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check `last_point'. * src/sfnt/ttload.c (tt_face_load_max_profile): Limit `maxTwilightPoints'.
Werner Lemberg de9479a0 2008-04-26T12:52:57 * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x' and `scale_y' as obsolete since they aren't used. * src/psaux/psobjs.c (t1_builder_init): Updated. * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as obsolete since they aren't used. * src/cff/cffgload.c (cff_builder_init): Updated.
Werner Lemberg f9fa1c8b 2007-06-18T17:00:05 * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect assertion. (ps_parser_to_bytes): Fix error message. * src/type42/t42objs.c (T42_Open_Face): Handle one more error return. * src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/. Don't allow mixed binary and hex strings. Handle zero string_size == 0 and string_buf == 0.
Werner Lemberg f48aec7b 2007-06-18T07:07:55 * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit logic. (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>: Skip delimiters correctly. (ps_parser_load_field_table): Use `fields->array_max' instead of T1_MAX_TABLE_ELEMENTS to limit the number of arguments.
Werner Lemberg e5c14d93 2007-06-05T20:50:37 * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1 in case of parsing error. (ps_parser_load_field): Updated. * src/type1/t1load.c (parse_font_matrix): Updated.
Werner Lemberg 6e87ed9f 2007-01-26T22:18:56 Spelling fixes from Alexei.
Werner Lemberg 9b774e28 2007-01-16T06:11:27 Remove trailing whitespace. From Alexei.
Jens Claudius 9950adcc 2006-08-13T12:14:36 * freetype2/include/freetype/internal/psaux.h: (enum T1_TokenType_): add T1_TOKEN_TYPE_KEY. (struct T1_FieldRec_) add `dict'. Add macros T1_FIELD_DICT_FONTDICT and T1_FIELD_DICT_PRIVATE. Change T1_NEW_XXX and T1_FIELD_XXX macros to take the dictionary where the PS keywords is expected as an additional argument. * freetype2/src/cid/cidload.c: (T1_FieldRec): Adjust invocations of T1_FIELD_XXX. * freetype2/src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX. * freetype2/src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing. (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY instead as T1_TOKEN_TYPE_ANY. (ps_parser_load_field): Make sure a token that should be a string or name is a string or name indeed. Avoid memory leak if a keyword has been already encountered and its value is overwritten. * freetype2/src/type1/t1load.c: (T1_FieldRec): Adjust invocations of T1_FIELD_XXX. (parse_dict): Ignore keywords that occur in the wrong dictionary (e.g., in Private instead of FontDict). * freetype2/src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX.
Werner Lemberg 1a380e02 2006-07-14T18:28:08 * freetype2/include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h). (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER, T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND. (T1_DecoderRec): New fields `buildchar' and `face'. (IS_PS_TOKEN): New macro. * freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New fields `ndv_idx', `cdv_idx', and `len_buildchar'. * freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields `default_design_vector' and `num_default_design_vector'. * freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h. * freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token' argument to be NULL if we want only to count the number of tokens. (ps_tocoordarray): Allow `coords' argument to be NULL if we just want to skip the array. (ps_tofixedarray): Allow `values' argument to be NULL if we just want to skip the array. * freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support for (partially commented out) othersubrs 19-25, 27, and 28. (t1_decoder_init): Initialize new fields `face' and `buildchar'. (t1_decoder_done): Release new field `buildchar'. * freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New functions. (t1_keywords): Register them. (t1_allocate_blend): Updated. (t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER, T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND. (parse_dict): Remove `keyword_flags' argument. Use new macro IS_PS_TOKEN. Changed function so that later PostScript definitions override earlier ones. (t1_init_loader): Initialize new field `keywords_encountered'. (T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and `len_buildchar'. Remove `keywords_flags'. * freetype2/src/type1/t1load.h (T1_LoaderRect): New field `keywords_encountered'. (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros. * freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New entries for parsing /NDV, /CDV, and /DesignVector.
Werner Lemberg e9a74667 2006-06-26T17:37:44 Fix handling of self-delimiting tokens.
Werner Lemberg c011f4cb 2006-06-26T09:40:00 The Type 1 parser now skips over top-level procedures as required for a `Simplified Parser'. This makes the parser more robust as it doesn't poke around in PostScript code. Additionally, it makes the FontDirectory hackery in src/type1/t1load.c unnecessary. * src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro. (skip_literal_string): Add FT_Error as return value. Handle escapes better. (skip_string): Add FT_Error as return value. Don't set `parser->error' but return error code directly. (skip_procedure): New function. (ps_parser_skip_PS_token): Handle procedures. Update code. (ps_parser_to_token): Update code. (ps_parser_load_field_table): Handle bbox entries also. * src/type1/t1load.c (parse_dict): Remove FontDirectory hackery. Add commented-out code for synthetic fonts.
Werner Lemberg 564b4432 2006-04-26T15:02:52 * src/psaux/psobjs.c (shift_elements): Don't use FT_Long but FT_PtrDiff for `delta'. Reported by Cline PILLET <Celine.Pillet@Tagginfo.com>.
Werner Lemberg ce94c7a9 2006-01-16T22:35:33 Formatting, copyright years.
Wu, Chia-I (吳佳一) 108fdbbb 2006-01-16T15:35:56 * src/psaux/afmparse.c, src/psaux/afmparse.h: New files which implement an AFM parser. It is used to parse an AFM file. * src/psaux/psconv.c, src/psaux/psconv.h: New files to provide conversion functions (e.g, PS real number => FT_Fixed) for the PS_Parser and AFM_Parser. Some of the functions are taken, with some modifications, from the psobjs.c * src/psaux/psobjs.c: Use functions from psconv.c. * include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add `AFM_Parser' to the `psaux' service. * src/psaux/psaux.c, src/psaux/rules.mk: Include those new files. * src/tools/test_afm.c: A test program for AFM parser. * include/freetype/internal/services/svkern.h, include/freetype/internal/ftserv.h: New service `Kerning'. It is currently only used to get the track kerning information. * src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c, src/type1/t1afm.h: Update to use the AFM parser. Provide the `Kerning' service. * include/freetype/freetype.h, src/base/ftobjs.c: New API `FT_Get_Track_Kerning'.
David Turner 9fbd2ab8 2005-10-28T16:14:14 - various performance enhancements - fixing apinames.c, adding support for Watcom and Borland compilers - adding generation of exported symbols list to the build system, including the Unix one !! sorry Werner, I have no time to document this in ChangeLog at the moment
Werner Lemberg da245ee3 2005-08-18T07:40:32 Forgot to check in last change.
Werner Lemberg 1d565fb0 2005-02-13T21:42:42 * src/type1/t1load.c (read_binary_data): Return more meaningful value. (parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check parser error value after call to T1_Skip_PS_Token (where necessary). * src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error value after call to T1_Skip_PS_Token. * src/cid/cidparse.c (cid_parser_new): Check parser error value after call to cid_parser_skip_PS_token. * src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings, t42_parse_dict): Check parser error value after call to T1_Skip_PS_Token (where necessary). * src/psaux/psobjc.c (skip_string, ps_parser_skip_PS_token, ps_tobytes): Add error messages.
Werner Lemberg efd4e877 2004-05-13T12:59:59 * include/freetype/internal/psaux.h (T1_ParseState): New enumeration. (T1_BuilderRec): Replace `path_begun' with `parse_state'. Remove `error'. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Replace `Memory_Error' with `Fail' and update all users. Don't use `builder->error'. Replace `path_begun' with `parse_state' and check parsing states. * src/psaux/psobjs.c (t1_builder_init, t1_builder_start_point): Replace `path_begun' with `parse_state' and check parsing states.
Werner Lemberg 2b32a177 2004-04-24T06:06:39 * src/cff/cffparse.c (cff_parser_run), src/psaux/psobjs.c (ps_parser_load_field): Use FT_CHAR_BIT.
Werner Lemberg 07dcc101 2004-04-21T22:27:11 formatting, doc improvements
David Turner 10bf05a3 2004-04-21T14:30:37 * src/cff/cffobjs.c (cff_face_init): fixed a small memory leak * src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c: removed compiler warnings * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c, src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c: changed data arrays to "const" to avoid populating the ".data" segment
Werner Lemberg c78df1ef 2004-04-21T07:36:38 * src/psaux/psobjs.c (T1Radix): Renamed to... (ps_radix): This. Update current cursor position. * docs/CHANGES: Updated.
Werner Lemberg 95867077 2004-02-12T08:33:20 * src/cid/cidload.c (cid_face_open): Always allocate face->cid_stream so that we can deallocate it safely. Make the PS parser more tolerant w.r.t. non-standard font data. In general, an error is only reported in case of a syntax error; a wrong type is now simply ignored (if possible). To be independent of the order of various MM-specific keywords, the parse_shared_dict routine has been removed -- the PS parser is now capable to skip this data. It no longer fails on parsing e.g. dup /WeightVector exch def Since the token following /WeightVector isn't `[' (starting an array) it is simply ignored. * include/freetype/fterrdef.h: Define `FT_Err_Ignore' (0xA2) as a new internal error value. * src/type1/t1load.c (parse_blend_axis_types, parse_blend_design_positions, parse_blend_design_map): Return T1_Err_Ignore if no proper array is following the keyword. (parse_weight_vector): Use T1_ToTokenArray, initializing `blend' structure, if necessary. Return T1_Err_Ignore if no proper array is following the keyword. (parse_shared_dict): Removed. (parse_encoding): Set parser->root.error to return T1_Err_Ignore if no result can be obtained. Check for errors before accessing `elements' array. (t1_keywords): Remove /shareddict. (parse_dict): Reset error if t1_load_keyword returns T1_Err_Ignore. Set keyword_flag only in case of success. Check error code if skipping an unrecognized token. (T1_Open_Face) [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: Call T1_Done_Blend if blend commands haven't set up a proper MM font. * src/psaux/psobjs.c (ps_parser_load_field_table): Remove special code for synthetic fonts. Return PSaux_Err_Ignore if no proper value has been found.
David Turner 87c0d30f 2003-12-24T01:10:46 * include/freetype/fttypes.h src/autofit/afangles.c src/autofit/aflatin.c src/autohint/ahglyph.c src/autohint/ahhint.c src/base/ftcalc.c src/base/ftgloadr.c src/base/ftglyph.c src/base/ftobjs.c src/base/ftsynth.c src/base/fttrigon.c src/cff/cffgload.c src/cid/cidgload.c src/cid/cidload.c src/pfr/pfrgload.c src/pfr/pfrload.c src/pfr/pfrsbit.c src/psaux/psobjs.c src/pshinter/pshalgo.c src/pshinter/pshglob.c src/pshinter/pshrec.c src/raster/ftrend1.c src/sfnt/ttcmap0.c src/smooth/ftsmooth.c src/truetype/ttdriver.c src/truetype/ttgload.c src/truetype/ttinterp.c src/truetype/ttobjs.c src/type1/t1gload.c src/winfonts/winfnt.c: use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler warnings with very pedantic compilers. Hints: (x) & -64 will warn if (x) is not signed.. use (x) & ~63 instead !
Werner Lemberg b36d4a53 2003-12-12T15:38:39 * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message. (cff_get_name_index): Return if no PSNames service is available. (cff_ps_has_glyph_names): Handle CID-keyed fonts correctly. * src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for CID-keyed fonts. This is the inverse mapping of `sids'. * src/cff/cffload.c (cff_charset_load): New argument `invert'. Initialize charset->cids if `invert' is set. (cff_font_load): In call to cff_charset_load, set `invert' to true for CID-keyed fonts. * src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID and map it to the real glyph index. * docs/CHANGES: Updated.
Werner Lemberg dc8ad54f 2003-12-09T02:12:14 * include/freetype/internal/psaux.h (PS_TableRec): Change type of `lengths' to FT_PtrDist. (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist. * include/freetype/internal/t1types.h (T1_FontRec): Change type of `subrs_len' and `charstrings_len' to FT_PtrDist. * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk' variable with better solution. (IsMacResource): Remove unused variable `map_len'. Replace `junk' variable with better solution. (FT_Open_Face) [!FT_MACINTOSH]: Add conditional FT_CONFIG_OPTION_MAC_FONTS. * src/autohint/ahhint.c (ah_hinter_hint_edges, ah_hinter_align_strong_points): Add some casts. * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type of `pos' to FT_Long. * src/base/ftobjs.c (Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Change type of `len' to FT_Long. * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
Werner Lemberg 17d75819 2003-10-20T08:29:46 * src/autohint/ahhint.c (ah_hinter_load_glyph): Patch from 2003-08-18 introduced a severe bug (FT_Render_Glyph was called twice under some circumstances, causing strange results). This is fixed now by clearing the FT_LOAD_RENDER bit of `load_flags'. * src/base/ftpfr.c (FT_Get_PFR_Metrics): Initialize `error'. * src/psaux/psobjs.c (ps_tobytes): Initialize `n'. * src/type42/t42parse.c (t42_parse_sfnts): Initialize `string_size'.
Werner Lemberg e3f41982 2003-10-16T15:48:39 Completely revised Type 42 parser. It now handles both fonts produced with ttftot42 (tested version 0.3.1) and TrueTypeToType42.ps (tested version May 2001; it is necessary to fix the broken header comment to be `%!PS-TrueTypeFont...'). * src/type42/t42objs.c (T42_GlyphSlot_Load): Change fourth parameter to `FT_UInt'. * src/type42/t42objs.h: Updated. * src/type42/t42parse.h (T42_ParserRec): Change type of `in_memory' to FT_Bool. (T42_Loader): Change type of `num_chars' and `num_glyphs' to FT_UInt. Add `swap_table' element. * src/type42/t42parse.c (T42_KEYWORD_COUNT, T1_ToFixed, T1_ToCoordArray, T1_ToTokenArray): Removed. (T1_ToBytes): New macro. (t42_is_alpha, t42_hexval): Removed. (t42_is_space): Handle `\0'. (t42_parse_encoding): Updated to use new PostScript parser routines from psaux. Handle `/Encoding [ ... ]' also. (T42_Load_Status): New enumeration. (t42_parse_sfnts): Updated to use new PostScript parser routines from psaux. (t42_parse_charstrings): Updated to use new PostScript parser routines from psaux. Handle `/CharStrings << ... >>' also. Don't expect that /.notdef is the first element in dictionary. Copy code from type1 module to handle this. (t42_parse_dict): Updated to use new PostScript parser routines from psaux. Remove code for synthetic fonts (which can't occur in Type 42 fonts). (t42_loader_done): Release `swap_table'. * src/psaux/psobjs.c (skip_string): Increase `cur' properly. * src/type1/t1load.c (parse_charstrings): Make test for `.notdef' faster.
Werner Lemberg 52f911a1 2003-10-07T05:49:41 Heavy modification of the PS parser to handle comments and strings correctly. This doesn't slow down the loading of PS fonts significantly since charstrings aren't affected. * include/freetype/config/ftstdlib.h (ft_xdigit): Renamed to... (ft_isxdigit): This. Updated all callers. (ft_isdigit): New alias to `isdigit'. * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): Renamed `skip_alpha' to `skip_PS_token'. Add parameter to `to_bytes' and change some argument types. * src/psaux/psauxmod.c (ps_parser_funcs): Updated. * src/psaux/psobjs.c (ft_char_table): New array to map character codes (ASCII and EBCDIC) of digits to numbers. (OP): New auxiliary macro holding either `>=' or `<' depending on the character encoding. (skip_comment): New function. (skip_spaces): Use it. (skip_alpha): Removed. (skip_literal_string, skip_string): New functions. (ps_parser_skip_PS_token): New function. This is a better replacement of... (ps_parser_skip_alpha): Removed. (ps_parser_to_token, ps+parser_to_token_array): Updated. (T1Radix): Rewritten, using `ft_char_table'. (t1_toint): Renamed to... (ps_toint): This. Update all callers. Use `ft_char_table'. (ps_tobytes): Add parameter to handle delimiters and change some argument types. Use `ft_char_table'. (t1_tofixed): Renamed to... (ps_tofixed): This. Update all callers. Use `ft_char_table'. (t1_tocoordarray): Renamed and updated to... (ps_tocoordarray): This. Update all callers. (t1_tofixedarray): Renamed and updated to... (ps_tofixedarray): This. Update all callers. (t1_tobool): Renamed to... (ps_tobool): This. Update all callers. (ps_parser_load_field): Updated. (ps_parser_load_field_table): Use `T1_MAX_TABLE_ELEMENTS' everywhere. (ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_coord_array, ps_parser_to_fixed_array): Skip spaces. Updated. (ps_parser_to_bytes): Add parameter to handle delimiters and change some argument types. Updated. * src/psaux/psobjs.h: Updated. * src/cid/cidload.c (cid_parse_dict): Updated. * src/cid/cidparse.c (cid_parser_new): Check whether the `StartData' token was really found. * src/cid/cidparse.h (cid_parser_skip_alpha): Updated and renamed to... (cid_parser_skip_PS_token): This. * src/type1/t1parse.h (T1_ParserRec): Use `FT_Bool' for boolean fields. (T1_Skip_Alpha): Replaced with... (T1_Skip_PS_Token): This new macro. * src/type1/t1parse.c (hexa_value): Removed. (T1_Get_Private_Dict): Use `ft_isxdigit' and `psaux->ps_parser_funcs_to_bytes' for handling ASCII hexadecimal encoding. After decrypting, replace the four random bytes at the beginning with whitespace. * src/type1/t1load.c (t1_allocate_blend): Use proper error values. (parser_blend_design_positions, parse_blend_design_map, parse_weight_vector): Updated. (is_space): Handle `\f' also. (is_name_char): Removed. (read_binary_data): Updated. (parse_encoding): Use `ft_isdigit'. Updated. (parse_subrs): Updated. (TABLE_EXTEND): New macro. (parse_charstrings): Updated. Provide a workaround for buggy fonts which have more entries in the /CharStrings dictionary then expected; the function now adds some slots and skips entries which still exceed the new limit. (parse_dict): Updated. Terminate on the token `closefile'. * src/type42/t42parse.c (T1_Skip_Alpha): Replaced with... (T1_Skip_PS_Token): This new macro. Updated all callers. (t42_parse_encoding): Use `ft_isdigit'. * src/base/ftmm.c (ft_face_get_mm_service): Return FT_Err_OK if success.