Allocate and free parser->stack. Allow maxstack to increase the default.
Do validation of maxstack at parse time; make it a CALLBACK.
Defer support for > 256 FDs in cff_font_load().
Ignored operators clear the stack.
Ignore return and endChar in CFF2.
Ignore vsindex and blend in CFF.
Add a nested switch for op2.
First op2 switch handles 4 flex operators for CFF & CFF2 and all reserved
operators common to both.
Second op2 switch handles CFF operators that were removed from CFF2.
Add cf2_cmdVSINDEX charstring operator.
Add cff_parse_vsindex as a callback function.
Add vsindex state machine to check for vsindex after blend.
Fix stack bugs in cff_blend_doBlend.
Report errors from cff_blend_build_vector.
Minor comment and TRACE edits.
* src/cff/cf2font.c (cf2_font_setup): before rendering a glyph, check
blend vector and reparse private DICT if it has changed.
* src/cff/cf2intrp.c (cf2_interpT2CharString): check blend vector and
build blend vector if needed at cf2_doBlend.
* src/cff/cffload.c (cff_vstore_load): fix bug parsing vstore with > 1
data item.
(cff_load_private_dict): factor out private dict parsing so we can
reparse when vector changes.
Add functions for handling CFF_Blend object.
(cff_blend_clear): clear blend stack
(cff_blend_check_vector): test if inputs have changed and blend vector
needs rebuilding.
(cff_blend_build_vector): construct blend vector from design vector
using algorithm in OpenType Font Variations Overview.
(cff_blend_doBlend): compute blended array, same as in cf2_intrp.c but
with parser blend_stack instead of charstring operand stack.
* src/cff/cffparse.c Add blend_stack alongside parser stack, so we have
a place to write blend results.
(cff_parse_num): add internal number type, opcode 255, for use with
blend_stack. Change limit check on several number parsing functions,
since stack is no longer contiguous.
(cff_parse_blend): check blend vector and re-build it if needed.
(cff_parser_run): ignore opcode 255 if it occurs in a font.
* src/cff/cfftypes.h (CFF_Blend): add object data for cff_blend_*
functions.
(CFF_SubFont): add CFF_Blend and blend_stack.
INDEX count for CFF2 is 32 bits, while CFF is 16 bits
This means INDEX header size is either 5 or 3 bytes.
CFF2 header size is 5 bytes, while CFF is 4 bytes.
In CFF2, offSize field is length of the Top DICT data and is 16 bits.
Blend operator has changed from 31 to 23.
Limit Top, Font and Private dicts to operators allowed by spec
Remove duplicate constants (CFFCODE vs CFF_CODE)
Allow more than 256 Font Dicts (subfonts) in CFF2
Since 2016-05-16 we detect infinite recursion directly.
* src/sfnt/ttload.c (tt_face_load_maxp): Don't adjust
`maxComponentDepth'.
* src/truetype/ttgload.c (load_truetype_glyph): Don't abort if
`maxComponentDepth' is not valid. Instead, simply adjust its value
and emit a tracing message.
To match the logic in FDEF. The value of the end is only used for
bound-checking in `Ins_JMPR', so it may not have been obvious that
it was not recorded. Tested (as part of Font Validator 2.0) all the
fonts on Fedora and did not see any change.
* src/truetype/ttinterp.c (Ins_IDEF): Updated.
GETDATA[], opcode 0x92
bytecode instruction. It always returns 17, and we have absolutely
no idea what it is good for...
* src/truetype/ttinterp.c (Pop_Push_Count, opcode_name): Updated.
(Ins_GETDATA): New function.
(TT_RunIns): Add it.
This commit implements undocumented (but confirmed) stuff from
Apple's old bytecode engine.
GETVARIATION[], opcode 0x91
This opcode pushes normalized variation coordinates for all axes
onto the stack (in 2.14 format). Coordinate of first axis gets
pushed first.
GETINFO[], selector bit 3
If GX variation support is enabled, bit 10 of the result is set
to 1.
* src/truetype/ttinterp.c: Include FT_MULTIPLE_MASTERS_H.
(opcode_name) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
(Ins_GETINFO) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle selector
bit 3, checking support for variation glyph hinting.
(Ins_GETVARIATION) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New function
to implement opcode 0x91.
(TT_RunIns) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle opcode 0x91.
This finally fixes the rendering of the cyclist and the lizard in
the `Zycon' font.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): `first' point
index is always cumulative.
(tt_handle_deltas): Rename to...
(tt_interpolate_deltas): ... This.
Add new parameter for output point array.
Update caller.
(TT_Vary_Apply_Glyph_Deltas): Add `points_out' array; it now holds
the intermediate results of `tt_interpolate_deltas' that are to be
added to `outline->points'.
* src/autofit/afhints.c (af_glyph_hints_dump_segments): Trace
`delta' also.
Don't show first point of segment as a replacement for `pos'; this
is (a) misleading, since the difference to `pos' can be almost
arbitrarily large in corner cases, and (b) it is better to have all
segment data in font units instead of a single value given in output
space coordinates.
Improve layout.
(af_glyph_hints_dump_edges): Show px->units and units->px conversion
values for convenience.
Improve layout.
* src/autofit/afhints.h (AF_SegmentRec): New member `delta'.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Compute
`delta'.
(af_latin_hints_compute_edges): Reject segments with a delta larger
than 0.5px.
The coordinates of the base font should be used for interpolation
purposes, NOT the current points (i.e., the result of accumulation
of previous deltas).
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize
`points_org' before looping over all tuples.
This commit covers the most important one.
* src/autofit/afmodule.c (af_property_set): Handle `warping',
`darkening-parameters', and `no-stem-darkening'.
* src/cff/cffdrivr.c (cff_property_set): Handle
`darkening-parameters', `hinting-engine', and `no-stem-darkening'.
* src/truetype/ttdriver.c (tt_property_set): Handle
`interpreter-version'.
Recognizing properties follows in another commit.
* devel/ftoption.h, include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES): New macro.
* include/freetype/config/ftstdlib.h (ft_getenv): New macro.
* src/base/ftinit.c (ft_set_default_properties): New function to
parse `FREETYPE_PROPERTIES' and calling `ft_property_string_set'.
(FT_Init_FreeType): Updated.
This is a preparation for handling an `FREETYPE_PROPERTIES'
environment variable to control (some) driver properties.
No change in functionality.
* src/base/ftobjs.c (ft_property_do): Add `value_is_string'
parameter.
(ft_property_string_set): New function.
(FT_Property_Set, FT_Property_Get): Updated.
* include/freetype/internal/ftobjs.h: Updated.
* include/freetype/internal/services/svprop.h
(FT_Properties_SetFunc): Add `value_is_string' parameter.
* src/autofit/afmodule.c (af_property_set), src/cff/cffdrivr.c
(cff_property_set), src/truetype/ttdriver.c (tt_property_set):
Updated, emitting an error currently if `value_is_string' is set.
* Jamfile: Update the directories of the header files scanned for
ftexport.sym. They were incorrect since the migration of the
header files, on 2015-06-22. Either inexisting include/cache
(removed on 2006-03-20) is not needed to be listed explicitly.
Now ftmac.h is scanned only in the case of Mac OS & Mac OS X.