This applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or
lack thereof are predicted accurately.
* src/base/ftcalc.c (ft_div64by32): Improve readability.
(FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division
when multiplication stayed within 32 bits.
This fixes a 13-year old bug. The original overflow check should have
been updated when rounding was introduced into this function
(c2cd00443b).
* src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated.
* include/freetype.h (FT_DivFix): Updated documentation.
* include/freetype.h (FT_MulFix): Unconditionally defined.
* src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here...
* include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here,
which conditionally replaces the function with an inline version
through the macro.
* src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of
`ft_highpow2'.
* src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove
it.
FT_MulFix assembler used to reside in ftcalc.c before f47d263f1b.
* include/config/ftconfig.h, builds/unix/ftconfig.in,
builds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here...
* src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here.
The fragmented resources in Suitcase and .dfont should be reordered
when post resource for Type1 is being restored, but reordering of
sfnt resources induces the different face order. Now the ordering
is restricted to post resource only, to prevent the different order
issue (e.g. the face index in the fontconfig cache generated with
Carbon framework is incompatible with that by FreeType2 without
Carbon framework.) Found by Khaled Hosny and Hin-Tak Leung.
http://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.htmlhttp://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch
`sort_by_res_id' to control the fragmented resource ordering.
* include/internal/ftrfork.h: Daclare new switch.
* src/base/ftobjs.c (IsMacResource): Enable the soring for post
resource, and disable the sorting for sfnt resource.
* include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix
generated function name.
* src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename
to ...
(FT_Init_Table_ft_raccess_guess_table): ... this so that the
function name correctly corresponds to what the macro framework
expects.
* src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so
that PIC functions are compiled also.
Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see
http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html
for details.
* src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep'
tables also for setting `autohint'.
* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from
`TT_Process_Composite_Glyph' for handling unreliable values of
`maxSizeOfInstructions'.
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.
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.
If the font's `clazz->init_face' function wants to swap to new
stream, handling of whether original stream was external could
result to either memory leak or double free. Mark externality into
face flags before calling `init_face' such that the clazz can handle
external streams properly.
* src/base/ftobjs.c (FT_Open_Face): Move code to set
FT_FACE_FLAG_EXTERNAL_STREAM to...
(open_face): This function.