src/psaux


Log

Author Commit Date CI Message
Werner Lemberg 272e3cd0 2015-02-18T11:38:46 [psaux, type1] Fix minor AFM issues. * include/internal/t1types.h (AFM_KernPairRec): Make indices unsigned. Update users. (AFM_FontInfoRec): Make element counters unsigned. Update users. * src/psaux/afmparse.h (AFM_ValueRec): Add union member for unsigned int. * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs): Reject negative values for number of kerning elements. * src/type1/t1afm.c, src/tools/test_afm.c: Updated.
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 36d03c9f 2015-01-12T11:26:30 Fix Savannah bug #43976. Assure that FreeType's internal include directories are found before `CPPFLAGS' (which might be set by the user in the environment), and `CPPFLAGS' before `CFLAGS'. * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'. (FT_COMPILE): Make this a special variable for compiling only the files handled in `freetype.mk'. (.c.$O): Removed, unused. * src/*/rules.mk (*_COMPILE): Fix order of include directories.
Werner Lemberg 0098d550 2014-12-07T11:03:57 Uppercase all hex digits for orthogonality.
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.
Jarkko Pöyry 96341dc3 2014-11-24T09:53:07 [cff, pfr, psaux, winfonts] Fix Savannah bug #43676. Don't cast cmap init function pointers to an incompatible type. Without this patch, the number of parameters between declaration and the real signature differs. Calling such a function results in undefined behavior. ISO/IEC 9899:TC3 (Committee Draft September 7, 2007) 6.5.2.2 Function calls 9 If the function is defined with a type that is not compatible with the type (of the expression) pointed to by the expression that denotes the called function, the behavior is undefined. On certain platforms (c -> js with emscripten) this causes termination of execution or invalid calls because in the emscripten implementation, function pointers of different types are stored in different pointer arrays. Incorrect pointer type here results in indexing of an incorrect array. * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init), src/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c t1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init, t1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix signature.
Alexei Podtelezhnikov bc12d9e9 2014-09-08T21:27:43 Fix Savannah bug #43153. * src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against overflow in `divider'.
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 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 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 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 8e82a961 2012-10-21T11:02:50 [psaux] Improve parsing of invalid numbers. * src/psaux/psconv.c (PS_Conv_Strtol): Always parse complete number, even in case of overflow. (PS_Conv_ToInt): Only increase cursor if parsing was successful. (PS_Conv_ToFixed): Ditto. Trace underflow and data error.
Werner Lemberg eaf0afb4 2012-10-20T11:27:25 [psaux] Fix some value overflows and improve tracing. * src/psaux/psconv.c: Include FT_INTERNAL_DEBUG_H. (FT_COMPONENT): Define. (PS_Conv_Strtol): Return FT_Long. Handle bad data and overflow. Emit some tracing messages in case of error. (PS_Conv_ToInt): Return FT_Long. (PS_Conv_ToFixed): Updated. * src/psaux/psconv.h: Updated. * include/freetype/internal/fttrace.h: Add `psconv'.
Werner Lemberg 0708b23e 2012-10-17T21:38:19 [psaux] Fix some value overflows. * src/psaux/psconv.c (PS_Conv_ToFixed): Implement it.
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.
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 ceed93e3 2012-03-03T07:03:08 [psaux] Fix handling of track kerning. * src/psaux/afmparse.c (afm_parse_track_kern): Don't inverse sign for `min_kern'. It is indeed quite common that track kerning *increases* spacing for very small sizes.
Werner Lemberg 292144b4 2012-03-01T14:54:47 [psaux] Fix Savannah bug #35657. If in function `skip_spaces' the routine `skip_comment' comes to the end of buffer, `cur' is still increased by one, so we need to check for `p >= limit' and not `p == limit'. * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed, PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking.
Werner Lemberg 22fff253 2012-02-26T08:47:20 Whitespace.
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 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/.
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.
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.
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 c8f5b98b 2010-07-12T21:13:22 Remove C++ warnings. */*: Initialize pointers where necessary to make g++ happy.
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.
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 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.
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.
John Tytgat 03e8b2f7 2009-09-01T08:10:24 Fix custom cmap for empty Type 1 font (Savannah bug #27294). * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update comment to reflect revised code_last meaning. * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c (T42_Open_Face): Assign max_char as highest character code + 1 and use this for T1_EncodingRecRec_::code_last. * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised T1_EncodingRecRec_::code_last meaning.
suzuki toshiya e6d0c1fb 2009-08-01T00:37:58 psaux: Fix a few casts to FT_Int32 value.
suzuki toshiya 259568cf 2009-08-01T00:32:13 psaux: Handle the string length by FT_Offset variables.
suzuki toshiya 3f0f2e46 2009-08-01T00:32:09 XXX_cmap_encoding_char_next() return FT_UInt32 values.
suzuki toshiya d3ed6d1b 2009-08-01T00:30:24 psaux: Prevent invalid arguments to afm_parser_read_vals().
suzuki toshiya d200982d 2009-08-01T00:30:17 psaux: Use size_t variable to pass the buffer size.
suzuki toshiya d1ee3785 2009-08-01T00:30:16 type1: Use size_t variable to pass the string length.
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.
Oran Agra 1dcd0f23 2009-04-05T18:25:14 Add #error to modules and files that do not support PIC yet. When FT_CONFIG_OPTION_PIC is defined the following files will create #error: * src/bdf/bdfdrivr.h * src/cache/ftcmanag.c * src/cid/cidriver.h * src/gxvalid/gxvmod.h * src/gzip/ftgzip.c * src/lzw/ftlzw.c * src/otvalid/otvmod.h * src/pcf/pcfdrivr.h * src/pfr/pfrdrivr.h * src/psaux/psauxmod.h * src/type1/t1driver.h * src/type42/t42drivr.h * src/winfonts/winfnt.h
Werner Lemberg 86e041b5 2009-03-21T08:51:44 Remove redundant header inclusions. This covers many Ghostscript Coverity issues. * src/*: Do it.
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 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 ce33a312 2008-12-21T10:29:30 FT_USE_MODULE declares things as: extern const FT_Module_Class (or similar for C++). However, the actual types of the variables being declared are often different, e.g., FT_Driver_ClassRec or FT_Renderer_Class. (Some are, indeed, FT_Module_Class.) This works with most C compilers (since those structs begin with an FT_Module_Class struct), but technically it's undefined behavior. To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7 paragraph 2: All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined. (And they are not compatible types.) Most C compilers don't reject (or even detect!) code which has this issue, but the GCC LTO development branch compiler does. (It outputs the types of the objects while generating .o files, along with a bunch of other information, then compares them when doing the final link-time code generation pass.) Patch from Savannah bug #25133. * src/base/ftinit.c (FT_USE_MODULE): Include variable type. * builds/amiga/include/freetype/config/ftmodule.h, include/freetype/config/ftmodule.h, */module.mk: Updated to declare pass correct types to FT_USE_MODULE.
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 a4cb0d95 2008-08-23T19:54:06 * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c (afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug #24119.
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 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 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 048b7563 2008-04-13T05:55:36 * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if integer part is zero.
Werner Lemberg 9a966b7d 2007-10-15T17:21:32 Add support for cmap type 14. * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_CMAP_FORMAT_14): New macro. * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc, FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc, FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New support function prototypes. (FT_CMap_ClassRec): Add them. Update all users. * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New macro. * include/freetype/freetype.h (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API functions. * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary function. (FT_Set_Charmap): Disallow cmaps of type 14. (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API functions. * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros. (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info, tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant, tt_cmap14_char_var_index, tt_cmap14_char_var_isdefault, tt_cmap14_variants, tt_cmap14_char_variants, tt_cmap14_def_char_count, tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and structures for cmap 14 support. (tt_cmap_classes): Register tt_cmap14_class_rec. (tt_face_build_cmaps): One more error message. * docs/CHANGES: Mention cmap 14 support.
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 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 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 607dec79 2007-05-15T06:49:37 * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused variable. * src/autofit/afloader.c (af_loader_load_g): Ditto. * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'. (open_face_from_buffer): Initialize `stream'. (FT_Request_Metrics): Remove unused variable. Remove redundant `break' statements. (FT_Get_Track_Kerning): Remove unused variable. * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs, afm_parse_kern_data): Remove redundant `break' statements. (afm_parser_parse): Ditto. Don't use uninitialized variables. * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long. Use `|' operator instead of `^' to set it. Update all users. * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'. * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant comparison. (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'. (TT_Load_Glyph): Remove unused variable.
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 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 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 4836f955 2006-06-06T12:54:08 formatting
David Turner 457b4a81 2006-06-06T08:14:14 * include/freetype/internal/services/svpscmap.h, src/cff/cffcmap.c, src/psaux/t1cmap.c, src/psnames/psmodule.c: Fix for the memory leak described in bug #16759. We change 'ps_unicodes_init' so that it also takes a 'free_glyph_name' callback to release the glyph names returned by 'get_glyph_name'
Werner Lemberg 545c4e56 2006-05-17T22:55:04 * src/truetype/ttgload.c (TT_Load_Composite_Glyph) [FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again. Formatting, documentation fixes.
David Turner 281679de 2006-05-17T13:34:21 * include/freetype/internal/tttypes.h, src/autofit/afangles.c, src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c, src/autofit/aftypes.h, src/base/ftcalc.c, src/base/ftoutln.c, src/gzip/ftgzip.c, src/psaux/psconv.c, src/truetype/ttgload.c, src/type1/t1gload.c: this is a major patch used to drastically improve the performance of loading glyphs. This both speeds up loading the glypn vector themselves and the auto-fitter. note that we've started using inline assembler with GCC to implement FT_MulFix, given that this function is so damn important for the engine's performance. the resulting speed-up is about 25%.
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>.