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.
Rasterization sub-banding is utilized at large sizes while using
rather small fixed memory pool. Indeed it is possible to make an
educated guess how much memory is necessary at a given size for a
given glyph. It turns out that, for large majority of European glyphs,
you should store about 8 times more boundary pixels than their height.
Or, vice versa, if your memory pool can hold 800 pixels the band
height should be 100 and you should sub-band anything larger than
that. Should you still run out of memory, FreeType bisects the band
but you have wasted some time. This is what has been implemented in
FreeType since the beginning.
It was overlooked, however, that the top band could grow to twice the
default band size leading to unnecessary memory overflows there. This
commit fixes that. Now the bands are distributed more evenly and
cannot exceed the default size.
Now the magic number 8 is really suitable for rather simple European
scripts. For complex Chinese logograms the magic number should be 13
but that is subject for another day.
* src/smooth/ftgrays.c (gray_convert_glyph): Revise sub-banding
protocol.
Mac OS X linker throws errors when `-exported_symbol_list' input
file includes non-existing symbols. Reported by Ryan Schmidt.
* builds/exports.mk: Exclude ftmac.h from the headers for apinames
by default. Include it when ftmac.c would be compiled.
=========================
Tag sources with `VER-2-6-4'.
* docs/VERSION.TXT: Update documentation and bump version number to
2.6.4.
* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
builds/windows/vc2005/index.html,
builds/windows/vc2008/freetype.vcproj,
builds/windows/vc2008/index.html,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.6.3/2.6.4/, s/263/264/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
* builds/unix/configure.raw (version_info): Set to 18:4:12.
* CMakeLists.txt (VERSION_PATCH): Set to 4.
* docs/CHANGES: Updated.
* src/smooth/ftgrays.c (TArea): Restore original definition as `int'.
(gray_render_line) [FT_LONG64]: Updated.
(gray_convert_glyph): 32-bit band bisection stack should be 32 bands.
(gray_convert_glyph_inner): Trace successes and failures.
Doing so allows us to link them to edges – some fonts like
`NotoSansGurmukhi-Regular' have such isolated points sitting exactly
on other outlines.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Don't
ignore one-point contours but handle them specially as one-point
segments.
(af_latin_hints_compute_edges): Append one-point segments to edges
if possible.
This patch restores original `TCoord' definition as `int' so that the
rendering pool is used more efficiently on LP64 platforms (unix).
* src/smooth/ftgrays.c (gray_TWorker, TCell, gray_TBand): Switch some
fields to `TCoord'.
(gray_find_cell, gray_render_scanline, gray_render_line, gray_hline,
gray_sweep, gray_convert_glyph): Updated.
* src/smooth/ftgrays.c (gray_convert_glyph): Do not use volatile
qualifier.
(gray_raster_render): Move span initializations from here.
(gray_sweep): ... to here and remove unused `target' argument.
* src/smooth/ftgrays.c (gray_init_cells): Remove function.
(gray_TWorker): Remove fields that become local variables.
(gray_raster_render): Move rendering buffer declaration from here.
(gray_convert_glyph): ... to here and update accordingly.
Removing the checks from `gray_hline' shaves 1% off rendering speed.
* src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_MIN' and `FT_MAX'.
(gray_TWorker): No need to store `clip_box'.
(gray_hline): Remove unnecessary boundary checks.
(gray_convert_glyph): Move boundary checks from here.
(gray_raster_render): ... to here and consolidate.
* src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_Outline_Get_CBox'.
(gray_compute_cbox): Remove this function.
(gray_convert_glyph): Update to use `FT_Outline_Get_CBox'.
* CMakeLists.txt: Each time cmake is run those files are
modified and the whole FreeType library is recompiled. With this
change we change the files only if there are real modifications, so
we can avoid recompilations.
This compiler doesn't recognize the end-of-comment sequence `*/' if
it immediately follows non-ASCII characters.
* src/autofit/afscript.h: Ensure whitespace before `*/'.
* src/truetype/ttinterp.c (Ins_SHPIX): Allow SHPIX to move points in
the twilight zone. Otherwise, treat SHPIX the same as DELTAP.
Unbreaks various fonts such as older versions of Rokkitt and DTL
Argo T Light that would glitch severly after calling ALIGNRP after a
blocked SHPIX.
Suggested by Alexei. `UL' is only needed for 16bit compilers, but
it seems noone is using this anymore (and we no longer test whether
FreeType compiles in such an environment). Otherwise, it is easy to
add the postfix to the `AF_UNICODE_RANGE' macro.
The convergence of Bézier flatteners is fast with the deviation
from straight line being assymptotically cut 4-fold on each bisection.
This justifies smaller bisection stack size.
* src/smooth/ftgrays.c (gray_TWorker): Remove common `bez_stack'.
(gray_render_conic): Create and use conic `bez_stack'. Move back the
band analysis from...
(gray_conic_to): ... here.
(gray_render_cubic): Create and use cubic `bez_stack'. Move back the
band analysis from...
(gray_cubic_to): ... here.
(gray_move_to): Updated.
* src/autofit/afblue.dat: Add blue zone data for Armenian.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Armenian standard characters.
* src/autofit/afranges.c: Add Armenian data.
* src/autofit/afstyles.h: Add Armenian data.
This was commented about 10 years ago – I think the reason then to
disable libtool's `-export-symbols' option was to give some badly
programmed applications access to internal FreeType functions.
I believe that we should no longer take care of such programs; the
number of symbols exported should be rather restricted as much as
possible.
This essentially moves the Gurmukhi script from the `Indic' hinter to
the `Latin' hinter.
* src/autofit/afblue.dat: Add blue zone data for Gurmukhi.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Gurmukhi standard characters and move
data out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Gurmukhi data out of
AF_CONFIG_OPTION_INDIC block.
* src/autofit/afstyles.h: Update Gurmukhi data; in particular, use
AF_WRITING_SYSTEM_LATIN.
This patch prepares data structures and the like.
See added comments in `ttinterp.h' for more information on this and
the following commits in the series.
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_SUBPIXEL_HINTING): Assign values to differentiate
between subpixel versions.
(TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY,
TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL): New macros.
* include/freetype/ftttdrv.h (TT_INTERPRETER_VERSION_40): New macro.
* include/freetype/internal/tttypes.h (TT_FaceRec): Updated.
* src/truetype/ttinterp.h (TT_ExecContextRec): Define new fields
`subpixel_hinting_lean', `vertical_lcd_lean',
`backwards_compatibility', `iupx_called', iupy_called', and
`grayscale_cleartype' for new hinting mode.
* src/truetype/ttdriver.c (tt_property_set): Handle v38 and v40
interpreters conditionally.
* src/truetype/ttgload.c (TT_Hint_Glyph): Save phantom points unless
in v38 backwards compatibility mode.
Updated.
(compute_glyph_metrics): Add v38 backwards compatibility mode
constraint for adjusting advance widths.
Updated.
(tt_loader_init): Handle new flags `subpixel_hinting_lean',
`grayscale_cleartype', and `vertical_lcd_lean'.
Updated.
(tt_get_metrics, TT_Process_Simple_Glyph, TT_LOADER_SET_PP):
Updated.
* src/truetype/ttobjs.c (tt_driver_init): Conditionally set
default interpreter version number.
* src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Updated.
* include/freetype/config/ftstdlib.h (FT_LONG_MIN): New macro.
* src/cff/cffparse.c (cff_parse_font_matrix): Use largest scaling
value of all matrix coefficients to scale matrix.
* src/cff/cffobjs.c (cff_face_init): Use `matrix->yx' member for
matrix normalization if `matrix->yy' is zero.
The previous fix for #46372 misunderstood a composite glyph referring
same component twice as a recursive reference. See the discussion
http://lists.gnu.org/archive/html/freetype/2016-05/msg00000.html
Thanks to Khaled Hosny for finding this issue.
* src/truetype/ttgload.c (ft_list_get_node_at): A function to get
the i-th node from FT_List. (load_truetype_glyph): In the traversal
scan of the reference tree in the composite glyph, we clear the
nodes filled by previous sibling chain.
We never dereference `face_id', and some implementations might use a
running number instead of a pointer. Additionally, disallowing
value zero was undocumented.
* src/cache/ftccmap.c (FTC_CMapCache_Lookup), src/cache/ftcmanag.c
(FTC_Manager_LookupFace, FTC_Manager_RemoveFaceID): Remove test for
`face_id'.
A single decrement counter of segments to draw, instead of an array,
contains all the information necessary to decide when to split and
when to draw a conic segment. The number of splits before each draw is
equal to the number of trailing zeros in the counter.
* src/smooth/ftgrays.c (gray_TWorker): Remove `lev_stack'.
(gray_render_conic): Updated to use decrement counter of segments.
Otherwise some properties could be set to arbitrary values, which is
harmless, but querying could give wrong positive results.
* src/cff/cffdrivr.c (cff_property_set) [hinting-engine],
* src/truetype/ttdriver.c (tt_property_set) [interpreter-version]:
Only allow defined values.
This essentially moves the Gujarati script from the `Indic' hinter to
the `Latin' hinter.
* src/autofit/afblue.dat: Add blue zone data for Gujarati.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Gujarati standard characters and move
data out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Gujarati data out of
AF_CONFIG_OPTION_INDIC block.
* src/autofit/afstyles.h: Update Gujarati data; in particular, use
AF_WRITING_SYSTEM_LATIN.
As FreeType depends on zlib, if we don't install zlib (e.g., because
we defined SKIP_INSTALL_ALL), FreeType cannot be installed, too
(cmake triggers an error saying that FreeType cannot be installed
because zlib target isn't in the export set).
* CMakeLists.txt: Honor `SKIP_INSTALL_HEADERS',
`SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' settings.
Georgian is problematic, since `uppercase' forms of Mkhedruli
(called Mtavruli) are not yet defined in Unicode, which means that
proper blue zones can't be defined. However, there is already a
proposal submitted to Unicode; see
http://www.unicode.org/L2/L2016/16034-n4707-georgian.pdf
Additionally, due to historical reasons, Unicode treats Khutsuri as
the same script as Mkhedruli, and so does OpenType. However, since
the two scripts have completely different shapes it can happen that
blue zones differ considerably. The tag `geok' used here (derived
from ISO 15924) to differentiate the two scripts is not an OpenType
tag in use. If we now have a font that contains both glyphs for
Mkhedruli and Khutsuri, and it uses OpenType features for both also,
HarfBuzz unavoidably treats all glyphs as `geor'. As a consequence,
blue zones for `geok' are not used for glyphs involved in the
OpenType features.
An issue not yet resolved is which OpenType feature should be used
to access Mtavruli glyph shapes; right now, FreeType doesn't set up
support for them, but it is easy to add them later on as soon as
more information is available.
* src/autofit/afblue.dat: Add blue zone data for Georgian.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Georgian standard characters.
* src/autofit/afranges.c: Add Georgian data.
* src/autofit/afstyles.h: Add Georgian data.
Even if the dummy hinter is used as the handler for `none' (which
doesn't use blue zones), it is more consistent than the old value
(which was 0), pointing to Arabic...
* src/autofit/afblue.dat: Add `AF_BLUE_STRINGSET_NONE'.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afstyles.h (none_dflt): Use AF_BLUE_STRINGSET_NONE.
* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Replace `left',
`right', and `middle' with `min', `max', and `mid' as used in other
FreeType binary search code.
(pfr_load_bitmap_metrics): Fix invalid left shift.
We did a binary search for a charcode without ensuring that the
searched data is ordered. Validating the order is now done lazily,
this is, the first access to a bitmap glyph triggers the order check
in the corresponding bitmap strike.
* src/pfr/pfrtypes.h (PFR_BitmapFlags): New values
`PFR_BITMAP_VALID_CHARCODES' and `PFR_BITMAP_CHARCODES_VALIDATED'.
* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Make `flags' argument
a pointer. Handle new PFR_BITMAP_XXX flags.
(pfr_slot_load_bitmap): Updated.
Extra items are indicated with different bit positions.
* src/pfr/pfrtypes.h (PFR_GlyphFlags): Replace
`PFR_GLYPH_EXTRA_ITEMS' with `PFR_GLYPH_SIMPLE_EXTRA_ITEMS' and
`PFR_GLYPH_COMPOUND_EXTRA_ITEMS'.
* src/pfr/pfrgload.c (pfr_glyph_load_simple,
pfr_glyph_load_compound): Use them.
* src/pfr/pfrsbit.c (pfr_load_bitmap_metrics): Correctly handle
signed nibbles.
(pfr_slot_load_bitmap): Correctly exit frame in case of error.
Fix invalid left shifts.
* src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
band clipping from here.
(gray_conic_to, gray_cubic_to): ... to here.
(gray_rander_line, gray_render_scanline): Initialize variables closer
to their use.
We probably did not notice this as all fonts we tested had only
tuple_coords[i] be +1 or -1 for non-intermediate tuples.
* src/truetype/ttgxvar.c (ft_var_apply_tuple): Implement it.
The goal is to avoid integer overflows in the rendering algorithms.
The limit is chosen arbitrarily at some 2^18 pixels, which should be
enough for modern devices including printers.
* src/base/ftoutln.c (FT_Outline_Render): Check CBox and reject
enormous outlines.
* src/autofit/aflatin.c (af_latin_compute_stem_width): Add argument
to pass difference between hinted and unhinted position of base
point; use this to adjust the stem width depending on the PPEM so
that it doesn't become too large under certain circumstances.
Update all callers using value 0 for this argument except...
(af_latin_align_linked_edge): Pass position delta of base point to
`af_latin_compute_stem_width'.
This essentially moves the Sinhala script from the `Indic' hinter to
the `Latin' hinter.
* src/autofit/afblue.dat: Add blue zone data for Sinhala.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Sinhala standard character and move data
out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Sinhala data out of
AF_CONFIG_OPTION_INDIC block.
* src/autofit/afstyles.h: Update Sinhala data; in particular, use
AF_WRITING_SYSTEM_LATIN.
An example that gets better rendered is glyph `uusignTaml' (glyph
index 2286) in font `FreeSerif.ttf' (Version 0412.2263) at 22ppem.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Properly
handle segments where the last point of the first segment is
identical to the first point in the second one. This can happen for
malformed fonts or spikes. We either merge the new segment with the
previous one (both segments point into the same direction), or we
discard the shorter segment if they point into different directions.
* src/autofit/aflatin.c (af_latin_hints_compute_segments): Change
some local variable names to better differentiate between values
along a segment and values orthogonal to it.
In complex glyph shapes, the original logic was too simple to cater
for situations that would actually need something similar to PS Hint
masks. This fix should alleviate the worst cases.
* src/autofit/aflatin.c (af_latin_hint_edges): Don't allow
complete disappearance of stems.
This essentially moves the Tamil script from the `Indic' hinter to
the `Latin' hinter.
* src/autofit/afblue.dat: Add blue zone data for Tamil.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Tamli standard character and move data
out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Tamil data out of
AF_CONFIG_OPTION_INDIC block.
* src/autofit/afstyles.h: Update Tamil data; in particular, use
AF_WRITING_SYSTEM_LATIN.
This essentially moves the Malayalam script from the `Indic' hinter
to the `Latin' hinter.
* src/autofit/afblue.dat: Add blue zone data for Malayalam.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Malayalam standard characters and move
data out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Malayalam data out of
AF_CONFIG_OPTION_INDIC block.
* src/autofit/afstyles.h: Update Malayalam data; in particular, use
AF_WRITING_SYSTEM_LATIN.
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.
We need this to properly trace Multiple Master CFFs, which contain
two SIDs that are charstrings.
This commit makes FreeType also show the last SID, omitted
previously due to a bug.
* src/cff/cfftypes.h (CFF_FontRec): Add `string_pool_size' field.
* src/cff/cffload.c (cff_index_get_pointers): Add argument to return
the pool size.
Update all callers.
* src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Directly
access `cff->strings' to display the non-default strings.
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.