src/psaux/t1decode.c


Log

Author Commit Date CI Message
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Werner Lemberg a6adb256 2020-12-02T14:15:07 * 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).
Priyesh Kumar 6d9e6b21 2020-08-28T09:56:38 * src/*: Fix `-Wformat` warnings.
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 2eb8f886 2020-07-06T09:21:03 [psaux] Improve `t1_decoder_parse_metrics' (#58646). * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy corresponding code from old engine's `t1_decoder_parse_charstrings' function to handle `op_callsubr' and `op_return'.
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 6e49dff0 2020-02-21T20:57:52 [psaux] Make `t1_decoder_parse_metrics' handle `op_div' (#57519). * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy corresponding code from old engine's `t1_decoder_parse_charstrings' function.
Werner Lemberg e5038be7 2020-01-19T17:05:19 Update all copyright notices.
Werner Lemberg 05439f5c 2019-07-04T14:28:04 [psaux] (2/2) Handle fonts that use SEAC for ligatures (#56580). The same as previous commit but for the old engine. * src/psaux/t1decode.c (t1operator_seac): Implement it.
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 76a52465 2018-09-03T09:08:47 */*: s/PSNames/psnames/. Only tracing messages are affected.
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 d277bfc9 2018-07-27T09:15:43 [psaux, type1]: More tracing improvements. * src/psaux/psintrp.c (cf2_interpT2CharString): Trace skipped outline commands. * src/psaux/t1decode.c (t1_decoder_parse_charstring): Fix missing case. (t1_decoder_parse_metrics): Make tracing output more compact. * src/type1/t1gload.c (T1_Compute_Max_Advance): Be less verbose. (T1_Get_Advances): Add tracing.
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.
Nikhil Ramakrishnan 78d85b9c 2018-06-04T18:42:29 Restore missing comment lines and other minor fixes
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.
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.
Ewald Hew 78df3c27 2017-10-12T18:13:08 Extract width parsing from Type 1 parser. Duplicate the fast advance width calculations from the old parser. This is to facilitate adding options for compiling out the old parser. * src/psaux/t1decode.{c,h} (t1_decoder_parse_metrics): New function. * include/freetype/internal/psaux.h (T1_Decoder_Funcs): New entry `parse_metrics'. * src/psaux/psauxmod.c: Set the new entry. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c (cid_load_glyph): Separate conditional for selecting engine.
Werner Lemberg 179caf5a 2017-10-01T01:39:27 [psaux] Formatting, minor fixes, whitespace, copyright notices.
Ewald Hew d813b5da 2017-09-25T08:04:09 Extend Adobe interpreter (seac). This concludes the changes needed to add Type 1 support. * src/psaux/psintrp.c: Update includes. (cf2_interpT2CharString) <cf2_escSEAC>: Implement this similarly to implied seac for CFF. * src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode_ps): New function to look up the glyph index. * src/psaux/psft.c (cf2_getT1SeacComponent, cf2_freeT1SeacComponent): New functions to get the charstrings for seac components. * src/psaux/t1decode.h, src/psaux/psft.h: Update declarations.
Ewald Hew cb3f4c61 2017-09-25T06:44:51 Add missing objects for Type 1 (1/2). Move `CF2_Font' instance to `PS_Decoder'. This is the context for the interpreter and since it is currently stored in `CFF_Font', is unavailable in Type 1 mode. * include/freetype/internal/psaux.h (T1_Decoder, PS_Decoder): New `cf2_instance' field. * src/psaux/psdecode.c (ps_decoder_init): Copy `cf2_instance' to `PS_Decoder'. * src/psaux/t1decode.c (t1_decoder_done): Add finalization code. * src/psaux/psft.c (cf2_decoder_parse_charstrings): Update accesses.
Werner Lemberg dcd8de27 2017-06-09T11:21:58 */*: Remove `OVERFLOW_' prefix. This increases readability.
Werner Lemberg 4a1f1a6d 2017-06-01T13:15:54 [psaux] 32bit integer overflow tun-time errors (#46149). * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Use OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG where appropriate.
Werner Lemberg f958c48e 2017-03-24T09:15:10 [psaux] Better protect `flex' handling. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=935 * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <callothersubr>: Since there is not a single flex operator but a series of subroutine calls, malformed fonts can call arbitrary other operators after the start of a flex, possibly adding points. For this reason we have to check the available number of points before inserting a point.
Werner Lemberg 563ae780 2017-01-04T20:16:34 Update copyright year.
Werner Lemberg 248eaa4f 2017-01-03T00:27:07 Various fixes for clang's undefined behaviour sanitizer. * src/cff/cffload.c (FT_fdot14ToFixed): Fix casting. (cff_blend_doBlend): Don't left-shift negative numbers. Handle 5-byte numbers byte by byte to avoid alignment issues. * src/cff/cffparse.c (cff_parse): Handle 5-byte numbers byte by byte to avoid alignment issues. * src/cid/cidload (cid_read_subrs): Do nothing if we don't have any subrs. * src/psaux/t1decode.c (t1_decode_parse_charstring): Fix tracing. * src/tools/glnames.py (main): Put `DEFINE_PSTABLES' guard around definition of `ft_get_adobe_glyph_index'. * src/psnames/pstables.h: Regenerated. * src/psnames/psmodule.c: Inlude `pstables.h' twice to get both declaration and definition. * src/truetype/ttgxvar.c (FT_fdot14ToFixed, FT_intToFixed): Fix casting.
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 5d664b6d 2016-12-17T20:47:42 Use FT_SET_ERROR where useful. Other minor code formatting.
Werner Lemberg 9c54d124 2016-10-11T08:57:55 [psaux] Fix handling of invalid flex subrs. Problem reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52 * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Set `flex_state' after error checking.
Werner Lemberg 45cad2e5 2016-09-28T19:10:52 More FT_ZERO usage. * src/gxvalid/gxvcommn.c (gxv_ClassTable_validate): s/ft_memset/FT_MEM_ZERO/. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): s/ft_memset/FT_ARRAY_ZERO/. * src/raster/ftraster.c (FT_ZERO): Define. (ft_black_new): Use it. * src/raster/ftrend1.c (ft_raster1_get_cbox): s/FT_MEM_ZERO/FT_ZERO/. * src/smooth/ftgrays.c (FT_ZERO): Define. (gray_raster_new): Use it. * src/smooth/ftsmooth.c (ft_smooth_get_cbox): s/FT_MEM_ZERO/FT_ZERO/.
Werner Lemberg 2ecf89b4 2016-09-28T19:06:21 */*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg bd4b8976 2015-12-20T19:36:04 [type1, psaux] Handle large values of num_subrs correctly (#46692). We now use a hash to map from subr indices to array elements holding the subroutines, if necessary. * include/freetype/internal/t1types.h: Include FT_INTERNAL_HASH_H. (T1_FontRec): Add `subrs_hash' field. * include/freetype/internal/psaux.h: Include FT_INTERNAL_HASH_H. (T1_DecoderRec): Add `subrs_hash' field. * src/type1/t1load.h (T1_LoaderRec): Add `subrs_hash' field. * src/type1/t1driver.c: Include FT_INTERNAL_HASH_H. (t1_ps_get_font_value) [PS_DICT_SUBR]: Look up hash if necessary. * src/type1/t1load.c: Include FT_INTERNAL_HASH_H. (parse_subrs): Use hash for subr indices that exceed the allocated number of subr slots. (t1_init_loader): Remove unnecessary code. (t1_done_loader, T1_Open_Face): Updated. * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances, T1_Load_Glyph): Updated. * src/type1/t1objs.c (T1_Face_Done): Updated. * src/psaux/t1decode.c: Include FT_INTERNAL_HASH_H. (t1_decoder_parse_charstrings) [op_callsubr]: Look up hash if necessary. * src/cid/cidgload.c (cid_load_glyph): Updated.
Werner Lemberg 24cee3a8 2015-10-19T23:00:28 [psaux] Fix tracing of negative numbers. Due to incorrect casting negative numbers were shown as very large (positive) integers on 64bit systems. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_none>: Use division instead of shift.
Werner Lemberg 8edfcbed 2015-10-17T08:11:16 [psaux] Fix heap buffer overflow (#46221). * src/psaux/t1decode.c (t1_decoder_parse_charstring) <operator 12>: Fix limit check.
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 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 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 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 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 6b440425 2012-07-18T10:39:18 Fix Savannah bug #36833. * src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid operator if we want metrics only.
Werner Lemberg 22fff253 2012-02-26T08:47:20 Whitespace.
suzuki toshiya 1749d8bc 2012-01-17T02:00:24 Remove trailing spaces.
Werner Lemberg c52f44d4 2011-11-30T10:46:53 Whitespace.
Werner Lemberg 9c98fbf6 2011-10-01T09:25:55 Handle some border cases. * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro. * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid value of `target->rows'. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for flex start. * src/raster/ftrend1.c (ft_raster1_render): Check `width' and `height'. * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against invalid values in `localpoints' array.
Dirk Müller b03c4a0a 2011-07-22T05:24:11 [psaux, type1] Fix null pointer dereferences. Found with font fuzzying. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check `decoder->buildchar'. * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'.
Matthias Drochner 143799d4 2011-07-14T07:35:51 [psaux] Fix potential sign extension problems. When shifting right a signed value, it is not defined by the C standard whether one gets a sign extension or not. Use a macro to do an explicit cast from a signed short (assuming that this is 16bit) to an int. * src/psaux/t1decode.c (Fix2Int): New macro. Use it where appropriate.
Werner Lemberg 60f83713 2011-07-14T07:34:12 * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Better handling of subroutine index 0. From Matthias Drochner <M.Drochner@fz-juelich.de>.
Werner Lemberg 403559b8 2011-07-14T07:21:11 Sort case in switch statement numerically.
Алексей Подтележников dc33b4a1 2011-07-10T07:08:51 [psaux] Optimize previous commit. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Move error check down to avoid testing twice for good cases.
Werner Lemberg c46b1e24 2011-07-08T13:46:42 [psaux] Add better argument check for `callothersubr'. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Reject negative arguments.
John Tytgat ed7d1a59 2010-11-23T19:30:38 * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand start_point, check_points, add_point, add_point1, close_contour macros. Remove add_contour macro. Return error code from t1_builder_start_point and t1_builder_check_points when there was one (instead of returning 0).
Werner Lemberg 30b8480b 2010-05-11T00:06:02 Whitespace.
Ken Sharp 88169b10 2010-05-11T00:03:33 Fix Savannah bug #29846. Previously we discovered fonts which used `setcurrentpoint' to set the initial point of a contour to 0,0. This caused FreeType to raise an error, because the `setcurrentpoint' operator is only supposed to be used with the results from an OtherSubr subroutine. This was fixed by simply ignoring the error and carrying on. Now we have found a font which uses setcurrentpoint to actually establish a non-zero point for a contour during the course of a glyph program. FWIW, these files may be produced by an application called `Intaglio' on the Mac, when converting TrueType fonts to Type 1. The fix allows the new invalid behaviour, the old invalid behaviour and real proper usage of the operator to work the same way as Adobe interpreters apparently do. (t1_decoder_parse_charstrings): Make `setcurrentpoint' use the top two elements of the stack to establish unconditionally the current x and y coordinates. Make the `flex' subroutine handling (OtherSubr 0) put the current x,y coordinates onto the stack, instead of two dummy uninitialised values.
Ken Sharp 8ea31415 2010-01-08T18:13:02 Fix Savannah bug #28521. Issue #28226 involved a work-around for a font which used the `setcurrentpoint' operator in an invalid way; this operator is only supposed to be used with the result of OtherSubrs, and the font used it directly. The supplied patch removed the block of code which checked this usage entirely. This turns out to be a Bad Thing. If `setcurrentpoint' is being used correctly it should reset the flex flag in the decoder. If we don't do this then the flag never gets reset and we omit any further contours from the glyph (at least until we close the path or similar). * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_setcurrentpoint>: Handle `flex_state' correctly.
Werner Lemberg fe6da50d 2010-01-05T10:10:15 Thinkos.
Ken Sharp dbe56223 2010-01-05T09:43:01 Make Type 1 `seac' operator work with incremental interface. * src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names' if incremental interface is used.
Ken Sharp ce412593 2009-12-14T22:32:32 Ignore invalid `setcurrentpoint' operations in Type 1 fonts. This fixes Savannah bug #28226. At least two wild PostScript files of unknown provenance contain Type 1 fonts, apparently converted from TrueType fonts in earlier PDF versions of the files, which use the `setcurrentpoint' operator inappropriately. FreeType currently throws an error in this case, but Ghostscript and Adobe Distiller both accept the fonts and ignore the problem. This commit #ifdefs out the check so PostScript interpreters using FreeType can render these files. The specification says `setcurrentpoint' should only be used to set the point after a `Subr' call, but these fonts use it to set the initial point to (0,0). Unnecessarily so, as they correctly use an `hsbw' operation which implicitly sets the initial point.
suzuki toshiya f2647dda 2009-09-26T00:48:37 [cache, psaux, type1] Fix for multi build.
suzuki toshiya 0729bc9f 2009-09-10T16:09:55 [Win64] Improve the computation of random seed from stack address.
suzuki toshiya e6d0c1fb 2009-08-01T00:37:58 psaux: Fix a few casts to FT_Int32 value.
Werner Lemberg 24370d67 2009-06-28T02:11:51 Uff, another thinko.
Werner Lemberg e7389a44 2009-06-28T01:25:55 [psaux, cff] Protect against nested `seac' calls. * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h (CFF_Decoder): Add `seac' boolean variable. * src/cff/cffgload.c (cff_operator_seac, cff_decoder_parse_charstrings), src/psaux/t1decode.c (t1operator_seac, t1_decoder_parse_charstrings): Use it.
Werner Lemberg 6bb34880 2009-06-28T00:43:37 Thinko. * src/psaux/t1decode.c (t1operator_seac) [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental interface.
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 e15d9c52 2009-06-25T21:31:53 Formatting etc.
Werner Lemberg 1e8bf583 2009-06-23T15:48:52 Thinko.
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 41821f8a 2009-06-20T09:31:19 [psaux] Check large integers while parsing charstrings. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large integers must be followed by a `div' operator.
Werner Lemberg 86fa2ebc 2009-06-19T14:56:26 Improve debug messages for Type1 charstrings. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines after instructions. Prettify output.
Ralph Giles 04a7858c 2009-04-30T20:32:31 Make `seac' operator work correctly with incremental interface. SEAC (Single Encoding Accented Characters) are composed of (basically) two indices specifying two other glyphs, and a movement to position the accent properly with respect to the main glyph. To make it work with the incremental interface we now demand that the caller handles the encoding by itself.
Werner Lemberg e85baf4f 2009-01-12T20:01:10 Fix stdlib dependencies. Problem reported by Mickey Gabel <mickey@monfort.co.il>. * include/freetype/config/ftstdlib.h (ft_exit): Removed. Unused. * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c: s/memcpy/ft_memcpy/. * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/.
Werner Lemberg bcc750e5 2008-05-16T04:50:00 * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_closepath>: `closepath' without a path is a no-op, not an error (cf. the PS reference manual). Reported by Martin McBride.
Werner Lemberg 33db39e2 2007-06-08T06:30:29 * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28. Fonts without a cmap must be handled correctly by FreeType (anything else would be a bug). * src/psaux/t1decode.c (t1_decoder_parse_charstrings) [FT_DEBUG_LEVEL_TRACE]: Improve tracing message.
Werner Lemberg a4d6a1c8 2006-07-19T09:54:56 Move creation of field `buildchar' of T1_DecoderRec out of `t1_decoder_init' and let the caller of `t1_decoder_init' take care of it. Call the finisher for T1_Decoder in `cid_face_compute_max_advance' and `T1_Compute_Max_Advance'. * freetype2/include/freetype/internal/psaux.h (T1_DecoderRec): Remove field `face', add `len_buildchar'. * freetype2/include/freetype/internal/t1types.h (T1_FaceRec): Add field `buildchar'. * freetype2/src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher for T1_Decoder. (cid_slot_load_glyph): Do not ignore failure when initializing the T1_Decoder. * freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated. (t1_decoder_init): Remove initialization of fields `buildchar' and `len_buildchar'. (t1_decoder_done): Remove deallocation of field `buildchar'. * freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize T1_Decoder's `buildchar' and `len_buildchar'; call finisher for T1_Decoder. (T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and `len_buildchar'; make sure to call finisher for T1_Decoder even in case of error. * freetype2/src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar' of T1_FaceRec. * freetype2/src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of T1_FaceRec.
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 24703f8b 2006-06-26T19:12:51 * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15. (t1_decoder_parse_charstrings): Operator with opcode 15 pops its two arguments. Handle the case where the pops of an othersubr may be part of a subroutine. Handle unknown othersubrs gracefully: count their operands and let the following pop operators push the operands as the results onto the Type1 stack. Improve handling of setcurrentpoint opcode.
Werner Lemberg c9114b99 2005-02-10T08:18:27 * builds/unix/freetype-config.in: Add new flag `--ftversion' to return the FreeType version. Suggested by George Williams <gww@silcom.com>. * docs/CHANGES: Updated. * src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case of error. Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can happen in empty glyphs. Reported by Ian Brown <ian.brown@printsoft.de>.
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 5972e9ab 2004-02-01T00:49:56 * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of accent offset. Update code similarly to the seac support for Type 1 fonts. (cff_decoder_parse_charstrings) <cff_op_endchar>: Fix magnitude of accent offset. Don't hint glyphs twice if seac is emulated. <cff_op_flex>: Assign correct point tags. * docs/CHANGES: Updated. * src/type1/t1parse.c (T1_Get_Private_Dict): Use FT_MEM_MOVE, not FT_MEM_COPY, for copying the private dict. * src/type1/t1load.c (parse_subrs): Assign number of subrs only in first run. (parse_charstrings): Parse /CharStrings in second run without assigning values. (parse_dict): Skip all /CharStrings arrays but the first. We need this for non-standard fonts like `Optima' which have different outlines depending on the resolution. Note that there is no guarantee that we get fitting /Subrs and /CharStrings arrays; this can only be done by a real PS interpreter.
David Turner 7760595f 2003-10-29T21:43:52 * include/freetype/internal/bdftypes.h: removed obsolete header * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h, src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h, include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from 'include/freetype/internal' to 'src/cff' since no other modules needs to known about these types * include/freetype/internal/t42types.h, include/freetype/internal/internal.h, src/type42/t42objs.h, src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from 'include/freetype/internal' to 'src/type42' since no other modules needs to known about these types * src/gzip/infblock.c: removing compiler warning * include/freetype/internal/services/svpsinfo.h, include/freetype/internal/ftserv.h, src/cff/cffdrivr.c, src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c, src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined in "svpsinfo.h", removing some sad hacks.
Werner Lemberg ed3a7d7b 2003-10-07T20:06:35 * src/type1/t1load.c (parse_dict): Handle synthetic fonts properly. (parse_charstrings): Copy correct number of characters into `name_table'.
David Turner b72d8a85 2003-09-29T20:33:37 * include/freetype/internal/services/svpsname.h (added), include/freetype/internal/psnames.h (removed), include/freetype/internal/internal.h (FT_SERVICE_POSTSCRIPT_NAMES): added new service to handle glyph name dictionaries, replacing the old internal header named "psnames.h" by "services/svpsname.h" note that this is different from "services/svpostnm.h" which only handles the retrieval of Postscript font name for a given face. (should we merge these two services into a single header ??) * include/freetype/internal/ftserv.h: adding FT_FACE_FIND_GLOBAL_SERVICE (used to lookup a service globally, instead of only within the current module) * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: adding the new base function ft_module_get_service
Werner Lemberg 73861976 2003-06-05T04:31:05 * include/freetype/internal/ftdriver.h, include/freetype/internal/ftobjs.h, include/freetype/internal/psaux.h, src/cid/cidgload.c, src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h, src/pshinter/pshrec.c, src/pshinter/pshalgo.c, src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c, src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c, src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c, src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c, src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h: Many casts and slight argument type changes to make it work with a 16bit compiler.
Werner Lemberg 8b884660 2003-06-03T11:51:43 * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a wrapper for ah_hint_edges. (ah_hint_edges): Renamed to... (ah_hinter_hint_edges): This. * src/base/ftobjs.c (FT_Set_Hint_Flags): Removed. Unused. * include/freetype/internal/ftobjs.h (FT_Face_InternalRec), include/freetype/internal/psaux.h (T1_DecoderRec), src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field. Unused. * src/cff/cffgload.c (cff_builder_init): Updated. (cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply with decoder->hint_mode instead of builder->hint_flags. * src/psaux/t1decode.c (t1_decoder_init): Updated. * src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/. * src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which increased root->height by 15% if the line gap was zero. There exist fonts (containing e.g. form drawing characters) which intentionally have a zero line gap value.
Werner Lemberg 68e9f927 2002-09-27T11:09:23 * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names, tt_face_get_ps_name): Replace switch statement with if clauses to make it more portable. * src/cff/cffobjs.c (cff_face_init): Ditto. * include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for `module_size'. * include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for `glyph_size'. * src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to `FT_Render_Mode'. (FT_Render_Glyph_Internal): Change third parameter to `FT_Render_Mode'. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter to `FT_Render_Mode'. * src/raster/ftrend1.c (ft_raster1_render): Change third parameter to `FT_Render_Mode'. * src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd, ft_smooth_render_lcd_v): Ditto. (ft_smooth_render_generic): Change third and fifth parameter to `FT_Render_Mode'. * include/freetype/freetype.h, include/freetype/internal/ftobjs.h, include/freetype/ftglyph.h: Updated. * src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c (PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load), src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c (T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change fourth parameter to `FT_Int32'. * src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters and declare them as unused. * src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'. * src/psnames/psnames.h (PS_Unicode_Value_Func): Change return value to FT_UInt32. * src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table): Updated accordingly. * src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'. (cff_get_glyph_name): Use cast for result of ft_strlen. * src/cff/cffparse.c (cff_parse_real): User cast for assigning `exp'. * src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for some local variables. (cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some switch statements. (cff_font_load): Use cast in call to CFF_Load_FD_Select. * src/cff/cffobjs.c (cff_size_init): Use more casts. (cff_face_init): Use FT_Int32 for `flags'. * src/cff/cffgload.c (cff_operator_seac): Use cast for assigning `adx' and `ady'. (cff_decoder_parse_charstrings): Use FT_ULong for third parameter. Use more casts. * src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'. * src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'. * src/cid/cidgload.c (cid_load_glyph): Add missing cast for `cid_get_offset'. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use cast for `num_points'. (t1_decoder_init): Use cast for assigning `decoder->num_glyphs'. * src/base/ftdebug.c (ft_debug_init): Use FT_Int. * include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use `FT_Int32' for fourth parameter. * src/base/ftobjs.c (open_face): Use cast for calling clazz->init_face. * src/raster/ftraster.c (Set_High_Precision): Use `1' instead of `1L'. (Finalize_Profile_Table, Line_Up, ft_black_init): Use casts. * src/raster/ftrend1.c (ft_raster1_render): Ditto. * src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long constant. * builds/amiga/include/freetype/config/ftmodule.h: Updated.
Werner Lemberg 6b5c669b 2002-09-05T15:10:54 * src/cid/cidobjs.c (CID_Size_Init): Renamed to... (cid_size_init): This. * src/psaux/psobjs.c (T1_Builder_Add_Point1): Renamed to... (t1_builder_add_point1): This. Updated all affected code. * src/pshinter/pshalgo3.c (psh3_hint_align): Fix compiler warnings. * src/type1/t1gload.c (T1_Compute_Max_Advance): Ditto. Formatting, minor doc fixes.
David Turner d1245c0d 2002-08-27T22:34:20 updating sources to support the new FT_LOAD_TARGET_ constants to support target-specific hinting
David Turner b08fe2dc 2002-08-27T20:20:29 * massive re-formatting changes to many, many source files. I don't want to list them all here. The operations performed were all logical transformations of the sources: - trying to convert all enums and constants to CAPITALIZED_STYLE, with #define definitions like #define my_old_constants MY_NEW_CONSTANT - big, big update of the documentation comments * include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c, include/freetype/ftimage.h: adding support for LCD-optimized rendering though the new constants/enums: FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V this is still work in progress, don't expect everything to work correctly though most of the features have been implemented. * adding new FT_LOAD_XXX flags, used to specify both hinting and rendering targets: FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering FT_LOAD_TARGET_MONO :: monochrome bitmaps FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering note that FT_LOAD_TARGET_NORMAL is 0, which means that the default behaviour of the font engine is _unchanged_.
Werner Lemberg b3d5e9cf 2002-07-28T05:05:24 s/ft_memset/FT_MEM_SET/. s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
David Turner 27c322e9 2002-07-08T22:26:11 * include/freetype/freetype.h, src/base/ftobjs.h, freetype/internal/ftobjs.h, freetype/internal/psaux.h, freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h, src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags, and the new FT_Set_Hint_Flags high-level API