Both the native CFF hinter and the auto-hinter now have a very
similar rendering style.
* include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no
longer implies FT_LOAD_FORCE_AUTOHINT.
* include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New
macro.
* include/freetype/internal/ftobjs.h (FT_DRIVER_HINTS_LIGHTLY): New
macro.
* src/cff/cffdrivr.c (cff_driver_class): Use it.
* src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection
logic.
* include/freetype/internal/tttypes.h (TT_LoaderRec): New field
`composites'.
* src/truetype/ttgload.c: Include FT_LIST_H.
(load_truetype_glyph): Add composite subglyph index to a list;
abort if index is already in list.
(tt_loader_init): Updated.
(tt_loader_done): New function.
(TT_Load_Glyph): Call `tt_loader_done'.
Actual code follows in a later commit.
* include/freetype/ftautoh.h: Document `no-stem-darkening' and
`darkening-parameters'.
* src/autofit/afmodule.h: New fields `no_stem_darkening' and
`darken_params'.
* src/autofit/afmodule.c (af_property_set, af_property_get):
Handle them.
(af_autofitter_init): Initialize them.
=========================
Tag sources with `VER-2-6-1'.
* docs/VERSION.DLL: Update documentation and bump version number to
2.6.1.
* 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/2.6.1/, s/26/261/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
* builds/unix/configure.raw (version_info): Set to 18:1:12.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
* src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for
dumping functions.
While the current code in `FT_Get_Next_Char' correctly rejects
out-of-bounds glyph indices, it can be extremely slow for malformed
cmaps that use 32bit values. This commit tries to improve that.
* src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next,
tt_cmap12_char_map_binary, tt_cmap13_next,
tt_cmap13_char_map_binary): Reject glyph indices larger than or
equal to the number of glyphs.
* include/freetype/ftautoh.h (FT_Prop_GlyphToScriptMap): Use
`FT_UShort' for `map' field.
* src/autofit/afglobal.c (af_face_globals_compute_style_coverage,
af_face_globals_new), src/autofit/hbshim.c, src/autofit/hbshim.h
(af_get_coverage): Use FT_UShort for `glyph_styles' array.
* src/autofit/afglobal.h (AF_STYLE_UNASSIGNED, AF_DIGIT): Extend to
16 bits.
(AF_FaceGlobalsRec): Use `FT_UShort' for `glyph_styles' field.
For functions querying a face, bits 16-30 of the face index can hold
the named instance index if we have a GX font. The indices start
with value 1; value 0 indicates font access without GX variation
data.
* include/freetype/freetype.h (FT_FaceRec): Update documentation.
* include/freetype/internal/sfnt.h: Ditto.
* src/sfnt/sfobjs.c (sfnt_init_face)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Get number of named instances and
do argument checks.
(sfnt_load_face): Updated.
* src/truetype/ttobjs.c (tt_face_init)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting
the style name.
* src/base/ftobjs.c (open_face_from_buffer,
open_face_PS_from_sfnt_stream): Updated.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Updated.
* src/cff/cffload.c (cff_font_load): Updated.
* src/cff/cffobjs.c (cff_face_init): Make function exit early for
pure CFF fonts if `font_index < 0'.
Updated.
* src/cid/cidobjs.c (cid_face_init): Updated.
* src/pcf/pcfdrivr.c (PCF_Face_Init): Updated.
* src/pfr/pfrobjs.c (pfr_face_init): Updated.
* src/type1/t1objs.c (T1_Face_Init): Updated.
* src/type42/t42objs.c (T42_Face_Init): Updated.
* src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init):
Updated.
* docs/CHANGES: Updated.
* include/freetype/internal/sfnt.h (TT_Get_Name_Func): New
prototype.
(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'.
* src/sfnt/sfdriver.c (sfnt_interface): Updated.
* src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'.
* src/sfnt/sfobjs.h: Add prototype for it.
The function uses Newton's iterations instead of dividing vector
components by its length, which needs a square root. This is,
literally, a bit less accurate but a lot faster.
* src/base/ftcalc.c (FT_Vector_NormLen): New function.
This change is a result of a discussion thread on freetype-devel
http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html
Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.
* include/freetype2: Renamed to...
* include/freetype: This.
* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.
* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.
* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.
* builds/wince/*, builds/windows/*: Updated.
* devel/ft2build.h, include/ft2build.h: Updated.
* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.
* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
* docs/*: Updated.
This large patch changes the header file directory layout from
`include/freetype/...' to `include/...', effectively removing one
level. Since the file `ft2build.h' is also located in `include'
(and it stays there even after installation), all FreeType header
files are now in a single directory.
Applications that use (a) `freetype-config' or FreeType's
`pkg-config' file to get the include directory for the compiler, and
(b) the documented way for header inclusion like
#include <ft2build.h>
#include FT_FREETYPE_H
...
don't need any change to the source code.
* include/freetype/*: Move up to...
* include/*: ... this directory.
* builds/amiga/include/freetype/*: Move up to...
* builds/amiga/include/*: ... this directory.
*/*: Essentially do `s@/freetype/@/@' where appropriate.
* CMakeList.txt: Simplify.
* builds/unix/freetype-config.in, builds/unix/freetype2.in: For
`--cflags', return a single directory.
* builds/unix/install.mk (install): No longer try to remove `cache'
and `internal' subdirectories; instead, remove the `freetype'
subdirectory.
Simply apply the patch from the bug report.
* builds/unix/ftconfig.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h: The used #pragma directives only
work with gcc versions 4.6 and higher.
See
http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism
for the announcement.
* include/freetype/tttables.h (TT_OS2): Add fields
`usLowerPointSize' and `usUpperPointSize'. Since FreeType returns
this structure only as a pointer through `FT_Get_Sfnt_Table', there
shouldn't be any ABI problems.
* src/sfnt/ttload.c (tt_face_load_os2): Implement it.
* docs/CHANGES: Updated.
When using `ADD' with an immediate operand, the instruction is
actually `ADD Rd, Rn, #<imm12>', that is, the maximum of the
immediate operand cannot exceed 4095. It will fail to compile with
LLVM.
However, in GCC, due to some legacy compatibility considerations,
`ADD.W' will be automatically emitted when the immediate operand is
larger than 4095.
* builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
(FT_MulFix_arm) [__GNUC__]: Support clang compiler.
* src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto.
We simply synthesize a SFNT from the WOFF, create a memory stream
for the new data, and load the SFNT as usual.
Does NOT add any API to access WOFF metadata or private blocks.
* include/freetype/internal/tttypes.h (WOFF_HeaderRec,
WOFF_TableRec): New structures.
* include/freetype/tttags.h (TTAG_wOFF): New macro.
* src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling
`open_face'.
* src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include
`FT_GZIP_H'.
(WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for
writing to a stream.
(sfnt_stream_close, compare_offsets, woff_open_font): New functions.
(sfnt_open_font): Handle `TTAG_wOFF'.
(sfnt_init_face): Set `stream' after calling `sfnt_open_font'.
* src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling
`sfnt->init_face'.
* src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an
argument so that a changed stream survives.
Update callers.
This is modeled after zlib's `uncompress' function. We need this
for WOFF support.
* include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress):
New function.
* src/gzip/rules.mk: Rewrite to better reflect dependencies.
When building for ARMv7 with thumb2 instructions, the optimized
`FT_MulFix_arm' assembly routine was not being used.
The reason for this is in the `ftconfig.h' header, namely:
- The assembly routine uses the `smull' instruction which is not
available when generating Thumb-1 machine code. It is available
in Thumb-2 mode, though.
- The header was written a long time ago before Thumb-2 became
widely popular (e.g. with Android). So it simply doesn't use the
assembly routine if the `__thumb__' built-in macro is defined.
- When compiling in Thumb-2 mode, the compiler will define both
`__thumb__' and `__thumb2__'.
By checking for `(__thumb2__ || !__thumb__)', we ensure that the
assembly routine is only avoided when generating Thumb-1 code.
Given that this is performance-sensitive function, this improves
`ftbench' as follows on a Galaxy Nexus:
Before (us/op) After (us/op)
- loading Arial.ttf glyphs at 14 ppem [1]
Load 34.285 33.098
- same operation with the light auto-hinter [2]
Load 31.317 29.590
- same operation without hinting [3]
Load 6.143 5.376
- loading Arial.ttf advances at 14 ppem [4]
Load_Advances (normal) 34.216 33.016
Load_Advances (fast) 0.176 0.176
[1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf
[2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf
[3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf
[4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf
* builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
(FT_MULFIX_ASSEMBLER): Fix handling for ARMv7.