src/cff/cffgload.c


Log

Author Commit Date CI Message
Werner Lemberg bffe5fd6 2016-08-28T13:16:37 [cff] Minor comment.
Werner Lemberg 8ed9eaf1 2016-02-15T20:41:58 [cff] Partially handle `load' and `store' ops in old CFF engine. Now all glyphs of MM CFFs like `ITCGaramondMM-It.otf' can be displayed. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_store, cff_op_load>: Partially implement it. * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass the number of Multiple Master axes. Update all callers. (cff_parse_multiple_master): Get number of axes. (cff_parser_run) <opcode 31>: Updated. * src/cff/cffparse.h: Updated. (CFF_ParserRec): Add `num_axes' field. * src/cff/cffload.c: Updated. * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_axes' field.
Werner Lemberg 32950391 2016-02-15T12:54:40 Whitespace.
Werner Lemberg 813aca51 2016-02-14T16:03:15 [cff] Make old CFF engine show MM CFFs (without variations). The new code only displays the first master in the font. * src/cff/cffgload.c (cff_decode_parse_charstrings): Add new parameter to allow function calls from dictionaries also. <cff_op_blend>: Partially implement it. Update all callers. * src/cff/cffgload.h: Updated. * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass the number of Multiple Master designs. Update all callers. (cff_parse_multiple_master): New function to rudimentarily parse operator. (cff_parser_run): Handle `T2' operator. * src/cff/cffparse.h: Updated. (CFF_ParserRec): Add `num_designs' field. * src/cff/cffload.c: Updated. * src/cff/cfftoken.h: Handle `MultipleMaster' operator. * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_designs' field. * src/sfnt/sfobjs.c (sfnt_init_face): Don't handle `fvar' table for MM CFFs.
Werner Lemberg a1460704 2016-02-07T11:42:37 [cff] Minor. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_sqrt>: Remove dead code.
Werner Lemberg 5c8a8cb5 2016-02-06T08:03:03 [cff] Fix some Type 2 operators in old CFF engine. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Fix `eq' operator, add `not' and (unsupported) `blend' operators.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Alexei Podtelezhnikov 4a466865 2015-08-12T23:45:40 [type1,cff,cid] Streamline font matrix application. * src/type1/t1gload.c (T1_Load_Glyph): Directly modify advances only if font matrix is not trivial. * src/cff/cffgload.c (cff_slot_load): Ditto. * sff/cid/cidgload.c (cid_slot_load_glyph): Ditto for advances and the entire outline.
Matthias Clasen b650dfbb 2015-07-26T21:08:34 [cff] Don't use `hmtx' table for LSB (#45520). * src/cff/cffgload.c (cff_slot_load): Use `htmx' table for advance width only. Bug introduced 2015-04-10.
Alexei Podtelezhnikov 792db0b9 2015-04-15T23:20:23 [cff,cid,pfr,sfnt,winfonts] NULL.
Werner Lemberg 5cd21551 2015-04-10T07:01:01 [cff] Update advance width handling to OpenType 1.7. Problem reported by Behdad. * src/cff/cffdrivr.c (cff_get_advances): Handle SFNT case separately. * src/cff/cffgload.c (cff_slot_load): Use advance width and side bearing values from `hmtx' table if present.
Werner Lemberg 8ce30263 2015-03-27T08:33:47 [cff] Trace charstring nesting levels. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLGSUBR, cf2_cmdCALLSUBR, cf2_cmdRETURN>: Implement it. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_callsubr, cff_op_callgsubr, cff_op_return>: Ditto.
Werner Lemberg 633a729d 2015-02-21T07:02:01 [cff] Minor signedness fixes related to last commit. * src/cff/cf2ft.c, src/cff/cf2intrp.c, src/cff/cffgload.c: Apply.
Werner Lemberg c00b05f2 2015-02-20T20:42:55 [cff] Thinkos in bias handling. Only the final result is always positive. Bug introduced three commits earlier. * src/cff/cffgload.c, src/cff/cffgload.h: Apply.
Werner Lemberg 3a8d0537 2015-02-20T08:35:32 [cff] Signedness fixes for basic infrastructure and old engine. * include/internal/pshints.h, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffload.c, src/cff/cffobjs.c, src/cff/cffparse.c, src/pshinter/pshrec.c: Apply.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Werner Lemberg de43ace7 2014-12-02T23:06:04 * include/*: Improve structure of documentation. . Add and update many `<Order>' tags. . Apply various documentation fixes. . Remove details to deprecated (or never implemented) data.
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 b24e8ba2 2014-11-25T08:30:49 [Savannah bug #43682] Add/remove `void' casts to some functions. We use a cast to indicate that we intentionally ignore a function's return value. However, this doesn't apply to API functions where errors can only happen for trivially invalid input. * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder), src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning), src/type1/t1load.c (parse_encoding), src/type42/t42parse.c (t42_parse_encoding): Do it.
Werner Lemberg ffee64af 2013-08-26T12:55:48 Better tracing of loaded glyphs. Previously, the loading of a glyph was traced at level 4, if at all. With this change, all font loading routines emit a tracing message at level 1, making it easier to select tracing output (for example using F2_DEBUG="any:1 afhints:7 aflatin:7"). * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message. * src/cff/cffdrivr.c (cff_glyph_load): Ditto. * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing messages. * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing message. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message. * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. * src/type1/t1gload.c (T1_Load_Glyph): Ditto. * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto. * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
Dave Arnold cb23a628 2013-06-13T07:46:32 [cff] Add code to Adobe's engine to handle ppem > 2000. * src/cff/cffgload.c (cff_slot_load): If we get FT_Err_Glyph_Too_Big, retry unhinted and scale up later on.
Werner Lemberg 2429dc3d 2013-06-03T12:41:58 Add CFF_CONFIG_OPTION_OLD_ENGINE configuration option. This controls whether the old FreeType CFF engine gets compiled into FreeType. It is now disabled by default. * devel/ftoption.h, include/freetype/config/ftoption.h (CFF_CONFIG_OPTION_OLD_ENGINE): New macro. * src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c (CFF_Operator, cff_argument_counts, cff_builder_add_point, cff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load), src/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use CFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code. * docs/CHANGES: Updated.
Werner Lemberg f6aa089f 2013-05-10T07:58:47 */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
Werner Lemberg e6e83627 2013-05-04T18:57:56 Fix clang fixes. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use correct types. * src/cff/cf2intrp.c (cf2_interpT2CharString) <default>: Force unsigned for computations. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto. * src/cff/cffparse.c (cff_parse_integer): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
Werner Lemberg 94152819 2013-05-04T16:40:12 More fixes for clang's `sanitize' feature. * src/base/ftcalc.c (FT_DivFix): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, FT_Vector_Length, FT_Vector_Polarize): Ditto. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. * src/cff/cffload.c (cff_subfont_load): Fix constant. * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, cff_parse_fixed_dynamic): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/cid/cidload.c (cid_get_offset): Ditto. * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
Werner Lemberg afaeeee9 2013-05-04T14:05:24 Fix errors reported by clang's `sanitize' feature. * include/freetype/internal/ftstream.h: Simplify and fix integer extraction macros. (FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32, FT_INT8_I32, FT_INT8_U32): Removed. (FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE, FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for computations and convert to signed as the last step. * src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt, cf2_fracToFixed): Avoid shifts of negative values. (cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed, unused. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR, default>: Use unsigned values for computations and convert to signed as the last step. Use proper types in tracing messages. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned values for computation of operands and convert to signed as the last step. Use proper type in tracing message.
Chris Liddell 9bf75e08 2013-05-02T11:09:15 * src/cff/cffgload.c: Include FT_CFF_DRIVER_H.
Werner Lemberg 06474c3e 2013-04-13T18:53:28 [cff] Add a new Type 2 interpreter and hinter. This work, written by Dave Arnold <darnold@adobe.com> and fully integrated into FreeType by me, is a donation by Adobe in collaboration with Google. It is vastly superior to the old CFF engine, and it will replace it soon. Right now, it is still off by default, and you have to explicitly select it using the new `hinting-engine' property of the cff driver. For convenience, (most of) the new files are committed separately. * include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro. * include/freetype/ftcffdrv.h: New file to access CFF driver properties. * include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error code. * include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints', and `cf2interp'. * src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'. * src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine' and `no_stem_darkening'. * src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'. * src/cff/cff.c: Include new files. * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle `hinting-engine' and `no-stem-darkening' properties (only the Adobe engine listens to them). * src/cff/cffgload.c: Include `cf2ft.h'. (cff_decoder_prepare): Initialize `current_subfont'. (cff_build_add_point): Handle Adobe engine which uses 16.16 coordinates. (cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING separately. Choose rendering engine based on `hinting_engine' property. * src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe engine. * src/cff/cffobjs.c: Include FT_CFF_DRIVER_H. (cff_driver_init): Set default property values. * src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files. * src/cff/cf2*.*: New files, containing the Adobe engine.
Werner Lemberg 831dac88 2013-04-12T21:13:49 [cff] Minor code administration issues. * src/cff/cffgload.c (check_points): Rename to... (cff_check_points): ...this and make it FT_LOCAL. (cff_builder_add_point, cff_builder_add_point1, cff_builder_start_point, cff_builder_close_contour, cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data, cff_free_glyph_data): Make them FT_LOCAL. * src/cff/cffgload.h: Updated.
Werner Lemberg e3c93015 2013-03-14T11:21:17 */*: Use FT_Err_Ok only. This is a purely mechanical conversion.
Werner Lemberg 059bc335 2013-03-14T10:27:35 */*: Use `FT_THROW'. This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
Werner Lemberg d6bc524b 2013-03-11T09:50:53 Always use module related error codes. * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use `FT_ERROR_BASE'. * src/type1/t1load.c (parse_encoding): Use T1_Err_Unknown_File_Format.
Werner Lemberg 2d882540 2013-03-08T21:23:45 [cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also. * src/cff/cffgload.c (cff_slot_load): Implement it.
Alexei Podtelezhnikov b25265c5 2012-02-29T13:45:24 Avoid modulo operators against a power-of-two denominator. * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>, src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE), src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with `&' operator.
suzuki toshiya 1749d8bc 2012-01-17T02:00:24 Remove trailing spaces.
Werner Lemberg 24b77764 2011-12-08T09:51:52 Whitespace.
Daniel Zimmermann 3ad8f355 2011-05-24T06:22:32 Reduce warnings for MS Visual Studio 2010. * src/autofit/afhints.c (af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide return value. * src/cff/cffgload.c (cff_slot_load): Add cast. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper loop variable type.
Werner Lemberg 75df7060 2011-02-01T07:36:27 [cff] Ignore unknown operators in charstrings. Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing message for unknown operators and continue instead of exiting with a syntax error.
Werner Lemberg 396b11b8 2010-12-09T23:16:18 [cff] Allow `hlineto' and `vlineto' without arguments. We simply ignore such instructions. This is invalid, but it doesn't harm; and indeed, there exist such subsetted fonts in PDFs. Reported by Albert Astals Cid <aacid@kde.org>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) [cff_op_hlineto]: Ignore instruction if there aren't any arguments on the stack.
Werner Lemberg 223cb1b5 2010-08-06T06:55:09 [cff] Add comment to clarify current implementation of `pop' operator.
suzuki toshiya d9b3e394 2010-08-05T17:10:32 [cff] Don't use any values in decoder after parsing error. * src/cff/cffgload.c (cff_slot_load): Skip the evaluations of the values in decoder, if cff_decoder_parse_charstrings() returns any error.
Suzuki, Toshiya (鈴木俊哉) 11d65e8a 2010-08-04T14:43:29 [cff] Improve stack overflow test. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack after execution of operations too.
Werner Lemberg 2de6b8a3 2010-07-17T13:39:50 [cff] Final try to fix `hintmask' and `cntrmask' limit check. Problem reported by Tobias Wolf <towolf@gmail.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Sigh. I'm apparently too silly to fix this correctly in less than three tries.
Werner Lemberg 2dc76a46 2010-07-05T06:40:02 [cff] Next try to fix `hintmask' and `cntrmask' limit check. Problem reported by malc <av1474@comtv.ru>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: It is possible that there is just a single byte after the `hintmask' or `cntrmask', e.g., a `return' instruction.
Werner Lemberg ae425e51 2010-06-29T12:31:08 Fix minor tracing issues. * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels.
Werner Lemberg 18b552f6 2010-06-27T15:41:02 [cff] Really fix `hintmask' and `cntrmask' limit check. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Fix thinko and handle tracing also.
Werner Lemberg 4f7851e3 2010-06-27T13:03:54 [cff] Fix memory leak. * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in case of errors.
Werner Lemberg e9f0cdb6 2010-06-27T12:34:19 [cff] Protect against invalid `hintmask' and `cntrmask' operators. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing the bit masks of the `hintmask' and `cntrmask' operators.
Werner Lemberg 3624110c 2010-06-11T23:00:22 [cff]: Improve debugging output. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Implement it.
Werner Lemberg 7d3d2cc4 2010-06-09T09:14:09 Fix Savannah bug #30082. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_callothersubr>: Protect against stack underflow.
Hongbo Ni 236fc8e1 2010-05-18T11:00:39 Apply patch #7196. * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont index is out of range.
Werner Lemberg 03b3da8b 2010-03-02T13:00:55 Improve CFF string (especially glyphname) lookup performance. We do this by avoiding memory allocation and file I/O. This is Savannah patch #7104. * src/cff/cfftypes.h: Include PS cmaps service and FT_INTERNAL_POSTSCRIPT_HINTS_H. (CFF_SubFontRec): Remove `num_local_subrs'. (CFF_FontRec): Add `num_strings', `strings', and `string_pool' fields. Remove `string_index' and `num_global_subrs' fields. Use real types instead of `void' for `pshinter' and `psnames' fields. * src/cff/cffload.c: Don't include PS cmaps service. (cff_index_get_pointers): Add `pool' parameter which allows to insert an extra NUL character for each String INDEX entry. (cff_index_get_name): Make it a local function. (cff_index_get_string): New function. (cff_subfont_load): Updated. (cff_font_load): Initialize `num_strings', `strings', and `string_pool' fields in the `CFF_FontRec' structure. (cff_index_get_sid_string): Use `cff_index_get_string' instead of `cff_index_get_name'. (cff_font_done): Updated. * src/cff/cffload.h: Don't include PS cmaps service. (cff_index_get_string): Added. (cff_index_get_sid_string): Updated. * src/cff/cffobjs.c: Don't include PS cmaps service and FT_INTERNAL_POSTSCRIPT_HINTS_H. (cff_size_get_globals_funcs, cff_slot_init): Updated. (cff_face_init): Follow `cff_index_get_name', `cff_index_get_string', and `cff_index_get_sid_string' changes. * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed. (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'. (cff_cmap_unicode_init): Updated. * src/cff/cffdrivr.c: Don't include PS cmap service. (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS service. (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API `cff_index_get_sid_string' change. (cff_get_name_index): Use `cff_index_get_string' instead of `cff_index_get_name'. * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H. (cff_decoder_init, cff_decoder_prepare): Updated.
Ken Sharp 63e7aac3 2010-02-10T07:13:27 Really fix Savannah bug #28678 (part 2). Since we consider `sbw' for the horizontal direction only, we still have to synthesize vertical metrics if the user wants to use the vertical writing direction. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is set.
Ken Sharp 980b76ea 2010-02-10T07:02:43 Really fix Savannah bug #28678 (part 1). After long discussion, we now consider the character width vector (wx,wy) returned by the `sbw' Type 1 operator as being part of *one* direction only. For example, if you are using the horizontal writing direction, you get the horizontal and vertical components of the advance width for this direction. Note that OpenType and CFF fonts don't have such a vertical component; instead, the GPOS table can be used to generate two-dimensional advance widths (but this isn't handled by FreeType). * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add `advance_v' field to hold the vertical component of the advance value. * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c (cff_slot_load), src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c (cid_load_glyph): Use it.
Ken Sharp f19e46f3 2010-01-27T10:04:50 Fix Savannah bug #28678. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_load_glyph): Handle vertical metrics correctly. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle vertical metrics correctly. (T1_Load_Glyph): Don't synthesize vertical metrics.
Bram Tassyns 8821cc5d 2009-11-04T07:21:15 Add basic support for Type1 charstrings in CFF. * src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle `seac', `sbw', and `setcurrentpoint' opcodes. (cff_compute_bias): Add parameter to indicate the charstring type. Update all callers. (cff_operator_seac): Add parameter for side bearing. (cff_decoder_parse_charstrings): Updated for more Type1 support.
Werner Lemberg 2d15120c 2009-10-19T21:09:13 Fix handling of `get' and `put' CFF instructions. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_get, cff_op_put>: Appendix B of Adobe Technote #5177 limits the number of elements for the `get' and `put' operators to 32. * src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define. (CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'.
Werner Lemberg d90567b1 2009-10-18T10:47:11 Fix handling of `dup' CFF instruction. Problem and solution reported by Ning Dong <flintning@163.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_dup>: Increase `args' by 2, not 1.
suzuki toshiya 0729bc9f 2009-09-10T16:09:55 [Win64] Improve the computation of random seed from stack address.
Bram Tassyns 4694ea2b 2009-09-02T13:06:33 Improve vertical metrics calculation (Savannah bug #27364). The calculation of `vertBearingX' is not defined in the OTF font spec so FreeType does a `best effort' attempt. However, this value is defined in the PDF and PostScript specs, and that algorithm is better than the one FreeType currently uses: FreeType: Use the middle of the bounding box as the X coordinate of the vertical origin. Adobe PDF spec: Use the middle of the horizontal advance vector as the X coordinate of the vertical origin. FreeType's algorithm goes wrong if you have a really small glyph (like the full-width, circle-like dot at the end of the sentence, as used in CJK scripts) with large bearings. With the FreeType algorithm this dot gets centered on the baseline; with the PDF algorithm it gets the correct location (in the top right). Note that this is a serious issue, it's like printing the dot at the end of a Roman sentence at the center of the textline instead of on the baseline like it should. So i believe the PDF spec's algorithm should be used in FreeType as well. The `vertBearingY' value for such small glyphs is also very strange if no `vmtx' information is present, since the height of the bbox is not representable for the height of the glyph visually (the whitespace up to the baseline is part of the glyph). The fix also includes some code for a better estimate of `vertBearingY'. * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX' is now calculated as described by the Adobe PDF Spec. Estimate for `vertBearingY' now works better for small glyphs completely above or below the baseline into account. * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now calculated as described by the Adobe PDF Spec. Vertical metrics information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS was not defined. * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is now calculated as described by the Adobe PDF Spec.
Werner Lemberg d77cd8ce 2009-08-27T00:10:56 Fix rendering of horizontally compressed CFFs. Bug reported by Ivan Nincic <inincic@pdftron.com>. * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of `font_matrix' also. * docs/CHANGES: Updated.
suzuki toshiya 072e5523 2009-08-01T00:30:23 cff: Cast the long variables to 32-bit for LP64 systems.
suzuki toshiya a813cf48 2009-08-01T00:30:15 cff: Fix some data types mismatching with their sources.
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 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 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 541ab5ad 2009-06-20T07:31:44 [cff] Revert last change. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it. Next time, don't confuse Type 2 charstring opcodes with TOP DICT values...
Werner Lemberg f1631f2d 2009-06-19T23:50:37 [cff] Fix handling of reserved byte 0xFF. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte 0xFF is encountered.
Werner Lemberg fbdf1279 2009-04-01T08:03:37 Ignore empty contours in CFF glyphs. Problem reported by Albert Astals Cid <aacid@kde.org>. * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with t1_builder_close_contour.
Werner Lemberg 86e041b5 2009-03-21T08:51:44 Remove redundant header inclusions. This covers many Ghostscript Coverity issues. * src/*: Do it.
Werner Lemberg b66efefd 2009-03-12T08:07:49 Fix some FreeType Coverity issues as reported for Ghostscript. * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize `args.stream' (#3874, #3875). (open_face_PS_from_sfnt_stream): Improve error management (#3786). * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice' (#3870). * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead code (#3790). * src/base/ftrfork.c (raccess_guess_apple_generic): Check error value of `FT_Stream_Skip' (#3784). * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing it (#3872) * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing it (#3871). * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of `pcf_get_metric' (#3789, #3782). (pcf_get_properties): Use FT_STREAM_SKIP (#3783). * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of `acache' (#3797) * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff' (#3796). * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795). * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794). * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom' (#3793). (_bdf_parse_start): Add comment (#3792). * src/raster/ftraster.c (Finalize_Profile_Table): Check `ras.fProfile' (#3791). * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785). * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore seek error (#3781).
Werner Lemberg b17fb11f 2008-10-02T10:17:32 * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This fixes Savannah bug #24430.
Werner Lemberg b4c810e2 2008-09-22T11:28:46 * src/cff/cffgload.c (CFF_Operator, cff_argument_counts, cff_decoder_parse_charstrings): Handle (invalid) `callothersubr' and `pop' instructions.
Werner Lemberg 634df6e3 2008-09-16T07:25:31 * src/cff/cffgload.h, src/cff/cffgload.c (cff_decoder_set_width_only): Eliminate function call.
Werner Lemberg b211651a 2008-09-12T16:27:48 * autogen.sh, builds/unix/configure.raw, include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor beautifying. * include/freetype/ftadvanc.h, include/freetype/ftgasp.h, include/freetype/ftlcdfil.h: Protect against FreeType 1. Some other minor fixes. * devel/ftoption.h: Synchronize with include/freetype/config/ftoption.h. Formatting, documentation improvements.
David Turner 28534d61 2008-09-01T21:35:21 * include/freetype/ftadvanc.h, src/base/ftadvanc.c, include/freetype/config/ftheader.h, include/freetype/freetype.h, src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c, src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c, src/type1/t1gload.h, src/type1/t1gload.c: Add a new header named FT_ADVANCES_H declaring some new APIs to extract the advances of one or more glyphs without necessarily loading their outlines. Also provide 'fast loaders' for the TrueType, Type1 and CFF font drivers (more to come later) * autogen.sh: add checks for minimum version of the 'autotools' stuff.
Werner Lemberg da32d705 2008-08-06T09:09:41 Add one more example to the documentation of FT_Glyph_To_Bitmap.
Werner Lemberg 806f5934 2008-07-30T05:28:37 * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer assume that the first argument on the stack is the bottom-most element. Two reasons: o According to people from Adobe it is missing in the Type 2 specification that pushing of additional, superfluous arguments on the stack is prohibited. o Acroread in general handles fonts differently, namely by popping the number of arguments needed for a particular operand (as a PS interpreter would do). In case of buggy fonts this causes a different interpretation which of the elements on the stack are superfluous and which not. Since there are CFF subfonts (embedded in PDFs) which rely on Acroread's behaviour, FreeType now does the same.
Werner Lemberg bdcfddcd 2008-07-26T21:22:20 * src/cff/cffgload.c (cff_decoder_prepare, cff_decoder_parse_charstrings): Improve debug output.
Werner Lemberg e6e6eade 2008-05-14T23:05:38 Finish fix of scaling bug of CID-keyed CFF subfonts. * include/freetype/internal/ftcalc.h, src/base/ftcalc.c (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New functions. * src/cff/cffobjs.h (CFF_Internal): New struct. It is used to provide global hinting data for both the top-font and all subfonts (with proper scaling). * src/cff/cffobjs.c (cff_make_private_dict): New function, using code from `cff_size_init'. (cff_size_init, cff_size_done, cff_size_select, cff_size_request): Use CFF_Internal and handle subfonts. (cff_face_init): Handle top-dict and subfont matrices correctly; apply some heuristic in case of unlikely matrix concatenation results. This has been discussed with people from Adobe (thanks goes mainly to David Lemon) who confirm that the CFF specs are fuzzy and not correct. * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument. * src/cff/cffgload.c (cff_builder_init): Updated. (cff_decoder_prepare): Handle hints globals for subfonts. Update all callers. (cff_slot_load): Handling scaling of subfonts properly. * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function. (cff_parse_font_matrix): Use it. * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em' FT_ULong. * docs/CHANGES: Document it.
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 bd7e1c3c 2007-12-06T17:17:30 Pass options from one configure script to another as-is (not expanded). This is needed for options like --includedir='${prefix}/include'. * builds/unix/detect.mk, configure: Prevent argument expansion in call to the (real) `configure' script. * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if TT_USE_BYTECODE_INTERPRETER isn't defined. There exist CFFs which contain opcodes for the Type 1 operators `hsbw' and `closepath' which are both invalid in Type 2 charstrings. However, it doesn't harm to support them. * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and `cff_op_closepath.' (cff_argument_counts): Ditto. (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath) and 13 (hsbw) which are invalid in Type 2 charstrings.
Werner Lemberg 5b4d435a 2007-06-20T07:07:55 * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28 change.
Werner Lemberg 95104a4d 2007-06-18T07:33:10 * src/cff/cffgload.c (cff_decoder_prepare): Fix change from 2007-06-06.
Werner Lemberg 470210b7 2007-06-06T10:05:49 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of `font_count'. * src/type1/t1load.c (parse_font_matrix): Check `temp_scale'. * src/cff/cffgload.c (cff_decoder_prepare): Change return type to `FT_Error'. Check `fd_index'. (cff_slot_load): Updated. * src/cff/cffgload.h: Updated.
Werner Lemberg 1053656d 2007-06-05T06:49:50 whitespace
Werner Lemberg 99e0c18e 2007-05-29T07:00:23 Formatting, reformulations.
David Turner c510d5d8 2007-05-28T21:34:04 remove compiler warning (unused variable)
David Turner 552a9562 2007-05-28T15:45:35 optimize CFF glyph loader (avoid apply identity font transform)
Werner Lemberg 4b2e83d5 2007-02-01T07:58:02 A new set of spelling fixes from Alexei. Add some copyright messages.
David Turner a42567bf 2007-01-25T12:23:37 - same CFF loader fix (stricter checking though than Werner's version) - document light auto-hinter improvements
Werner Lemberg f6294399 2007-01-06T07:47:45 formatting, copyright years
David Turner 5dbdb6c3 2007-01-05T13:14:08 * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffgload.c, src/cff/cfftypes.h: formatting + do not load the CFF index offsets into memory, since this wastes a *lot* of heap memory with large Asian CFF fonts. There is no significant performance loss
Werner Lemberg 913a3650 2006-11-19T09:19:17 Because FT_Load_Glyph expects CID values for CID-keyed fonts, the test for a valid glyph index must be deferred to the font drivers. This patch fixes Savannah bug #18301. * src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'. * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c (FNT_Load_Glyph): Check validity of `glyph_index'.
Werner Lemberg 26377008 2006-03-21T18:41:40 * src/cff/cfftypes.h (CFF_CharsetRec): Add `max_cid' member. * src/cff/cffload.c (cff_charset_load): Set `charset->max_cid'. * src/cff/cffgload.c (cff_slot_load): Change type of third parameter to `FT_UInt'. Check range of `glyph_index'. * src/cff/cffgload.h: Updated.
Wu, Chia-I (吳佳一) f5aa47be 2006-02-14T06:40:10 Clean up the SFNT_Interface. Table loading functions are now named after the tables' tags; `hdmx' is TrueType-specific and thus the code is moved to the truetype module; `get_metrics' is moved here from the truetype module so that the code can be shared with the cff module. This pass involves no real changes. That is, the code is moved verbatim mostly. The only exception is the return value of `tt_face_get_metrics'. * include/freetype/internal/sfnt.h, src/sfnt/rules.mk, src/sfnt/sfdriver.c, src/sfnt/sfnt.c, src/sfnt/sfobjs.c, src/sfnt/ttload.c, src/sfnt/ttload.h, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h, src/sfnt/ttsbit0.c: Clean up the SFNT_Interface. * src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Metrics-related tables' loading and parsing code is moved here. Move `tt_face_get_metrics' here from the truetype module. The return value is changed from `void' to `FT_Error'. * include/freetype/internal/fttrace.h: New trace: ttmtx. * src/truetype/ttpload.c, src/truetype/ttpload.h: `hdmx' loading and parsing code is moved here. New function `tt_face_load_prep' splitted from `tt_face_load_fpgm'. `tt_face_load_fpgm' returns `FT_Err_Ok' if `fpgm' doesn't exist. * src/cff/cffgload.c, src/cff/cffobjs.c: Update. * src/truetype/ttgload.c, src/truetype/ttobjs.c: Update.
David Turner 6a681fa8 2006-01-27T12:11:22 * src/autofit/afwarp.c: simple #ifdef to prevent compilation when the warp hinter isn't active (it shouldn't, still experimental) * Jamfile, include/freetype/config/ftmodule.h: removed "gxvalid" and "otvalid" from the list of modules that are linked statically to a given FreeType library. Functionality has been moved to the "ftvalid" CVS module. note also that current Make-based build system still compiles the modules though... * include/freetype/config/ftoption.h: added FT_STRICT_ALIASING, which controls the definitions of the memory management functions to avoid warnings with recent versions of GCC. this macro is only here to be disabled, in case we detect problems with the new scheme. NOTE: disable macro to use the memory debugger. this will be fixed later !!
Wu, Chia-I (吳佳一) ea1e8d3a 2006-01-15T15:01:45 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c: s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/. * docs/CHANGES: Mention that vertical metrics are synthesized for fonts not having this info.
Werner Lemberg 1723dcc2 2006-01-15T07:30:32 Formatting, minor clean-ups.