include


Log

Author Commit Date CI Message
Ben Wagner 7789f2bb 2022-03-18T15:52:47 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3. * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
Anuj Verma 5499d7bf 2022-03-04T16:42:02 * include/freetype/freetype.h: Improve SDF documentation.
Werner Lemberg 01d4deb0 2022-02-16T14:21:00 ftmm.h: Minor documentation improvement.
Werner Lemberg 5a53e51b 2022-02-12T07:58:43 t1tables.h: Documentation improvements.
Werner Lemberg c67ecb8c 2022-02-12T07:52:57 t1tables.h: Whitespace.
Werner Lemberg 24db55ec 2022-02-05T09:06:39 Various minor doc fixes.
Werner Lemberg 36ee3160 2022-01-31T10:37:56 freetype.h: Minor documentation improvement.
Ben Wagner e34a860a 2022-01-27T11:50:12 Document `FT_Outline_Decompose` degenerate segments. `FT_Outline_Decompose` does not filter out and can return degenerate segments in an outline. This can be surprising when attemping to stroke such an outline. Clarify the existing documentation on this matter to cover all forms of degeneracy (without specifying exactly how they will be reported), why they might arise, and better explain in what cases they may be an issue. * include/freetype/ftoutlin.h (FT_Outline_Decompose): update documentation. Fixes #952.
Werner Lemberg 267c6918 2022-01-25T14:46:36 Aarg, typo.
Werner Lemberg 9af1127f 2022-01-25T14:45:10 freetype.h: More updates to `FT_LOAD_COLOR` description.
Werner Lemberg 6a8e95b7 2022-01-25T08:49:41 Update documentation for `FT_LOAD_COLOR`.
Werner Lemberg ef48a332 2022-01-23T19:05:15 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
Werner Lemberg 21d0fa37 2022-01-23T12:03:44 More documentation on handling OT-SVG.
Moazin Khatti 0bf49bd2 2021-12-25T20:14:11 Add 'svg' module for OT-SVG rendering. * CMakeLists.txt (BASE_SRCS): Add svg module file. * meson.build (ft2_public_headers): Add `otsvg.h`. * modules.cfg (RASTER_MODULES): Add `svg` module. * builds/meson/parse_modules_cfg.py: Add svg module. * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and `Missing_SVG_Hooks` error codes. * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. * include/freetype/internal/svginterface.h: New file. It adds an interface to enable the presetting hook from the `base` module. * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. (SVG_RendererHooks): New structure to access them. * src/base/ftobjs.c: Include `svginterface.h`. (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG glyphs. (ft_add_renderer): Updated. * src/svg/*: New files.
Moazin Khatti 97c09a80 2021-12-25T19:55:58 Add `FT_Glyph` support for OT-SVG glyphs. * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure. * src/base/ftglyph.c: Include `otsvg.h`. (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy, ft_svg_glyph_transform, ft_svg_glyph_prepare): New function. (ft_svg_glyph_class): New class. (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs. * src/base/ftglyph.h: Updated.
Moazin Khatti f93a897a 2021-12-25T19:20:44 Add code to load OT-SVG glyph documents. * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. (FT_LOAD_SVG_ONLY): New internal macro. * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value `FT_GLYPH_FORMAT_SVG`. * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New functions. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for the SVG table. * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the SVG document and other necessary information of an OT-SVG glyph in a glyph slot. * include/freetype/tttags.h (TTAG_SVG): New macro. * src/base/ftobjs.c: Include `otsvg.h`. (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` if the SVG table exists. (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed glyph. (ft_glyphslot_done): Free the document data if it is a GZIP compressed glyph. (FT_Load_Glyph): Don't auto-hint SVG documents. * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for FT_GLYPH_FORMAT_SVG. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. * src/sfnt/sfdriver.c: Include `ttsvg.h`. (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/sfnt.c: Include `ttsvg.c`. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and free data of the the SVG table. * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/ttsvg.h: Declarations of the SVG functions in `ttsvg.c`.
Moazin Khatti 06c1a25e 2021-12-25T17:59:42 Add flag `FT_CONFIG_OPTION_SVG`. This flag is going to be used to conditionally compile support for OT-SVG glyphs. FreeType will do the parsing and rely on external hooks for rendering of OT-SVG glyphs. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_CONFIG_OPTION_SVG): New flag.
Alexei Podtelezhnikov 99a940f8 2022-01-20T15:06:09 * include/freetype/freetype.h: Clarify `FT_Size` life cycle.
Alexei Podtelezhnikov 054782c4 2022-01-19T22:14:06 [base] Undefined scale means no scale. It might be surprising that FreeType does not have default ppem and the size has to be set explicitly or face undefined behavior with undefined variables and errors. This offers an alternative to missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined behavior is bettr than undefined one. This is alternative to !132 and discussed in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale. * include/freetype/freetype.h: Document it.
Ozkan Sezer 3f6497bd 2022-01-15T22:44:28 Add Watcom C/C++ calling. In the unlikely case the source is built with OpenWatcom's -ec? switches to enforce a calling convention, the qsort() compare function must still be set to __watcall. * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Updated.
Ozkan Sezer 11ea89b5 2022-01-14T22:07:44 Add Watcom C/C++ support. * include/freetype/config/integer-types.h: Make sure `long long` is used then available. * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
Alexei Podtelezhnikov 7f7bf6f0 2022-01-14T20:33:28 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten. This works around Watcom C library using __watcall.
Werner Lemberg d0cfb4e1 2022-01-11T10:54:10 Update all copyright notices.
Werner Lemberg 2b672e72 2022-01-02T18:33:03 * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable. This was accidentally removed with commit 93ebcbd0 almost eight years ago.
Alexei Podtelezhnikov 7add5b2b 2021-12-11T22:54:06 [truetype] Binary search through the `hdmx` records. The `hdmx` table is supposed to be sorted by ppem size, which enables binary search. We also drop the check for the sufficient length of the record because it is now enforced when the table is loaded. * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx` record pointers sorted by ppem instead of ppem's themselves. * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records. (tt_face_get_device_metrics): Implement binary search to retrieve advances.
Alexei Podtelezhnikov 6c831d65 2021-12-11T22:34:27 [truetype] Initialize the loader with `hdmx` data. The `hdmx` matching can be done before the glyph is loaded. * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field. * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx` code from here... (tt_loader_init): ... to here, before the glyph is loaded.
Werner Lemberg 3f83daee 2021-12-01T20:17:59 * Version 2.11.1 released. ========================== Tag sources with `VER-2-11-1'. * docs/VERSION.TXT: Add entry for version 2.11.1. * docs/CHANGES, docs/release: Updated. * README, src/base/ftver.rc, builds/windows/vc2010/index.html, builds/windows/visualc/index.html, builds/windows/visualce/index.html, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, docs/freetype-config.1: s/2.11.0/2.11.1/, s/2110/2111/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. * builds/unix/configure.raw (version_info): Set to 24:1:18. * CMakeLists.txt (VERSION_PATCH): Set to 1. * builds/toplevel.mk (version_tag, CHANGELOG_SCRIPT): New variables. (do-dist): Generate `ChangeLog` file with all commits since last release.
Werner Lemberg 3cabd142 2021-11-22T19:36:45 Update `CHANGES` files, other minor whitespace and documentation issues.
Alexei Podtelezhnikov f8a4163a 2021-11-20T07:01:26 * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting.
Werner Lemberg 8c8f51c5 2021-11-19T21:50:22 Avoid undefined left-shifts. We really have to use double casts to avoid issues with C's and C++'s signedness propagation rules in implicit casts. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41178 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41182 * include/freetype/config/public-macros.h (FT_STATIC_CAST, FT_REINTERPRET_CAST): Modify macro to take two arguments. Update all callers. (FT_STATIC_BYTE_CAST): New macro. * include/freetype/freetype.h (FT_ENC_TAG): Use `FT_STATIC_BYTE_CAST`. * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. * include/freetype/fttypes.h (FT_MAKE_TAG): Ditto. Use `FT_Tag` for casting. * src/ftraster/ftmisc.h (FT_MAKE_TAG): Removed, no longer needed. (FT_STATIC_BYTE_CAST): New macro. * src/smooth/ftgrays.c (FT_STATIC_CAST): Replace with... (FT_STATIC_BYTE_CAST): ... this.
Werner Lemberg 9079c5d9 2021-11-13T08:53:19 Provide C++ versions for public macros with casts. Many FreeType clients use C++. However `g++ -Wold-style-cast` warns for macros with C-style casts even for system header files; this also affects directories included with `-isystem`. While this could be seen as a problem with g++, the problem is more a philosophical one: Over the time, C and C++ diverged more and more, and some features of C are no longer the 'right' solution in C++. * include/freetype/config/public-macros.h (FT_STATIC_CAST, FT_REINTERPRET_CAST): New macros. * include/freetype/freetype.h (FT_ENC_TAG, FT_LOAD_TARGET_, FT_LOAD_TARGET_MODE): Use `FT_STATIC_CAST`. Correctly handle negative 'signed char' input. * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. * include/freetype/fttypes.h (FT_MAKE_TAG, FT_BOOL): Ditto. * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): Use `FT_REINTERPRET_CAST`. * src/smooth/ftgrays.c (FT_STATIC_CAST)[STANDALONE_]: New macro. [!STANDALONE]: Include `FT_CONFIG_CONFIG_H`. Fixes #1116.
Alexei Podtelezhnikov 42e61723 2021-11-11T23:06:36 Explicitly define `FT_MSB` for Clang. * include/freetype/internal/ftcalc.h [__clang__] (FT_MSB): Updated.
Alexei Podtelezhnikov 188c7d66 2021-11-09T22:47:26 Additional `FT_MSB` macro definitions. Better macros for Windoes CE and ARM in general, based on !109 from metarutaiga. * include/freetype/internal/ftcalc.h [_MSC_VER] (FT_MSB): Updated.
Alexei Podtelezhnikov 7f4b9bfb 2021-11-07T10:20:16 [dlg] Define DLG_STATIC explicitly. DLG_STATIC is intended to disable Windows DLL linking attributes. It does not hurt to define it explicitly when we wrap DLG code. This fixes tons of LNK4286 and C4273 warnings from MSVC if we forget to define DLG_STATIC as a compiler option. * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option. * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC. * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto.
Dominik Röttsches d3d3ff76 2021-11-01T17:32:27 [sfnt] Clarify `COLR` v1 FT_Paint* format representations * include/freetype/ftcolor.h (FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform, FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify 16.16 fixed point representation of struct fields. * src/sfnt/ttcolr.c (read_paint): Shift coordinates for FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient accordingly. Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110
Alexei Podtelezhnikov 793c0126 2021-10-27T22:36:11 [woff] Optimize table tagging. * include/freetype/internal/wofftypes.h (WOFF_TableRec): Use 32-bit tag. * src/sfnt/sfwoff.c (woff_open_font): Use 32-bit tag.
Alexei Podtelezhnikov a577bbcb 2021-10-27T22:24:27 [woff2] Optimize table tagging. Fixes #1107. * include/freetype/internal/wofftypes.h (WOFF2_TableRec): Use 32-bit tag. * src/sfnt/sfwoff2.c (compare_tags, find_table, woff2_open_font): Use 32-bit tag. * src/sfnt/woff2tags.[ch] (woff2_known_tags): Use static storage and return 32-bit tag.
Ben Wagner c71eb22d 2021-10-15T22:18:38 Fix typos in memory macros. FT_QNEW_ARRAY and FT_QRENEW_ARRAY were using the non-Q FT_MEM_NEW_ARRAY and FT_MEM_RENEW_ARRAY. Change these to use the Q versions. Also fix the one issue discovered in tt_face_load_name where table->names is created with FT_QNEW_ARRAY but the extra string member is not initialized to NULL. * include/freetype/internal/ftmemory.h (FT_Q(RE)NEW_ARRAY): Use FT_MEM_Q(RE)NEW_ARRAY as needed. * src/sfnt/ttload.c (tt_face_load_name): Initialize `entry->string`.
Alexei Podtelezhnikov 3b036820 2021-10-10T23:11:10 [cid] Signedness revisions. Unsigned checks are simpler. * include/freetype/t1tables.h (CID_FaceInfoRec): Change to unsignd `num_dicts`. * src/cid/cidparse.h (CID_Parser): Change to unsigned `num_dict`. * src/cid/cidgload.c (cid_load_glyph): Updated. * src/cid/cidload.c (cid_load_keyword, parse_fd_array, parse_expansion_factor, parse_font_name, cid_read_subrs, cid_face_open): Updated. * src/cid/cidobjs.c (cid_face_done): Updated. * src/cid/cidparse.c (cid_parser_new): Updated.
Alexei Podtelezhnikov 22befeef 2021-10-07T22:41:56 Signedness revisions. This eliminates explicit casting by switching to unsigned fields. The revisions mostly impact the handling of CID fonts. * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`. * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`. (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`. * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for `byte_len`. * src/cid/cidgload.c (cid_load_glyph): Updated. * src/cid/cidload.h (cid_get_offset): Update argument. * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open): Updated. * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): Updated. * src/psaux/psft.c (cf2_getT1SeacComponent): Updated. * src/truetype/ttgload.c (TT_Process_Composite_Glyph, load_truetype_glyph): Updated.
Alexei Podtelezhnikov bbab0a67 2021-10-04T23:55:46 * include/freetype/internal/ftgloadr.h: Add missing header. Noticed by Jouk Jansen.
Alexei Podtelezhnikov 311764fa 2021-10-01T11:50:12 Additional `FT_MSB` macro definitions. * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins and intrinsics.
Alexei Podtelezhnikov 766b2c19 2021-09-24T22:14:22 Propagate sign when reading OFF3. Signed 24-bit values are extremely rare. FreeType only reads them in PFR fonts with bitmap strikes conditionally. They have not been seen in the known fonts. That is why this bug could never be discovered. `FT_FRAME_OFF3` propagates sign correctly. * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE): Propagate sign into 32-bit value. (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused.
Alexei Podtelezhnikov a29e0200 2021-09-23T23:10:26 Use NULL for pointers only. * src/bdf/bdflib.c (*): Code changes. * include/freetype/freetype.h: Comments only. * src/cff/cffload.c, src/cff/cffobjs.c: Ditto. * src/winfonts/winfnt.c: Ditto.
Werner Lemberg 6d19b29f 2021-09-23T08:46:01 Minor documentation fixes and improvements.
Alexei Podtelezhnikov 3b573e45 2021-09-22T22:22:13 Reference `fopen` in the docs.
Alexei Podtelezhnikov e942a310 2021-09-09T22:17:46 [truetype] Tweak `loca` clamping. Fixes #1095. * src/truetype/ttpload.c (tt_face_load_loca): Fix up clamping. * include/freetype/internal/tttypes.h (TT_Face): Correct docs.
Alexei Podtelezhnikov 7482c98f 2021-09-01T22:18:29 [base] Clean up stream reading. * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset, FT_Stream_ReadULong and their LE variants): Remove unnecessary initialization and slightly refactor. (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned value and align with sister functions. * include/freetype/internal/ftstream.h (FT_Stream_GetByte, FT_Stream_ReadByte): Update prototypes and caller macros.
Alexei Podtelezhnikov 78f2bd0b 2021-08-22T22:32:07 Whitespace formatting.
Alexei Podtelezhnikov d92aa23f 2021-08-22T13:12:45 Decorate const arguments. * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it. * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it.
Alexei Podtelezhnikov ffdac8d6 2021-08-19T20:41:55 Determine `long long` availability based on its size. MSVC, for example, used `long long` even without full C99 support. * include/freetype/config/ftstdlib.h: Check if `long long` limits are defined in <limits.h>. * include/freetype/config/integer-types.h: Check `long long` size and use it to typedef FT_Int64.
Alexei Podtelezhnikov 02ba0fc8 2021-08-18T23:27:48 Readily use `long long` as a 64-bit type in C99 mode. * include/freetype/config/integer-types.h (FT_INT64): FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`.
Alexei Podtelezhnikov 85703839 2021-08-18T23:05:51 Use FT_INT64 instead of FT_LONG64. * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64. * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/. * src/base/ftcalc.c: Ditto. * src/base/fttrigon.c: Ditto. * src/smooth/ftgrays.c: Ditto.
Werner Lemberg f11f3ed1 2021-08-18T06:54:34 [base] Fix ppem size overflow. Fixes #1086. * src/base/ftobjs.c (FT_Request_Metrics): Add return value. Check whether ppem values fit into unsigned short values. (FT_Request_Size): Updated. * include/freetype/internal/ftobjs.h: Updated. * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c (cid_size_request), src/truetype/ttdriver.c (tt_size_request), src/type1/t1objs.c (T1_Size_Request): Updated.
Dominik Röttsches e40ae756 2021-08-09T13:44:55 [sfnt] Add missing blend mode 'plus' to 'COLR' v1. * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode 'plus' after it was added to the spec.
Werner Lemberg 2c853b38 2021-08-08T00:22:34 include/freetype/freetype.h (FT_Encoding): Improve documentation. Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>.
Dominik Röttsches 47cf8ebf 2021-07-28T17:36:57 [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table. The optional 'COLR' v1 glyph-specific clip box helps upstream graphics libraries allocate a sufficiently large bitmap for a glyph without having to traverse the glyph graph for that. See https://github.com/googlefonts/colr-gradients-spec/issues/251 for background on the introduction of this specification change. * include/freetype/ftcolor.h (FT_ClipBox): New structure. (FT_Get_Color_Glyph_ClipBox): New function declaration. * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func): New function type. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it. * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API with SFNT implementation. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/ttcolr.c (Colr): New field `clip_list`. (tt_face_load_colr): Parse global clip list offset. (tt_face_get_color_glyph_clipbox): New function to find the clip box for a glyph id from the clip list array. * src/sfnt/ttcolr.h: Updated.
Dominik Röttsches 30a82e1e 2021-07-26T18:28:56 [sfnt] 'COLR' v1 PaintSweepGradient spec update * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other spec changes and now has the angles specified as F2DOT14, reflect that in the implementation. * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update documentation.
Dominik Röttsches 66189807 2021-07-26T17:32:22 [sfnt] 'COLR' v1 PaintSkew related spec updates * src/sfnt/ttcolr.c (read_paint): Implement spec changes around PaintSkew, PaintSkewAroundCenter. Update parsing to read shorter values as changed in the spec. * include/freetype/ftcolor.h (FT_PaintSkew): Update documentation.
Dominik Röttsches 48df0fa6 2021-07-23T19:02:51 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates * src/sfnt/ttcolr.c (read_paint): Implement spec change where PaintRotate and PaintRotateAroundCenter were split for a more compact format definition. Update parsing to read shorter values as changed in the spec. * include/freetype/ftcolor.h (FT_PaintRotate): Update documentation.
Werner Lemberg 801cd842 2021-07-18T07:53:57 * Version 2.11.0 released. ========================== Tag sources with `VER-2-11-0'. * docs/VERSION.TXT: Add entry for version 2.11.0. * docs/CHANGES: Updated. * README, src/base/ftver.rc, builds/windows/vc2010/index.html, builds/windows/visualc/index.html, builds/windows/visualce/index.html, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, docs/freetype-config.1: s/2.10.4/2.11.0/, s/2104/2110/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 11. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 24:0:18. * CMakeLists.txt (VERSION_MINOR): Set to 11. (VERSION_PATCH): Set to 0. * builds/toplevel.mk (dist): Ignore more git-related files.
Alex Richardson f7c6a06c 2021-07-12T13:58:10 Support architectures where `long` is smaller than pointers. I am currently trying to compile FreeType for CHERI-extended ISAs (CHERI-RISC-V and Arm's Morello), but I am getting compiler warnings from the `FT_UINT_TO_POINTER` macro. When compiling with the CHERI Clang compiler, not using `uinptr_t` for casts between integers an pointers results in the following `-Werror` build failures: ``` In file included from .../src/truetype/truetype.c:22: .../src/truetype/ttgload.c:1925:22: error: cast from provenance-free integer type to pointer type will give pointer that can not be dereferenced [-Werror,-Wcheri-capability-misuse] node->data = FT_UINT_TO_POINTER( glyph_index ); ^ .../include/freetype/internal/compiler-macros.h:79:34: note: expanded from macro 'FT_UINT_TO_POINTER' ``` * include/freetype/internal/compiler-macros.h (FT_UINT_TO_POINTER): The ISO C standard compliant fix for this would be to use `uintptr_t` from `stdint.h`, but I am not sure if this is supported by the minimum compiler version. Therefore, use the compiler-defined `__UINTPTR_TYPE__` macro (supported in GCC 4.6+ and Clang since about 3.0) before checking for `_WIN64` and falling back to `unsigned long`.
Oleg Oshmyan 5d27b10f 2021-07-13T10:59:32 [base] Fix `FT_Open_Face`'s handling of user-supplied streams. This was already true (though undocumented) most of the time, but not if `FT_NEW` inside `FT_Stream_New` failed or if the `FT_OPEN_XXX` flags were bad. Normally, `FT_Open_Face` calls `FT_Stream_New`, which returns the user-supplied stream unchanged, and in case of any subsequent error in `FT_Open_Face`, the stream is closed via `FT_Stream_Free`. Up to now, however, `FT_Stream_New` allocates a new stream even if it is already given one by the user. If this allocation fails, the user-supplied stream is not returned to `FT_Open_Face` and never closed. Moreover, the user cannot detect this situation: all they see is that `FT_Open_Face` returns `FT_Err_Out_Of_Memory`, but that can also happen after a different allocation fails within the main body of `FT_Open_Face`, when the user's stream has already been closed by `FT_Open_Face`. It is plausible that the user stream's `close` method frees memory allocated for the stream object itself, so the user cannot defensively free it upon `FT_Open_Face` failure lest it ends up doubly freed. All in all, this ends up leaking the memory/resources used by user's stream. Furthermore, `FT_Stream_New` simply returns an error if the `FT_OPEN_XXX` flags are unsupported, which can mean either an invalid combination of flags or a perfectly innocent `FT_OPEN_STREAM` on a FreeType build that lacks stream support. With this patch, the user-supplied stream is closed even in these cases, so the user can be sure that if `FT_Open_Face` failed, the stream is definitely closed. * src/base/ftobjs.c (FT_Stream_New): Don't allocate a buffer unnecessarily. Move error-handling code to make the control flow more obvious. Close user-supplied stream if the flags are unsupported. `FT_Stream_Open` always sets `pathname.pointer`, so remove the redundant (re)assignment. None of the `FT_Stream_Open...` functions uses `stream->memory`, so keep just one assignment at the end, shared among all possible control flow paths. ('Unsupported flags' that may need a stream closure can be either an invalid combination of multiple `FT_OPEN_XXX` mode flags or a clean `FT_OPEN_STREAM` flag on a FreeType build that lacks stream support.)
Oleg Oshmyan a4c8f21a 2021-07-13T10:44:38 [base] Reject combinations of incompatible `FT_OPEN_XXX` flags. The three modes are mutually exclusive, and the documentation of the `FT_OPEN_XXX` constants notes this. However, there was no check to validate this in the code, and the documentation on `FT_Open_Args` claimed that the corresponding bits were checked in a well-defined order, implying it was valid (if useless) to specify more than one. Ironically, this documented order did not agree with the actual code, so it could not be relied upon; hopefully, nobody did this and nobody will be hurt by the new validation. Even if multiple mode bits were allowed, they could cause memory leaks: if both `FT_OPEN_STREAM` and `stream` are set along with either `FT_OPEN_MEMORY` or `FT_OPEN_PATHNAME`, then `FT_Stream_New` allocated a new stream but `FT_Open_Face` marked it as an 'external' stream, so the stream object was never released. * src/base/ftobjs.c (FT_Stream_New): Reject incompatible `FT_OPEN_XXX` flags.
Anuj Verma e592982a 2021-07-13T10:00:22 [sdf] Improve documentation.
Werner Lemberg 205d1ae4 2021-07-12T22:03:25 Small clean-ups for the last few commits. * include/freetype/fttrace.h (afwarp): Removed.
David Turner 2f11522a 2021-06-02T19:05:09 Remove experimental auto-hinting 'warp' mode. This feature was always experimental, and probably nevery worked properly. This patch completely removes it from the source code, except for a documentation block describing it for historical purpose.
David Turner 15e88980 2021-06-02T18:54:41 Remove experimental "Latin2" writing system (FT_OPTION_AUTOFIT2) This code has always been experimental and was never compiled anyway (FT_OPTION_AUTOFIT2 does not appear in ftoption.h or even any of our build files).
Dominik Röttsches 286da6c5 2021-06-22T15:01:19 [sfnt] Support PaintScale in 'COLR' v1 parsing. * include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add `FT_COLR_PAINTFORMAT_SCALE`. (FT_PaintScale): New structure to represent 'PaintScale*' tables. (FT_COLR_Paint): Updated. * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration. (read_paint): Parse 'PaintScale' and friends.
Werner Lemberg 90ecac41 2021-06-30T10:23:42 Update `CHANGES` file; other minor doc fixes.
Werner Lemberg e1b1b542 2021-06-29T06:07:00 ftcolor.h: Minor grammar fix.
Werner Lemberg ff407765 2021-06-25T09:19:51 [base] Add trace level to logging output. Some practical debugging work has shown that displaying level X of an `FT_TRACEX` macro in the output of `FT2_DEBUG="... -v"` would be very helpful to find out which trace level should be selected. As an example, we now get output like ``` [ttobjs:2] TTF driver [ttobjs:2] SFNT driver [sfobjs:2] not a font using the SFNT container format [t1objs:2] Type 1 driver [stream:7] FT_Stream_EnterFrame: 14 bytes ``` * include/freetype/internal/ftdebug.h (FT_LOGGING_TAGX): New macro. (FT_LOG): Use it to add the trace level to the logging tag. * include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH): Adjust. * docs/DEBUG: Updated.
Werner Lemberg 1e65e605 2021-06-23T08:14:42 fterrors.h: Fix documentation extraction of `FT_Error_String`.
Dominik Röttsches 4cb21b9a 2021-06-22T20:50:48 [sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/. * include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat, FT_COLR_Paint): Do it to make it harmonize with other names such as 'PaintTranslate'. * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
Dominik Röttsches 284eec1e 2021-06-22T14:21:49 Move 'COLR' API to `ftcolor.h`. * include/freetype/freetype.h: Cut section layer managament containing 'COLR' v0 and v1 API and move it to `ftcolor.h` as requested by Werner on freetype-devel. * include/freetype/ftcolor.h: Paste that section.
Werner Lemberg bcd73f7d 2021-06-20T16:23:40 freetype.h: Mark 'COLR' v1 API as experimental.
Werner Lemberg 08f66322 2021-06-08T18:23:16 More various documentation improvements and fixes.
Werner Lemberg d586927d 2021-06-08T17:44:34 Various documentation improvements and fixes.
Werner Lemberg 36ee7171 2021-06-08T09:00:39 [sdf] Formatting and improved comments.
Anuj Verma 2b1d5562 2021-06-08T08:29:34 [sdf] Use 8 bits for final SDF output instead of 16bits. Since 8-bits is enough to represent SDF data we no longer require 16-bits for this purpose. Also, we now normalize the output data to use the entire 8-bit range efficiently. For example: if we use 3.5 format with a spread of 1 we basically only use the starting 5-bits. By normalizing we can use the entire 8-bit range. * include/freetype/freetype.h (FT_Render_Mode): Updated description for `FT_RENDER_MODE_SDF` regarding this change. * include/freetype/ftimage.h (FT_Pixel_Mode): Removed `FT_PIXEL_MODE_GRAY16` since no longer required. * include/freetype/fttypes.h (FT_F6Dot10): Removed since no longer required. * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Allocate 8-bit bitmap instead of 16-bit buffer. * src/sdf/ftsdfcommon.h (map_fixed_to_sdf): Added function to convert 16.16 distance value to our desired format. * src/sdf/ftsdf.c (sdf_generate_with_overlaps, sdf_generate_bounding_box): Use the new `map_fixed_to_sdf` function and also use 8-bit output buffer. * src/sdf/ftbsdf.c (finalize_sdf): Output to a 8-bit buffer instead of 16-bit buffer.
Werner Lemberg 0d1c306e 2021-05-25T11:27:56 [psaux] Guard and trace AFM kern data allocation. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31543 * include/freetype/internal/fttrace.h: Add 'afmparse' trace component. * src/psaux/afmparse.c (FT_COMPONENT): Define. (afm_parse_track_kern, afm_parse_kern_pairs): Protect against allocations bombs. Add tracing. (afm_parse_kern_data): Don't allow multiple kern data sections.
Alexei Podtelezhnikov 81852fbc 2021-05-18T22:18:17 Prioritize the anti-aliasing renderer module. * modules.cfg: Reorder the renderers. * include/freetype/config/ftmodule.h: Ditto.
Alexei Podtelezhnikov 02dec617 2021-04-18T10:24:31 Typo.
Werner Lemberg f7d7e7f9 2021-02-27T12:14:02 freetype.h: Documentation typos.
Dominik Röttsches 215ae253 2021-02-16T12:53:45 [sfnt] Update paint format values to support non-variable paints. * freetype.h (FT_PaintFormat): Update paint format identifiers after a specification change. The specification was updated to have sibling formats, variable and non-variable variants for each. Reflect that here. * sfnt/ttcolr.c (read_paint): Remove parsing of variable indices as the non-variable formats no longer have them.
Werner Lemberg d51452e3 2021-02-13T08:52:58 Add new function `FT_Get_Transform`. See https://github.com/harfbuzz/harfbuzz/issues/2428 for some reasons to introduce this function. * include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform): Implement it.
Werner Lemberg d93a0119 2021-02-13T07:50:04 Minor editing of last commit; formatting.
Alexei Podtelezhnikov 70fd20e6 2021-02-12T19:28:05 Decorate qsort callbacks with cdecl. * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Add new macro. * src/base/ftrfork.c, src/bdf/bdflib.c, src/gxvalid/gxvcommn.c, src/psaux/afmparse.c, src/psnames/psmodule.c, src/type1/t1afm.c, src/sfnt/sfwoff.c, src/sfnt/sfwoff2.c: Update qsort callbacks. Fixes #1026 when compiling FreeType with an unusual calling convention while the C library qsort still expects cdecl.
Dominik Röttsches 54c5ad5c 2021-02-10T19:24:13 [sfnt] Implement 'COLR' v1 sweep gradients. * freetype.h (FT_PaintSweepGradient): Add `FT_PaintSweepGradient` to represent a 'COLR' v1 sweep gradient. Update format. (FT_PaintFormat): Update shifted paint formats. Sync with spec. * sfnt/ttcolr.c (read_paint): Logic to parse sweep gradients. Fix struct access in radial gradient implementation.
Dominik Röttsches 64f01bfe 2021-01-20T13:04:50 [sfnt] Provide optional root transform for 'COLR' v1 glyph graph. * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): Additional function argument root_transform to control whether root transform should be returned. (FT_OpaquePaint): Additional tracking field to denote whether root transform is to be returned. * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func): Propagate additional argument. * src/base/ftobjs.c (FT_Get_Color_Glyph_Paint): Ditto. * src/sfnt/ttcolr.c (tt_face_get_colr_glyph_paint): Return root transform reflecting the size and tranform configured on FT_Face. (read_paint): Initialize and track status of insert_root_transform flag.
Werner Lemberg 324612ce 2021-01-31T14:28:44 Always provide logging API. It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to modify `ftexport.sym` conditionally. Problem reported by Alexei. * src/base/ftdebug.c: Include `ftlogging.h`. (FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler, FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs.
Werner Lemberg c7cc947c 2021-01-23T15:45:10 Minor documentation fixes.
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Dominik Röttsches 53fea877 2021-01-14T16:06:03 Add config option to test for 'COLR' v1 support in headers. * include/freetype/config/ftoption.h (TT_SUPPORT_COLRV1): New macro so that clients can test whether the FreeType checkout that they are building against supports the 'COLR' v1 API. This is intended to be a temporary solution until 'COLR' v1 support is released in a FreeType version and such a check can be made by using the version number instead.
Dominik Röttsches d3e95d97 2020-12-16T17:12:30 [sfnt] Register 'COLR' v1 API in driver (#59703). * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func, TT_Get_Paint_Layers_Func, TT_Get_Colorline_Stops_Func, TT_Get_Paint_Func): New function pointer types. (SFNT_Interface): Add them. (FT_DEFINE_SFNT_INTERFACE): Updated. * src/sfnt/sfdriver.c (PUT_COLOR_LAYERS_V1): New macro. (sfnt_interface): Add new function pointers.
Dominik Röttsches 08dba4dc 2020-12-16T16:14:19 Add new methods required for 'COLR' v1 to public API (#59703). * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): New method for retrieving the root paint object for a color glyph by specifying a glyph ID. (FT_Get_Paint_Layers): New method for retrieving the layers of a `PaintColorGlyph`. (FT_Get_ColorLine_Stops): New method for retrieving the stops of a color. (FT_Get_Paint): New method for resolving an `FT_OpaquePaint` into an `FT_COLR_Paint` object.
Dominik Röttsches f57c24db 2020-12-16T16:02:02 Add types required for 'COLR' v1 to public API (#59703). * include/freetype/freetype.h (FT_PaintFormat, FT_ColorStopIterator, FT_ColorIndex, FT_ColorStop, FT_PaintExtend, FT_ColorLine, FT_Affine23, FT_CompositeMode, FT_OpaquePaint, FT_PaintColrLayers, FT_PaintSolid, FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintGlyph, FT_PaintColrGlyph, FT_PaintTransformed, FT_PaintTranslate, FT_PaintRotate, FT_PaintSkew, FT_PaintComposite, FT_COLR_Paint): Adding structs and enum to represent paint format, color stop information, gradient extend information, structs to reference paint offsets, and to define transforms and compositions. Adding a union type to represent the union of the structs, distinguished by `FT_PaintFormat`.
Werner Lemberg cbc14b10 2021-01-07T10:13:15 Fix ABI incompatibility. * include/freetype/ftimage.h (FT_Pixel_Mode): Don't insert `FT_PIXEL_MODE_GRAY16' but append it. * src/base/ftobjs.c (pixel_modes): Updated.
Alexei Podtelezhnikov 6369058e 2021-01-07T00:13:23 [dlg] Move the headers to include/dlg to simplify their use. * autogen.sh, builds/toplevel.mk: Copy headers to incluide/dlg. * builds/freetype.mk, builds/windows/vc2010/freetype.vcxproj: Simplify included path. * include/freetype/internal/ftdebug.h: Simplify #include. * src/dlg/rules.mk, .gitignore: Updated.
Werner Lemberg bca740d5 2020-12-26T08:55:49 Typo.