summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* * Version 2.12.0 released.VER-2-12-0Werner Lemberg2022-03-3115-28/+54
| | | | | | | | | | | | | | | | | | | | | | | | ========================== Tag sources with `VER-2-12-0'. * docs/VERSION.TXT: Add entry for version 2.12.0. * 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.1/2.12.0/, s/2111/2120/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 24:2:18. * CMakeLists.txt (VERSION_MINOR): Set to 12. (VERSION_PATCH): Set to 0. * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits since version 2.11.0 (when we stopped creating this file manually).
* Fix clang++ warnings.Werner Lemberg2022-03-319-11/+11
| | | | | | | | | | | | | * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize variables used for allocation. * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of `max_splits` to FT_UInt. (sdf_generate_bounding_box): Add cast.
* Whitespace.Werner Lemberg2022-03-301-31/+33
|
* [builds] Fix creation of `freetype2.pc` for static-only builds.Werner Lemberg2022-03-303-45/+67
| | | | | | | | | | | | | | | We have to help `pkg-config` since it can't recognize that there is no shared library installed. Note that meson already does exactly the same. * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to... (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them depending on `$enable_shared`. (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables. * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated variables.
* Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`.Werner Lemberg2022-03-252-10/+93
| | | | | | | | * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY, FT_HAS_SBIX_OVERLAY): New macro. * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`. Remove obsolete tracing message.
* Add `FT_PARAM_TAG_IGNORE_SBIX`.Werner Lemberg2022-03-252-17/+50
| | | | | | | | | | | | | This is another bit to handle 'sbix' tables as described in the OpenType specification. * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... (has_sbix): ... this. Check for more sbit tables. Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. Only call sbit table loader if an sbit table is present.
* [truetype] Fix 'sbix' table handling.Werner Lemberg2022-03-254-15/+63
| | | | | | | | | | | | | | | | | * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of 'metrics->horiBearingY'. Set vertical metrics. * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`. Handle metrics of fonts with 'sbix' table. * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply bbox offset and bearing values of the corresponding glyph in the 'glyf' table if it exists and has a contour. * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table. Fixes issue #998.
* Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.Werner Lemberg2022-03-252-0/+30
| | | | | | | | | Fonts with 'sbix' tables need special handling by the application. * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' table is present.
* * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.Werner Lemberg2022-03-251-1/+11
|
* [builds/windows] Fix WCE support.Carlo Bramini2022-03-231-0/+2
| | | | | * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by _alloca.
* [build/windows] Improve UWP support.Steve Lhomme2022-03-231-6/+44
| | | | * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA.
* * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table.Werner Lemberg2022-03-211-2/+8
| | | | Fixes #1141.
* [woff2] Support overlap flag for simple glyphs.Ben Wagner2022-03-202-9/+51
| | | | | | | | | | | | | In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag to be retained through the woff2 format [0]. [0] https://www.w3.org/TR/WOFF2/#glyf_table_format * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag. * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's flag if the overlap bit is set.
* [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`.Werner Lemberg2022-03-191-2/+10
| | | | | * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro. (cff_slot_load): Use it.
* * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`.Werner Lemberg2022-03-191-0/+3
| | | | Fixes #1140.
* * src/base/ftobjs.c (ft_open_face_internal): Thinko.Werner Lemberg2022-03-191-0/+1
|
* [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3.Ben Wagner2022-03-191-5/+5
| | | | * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
* * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`.Werner Lemberg2022-03-191-0/+9
| | | | | | We must ensure that the cast to `FT_Int` doesn't change the sign. Fixes #1139.
* [sfnt] Avoid invalid face index.Werner Lemberg2022-03-172-2/+2
| | | | | | | Fixes #1138. * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): Check `face_index` before decrementing.
* Documentation, whitespace.Werner Lemberg2022-03-072-4/+14
|
* [sdf] Fix corner checks and improve performance.Anuj Verma2022-03-051-6/+23
| | | | | | | | * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if two distances (for different curves) are very close. (sdf_conic_to): Check whether the conic curve can be treated as a line (which happens if the control point coincides with any end point).
* [sdf] Implement deviation-based splitting for Bezier curves.Anuj Verma2022-03-052-9/+45
| | | | | | | | * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure out the deviation of Bezier curves and stop splitting if the curve is flat enough. * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro.
* * include/freetype/freetype.h: Improve SDF documentation.Anuj Verma2022-03-051-0/+38
|
* [sfnt] Fix bounds check in SVG.Ben Wagner2022-03-031-5/+5
| | | | | | | | | | | | | | The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not protected by parentheses. As a result, the expression `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect bounds check which may lead to reading past the end of the `SVG ` table. * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in parentheses. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179
* [psaux] Full bounds check for OtherSubr 19.Ben Wagner2022-02-231-7/+9
| | | | | | | | | | | | | | | | | | | | | | | It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with `blend->num_designs` set to 2, and the user supplied `idx` to be large (for example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds check overflows in a well defined manner, allowing for an invalid call to `memcpy`. In addition, it is possible to call OtherSubr 19 with `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes the bounds check (it is logically always fine to copy nothing starting at index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is undefined behavior (even if `count` is zero). * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that `blend->num_designs` can be copied to `decoder->buildchar[idx]`. Also avoid passing NULL to `ft_memcpy`. Bug: https://crbug.com/1299259
* [cmake] Drop the support of CMake 2.x.suzuki toshiya2022-02-211-4/+3
| | | | | | | | | | | * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer. The issue #1059 reports the difficulty to support both of CMake 2.x and newer one by single CMakeLists.txt without the inflation of cmake_policy() workarounds. For better maintainability, the support of CMake 2.x is dropped.
* * src/bdf/README: Updated.Werner Lemberg2022-02-191-1/+5
|
* * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|.Werner Lemberg2022-02-192-2/+2
|
* src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.Werner Lemberg2022-02-191-4/+5
| | | | | | A kerning table can be handled by binary search if it has equal entries. Fixes #1132.
* [builds/windows] Add support for legacy UWP builds.Steve Lhomme2022-02-171-1/+19
| | | | | | | | | * builds/windows/ftsystem.c: Add neccessary macro substitutions to enable strict UWP builds. See !141. Co-authored-by: Alexei Podtelezhnikov <apodtele@gmail.com>
* ftmm.h: Minor documentation improvement.Werner Lemberg2022-02-161-0/+3
|
* [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value.Alexei Podtelezhnikov2022-02-121-2/+3
| | | | | | | | | Before the change, the hinting engine frequently confused horizontal stem and serif hints making some stems too thin and some serifs too thick. The value was tuned using serif fonts from the URW+ base 35 collection. * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/.
* t1tables.h: Documentation improvements.Werner Lemberg2022-02-121-8/+28
|
* t1tables.h: Whitespace.Werner Lemberg2022-02-121-73/+73
|
* [type42] Fix `FT_Get_PS_Font_Private` for this format.Werner Lemberg2022-02-111-11/+2
| | | | | | | | Since Type42 fonts don't have a 'Private' dictionary, the return value should be `FT_Err_Invalid_Argument`. * src/type42/t42drivr.c (t42_ps_get_font_private): Removed. (t42_service_ps_info): Updated.
* [pshinter] Clear reused mask. Alexei Podtelezhnikov2022-02-091-0/+4
| | | | | | In PS hinter, memory allocations persist until the module is done. Therefore, we have to clear reused masks. * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask.
* [pshinter] Use unsigned indices. Alexei Podtelezhnikov2022-02-091-32/+20
| | | | | | | | This reduces casting and eliminates some checks. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge, ps_dimension_add_t1stem, ps_hints_t1stem3): Updated. (ps_dimension_add_counter): Updated, unnecessary checks removed.
* [pshinter] Fix mask merging.Alexei Podtelezhnikov2022-02-081-21/+5
| | | | | | | | | | | We forgot to update the number of bits when merging a larger mask into a smaller one. This fix might have rendering effects. * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number of bits from a larger mask. There is no need to zero unused bits, already zeroed during allocation. (ps_mask_clear_bit): Removed. (ps_mask_ensure): Minor.
* [pshinter] Revise the hint table handling. Alexei Podtelezhnikov2022-02-081-13/+8
| | | | | | | * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size check; avoid array zeroing because it is fully initialized when used. (ps_hint_table_alloc): Fix off-by-one comparison and remove another zeroing of the array elements.
* Various minor doc fixes.Werner Lemberg2022-02-062-5/+6
|
* [builds/windows] Add SVG to to project files.Alexei Podtelezhnikov2022-02-063-1/+9
| | | | | | * builds/windows/vc2010/freetype.vcxproj: Updated. * builds/windows/vc2010/freetype.vcxproj.filters: Updated. * builds/windows/visualc/freetype.vcproj: Updated.
* * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources.Alexei Podtelezhnikov2022-02-031-0/+4
|
* [cmake] Fix build on MacOS.Eric Jing2022-02-022-2/+2
| | | | | | | | | | * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building of a framework on MacOS. * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier lowercase only. Fixes #1127.
* [psaux] Revise `PS_Table` handling.Alexei Podtelezhnikov2022-02-021-50/+18
| | | | | | | | | | | | The old impleemntation was not using `FT_REALLOC`, buing too careful with the offset rebasing. It shoudl be safe to rely on the base movements. * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine into... (ps_table_realloc): ... this function based on `FT_REALLOC`. (ps_table_done): Simplified. (ps_table_add): Updated.
* * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing.Alexei Podtelezhnikov2022-02-021-0/+2
|
* [cache] Partially revert 9870b6c07e2c. Alexei Podtelezhnikov2022-01-311-1/+1
| | | | | Fix crashes reported by Werner. * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again.
* freetype.h: Minor documentation improvement.Werner Lemberg2022-01-311-5/+6
|
* [cache] Fix fallouts from edd4fedc5427.Alexei Podtelezhnikov2022-01-302-1/+4
| | | | | | | Reported by Werner. * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph. * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit.
* Clean-up - do not doubt FT_FREE.Alexei Podtelezhnikov2022-01-305-7/+0
| | | | | | | | | | * src/base/ftobjs.c (memory_stream_close): Do not reassign zero after `FT_FREE`. * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto. * src/sfnt/sfwoff2.c (stream_close): Ditto. * src/psaux/psobjs.c (ps_parser_load_field): Ditto. * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend, tt_set_mm_blend): Ditto.
* * CMakeLists.txt: Include 'FindPkgConfig' module.Werner Lemberg2022-01-301-0/+1
| | | | | | Older cmake versions don't provide `pkg_check_modules` by default. Fixes #1126.