summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* .gitlab-ci.yml: Update Windows image.Werner Lemberg2022-01-111-1/+2
| | | | | | | | | | | | | | | The old image produced errors like ``` Downloading zlib patch from https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch A fallback URL could be specified using patch_fallback_url key in the wrap file WrapDB connection failed to https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch with error <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1122)> ```
* * subprojects/zlib.wrap: Update from upstream.Werner Lemberg2022-01-111-1/+1
|
* * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks.Werner Lemberg2022-01-101-3/+20
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716
* [zlib] Don't typedef `ptrdiff_t`.Werner Lemberg2022-01-102-4/+16
| | | | | | | | | | | | While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually include some standard header files, making the typedef fail on systems where the native `ptrdiff_t` type differs. Fixes #1124. * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows. * src/zlib/patches/freetype-zlib.diff: Updated.
* [zlib] Some organizational changes.Werner Lemberg2022-01-104-111/+78
| | | | | | | | | | | | | | | | | We now first apply zlib's `zlib2ansi` script, then FreeType's patch file. * src/gzip/README.freetype: Updated. * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed to... * patches/freetype-zlib.diff: This. Clean up description, then regenerate it as follows: - Copy unmodified files from `zlib` repository. - Run `zlib2ansi` script. - Run `git diff -R > patches/freetype-zlib.diff.new`. - Insert patch description of old diff file, then replace old diff with new diff file.
* [gzip] Update sources to zlib 1.2.11David Turner2022-01-0926-2512/+7057
| | | | | | | | | | | | | | | | | | | | | | | | | | | This can be tested by building with the Unix development build make setup devel make or by building the freetype-demos programs with meson setup build -Dfreetype2:zlib=internal meson compile -C out and trying to run `ftview` with a `.pcf.gz` font file. * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also remove the temporary fix introduced in commit 6a431038 to work around the fact that the internal sources were too old. * src/gzip/README.freetype: New file describing the origin of the sources and how they were modified. * src/gzip/patches/*: Patch files applied to original sources. * src/gzip/*: Updated zlib sources with the patch file(s) from `src/gzip/patches/` applied, followed by a conversion with zlib's `zlib2ansi` script.
* [meson] Change Zlib configuration option.David Turner2022-01-092-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | | * meson_options.txt, meson.build: Change the format of the 'zlib' meson build configuration option to be a combo with the following choices: - none: Do not support gzip-compressed streams at all. - internal: Support gzip-compressed streams using the copy of the gzip sources under `src/gzip/`; this should only be used during development to ensure these work properly. - external: Support gzip-compressed streams using the 'zlib' Meson subproject, linked as a static library. - system: Support gzip-compressed streams using a system-installed version of zlib. - auto: Support gzip-compressed streams using a system-installed version of zlib, if available, or using the 'zlib' subproject otherwise. This is the default. - disabled: Backward-compatible alias for 'none'. - enabled: Backward-compatible alias for 'auto'.
* [bzip2] Avoid use of uninitialized memory.Werner Lemberg2022-01-091-1/+3
| | | | | | | | | | * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but `FT_NEW` for setting up `zip` to avoid uninitialized memory access while handling malformed PCF fonts later on. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800
* [sfnt] Fix off-by-one error.Alexei Podtelezhnikov2022-01-081-1/+0
| | | | | | | | | | The 0-base index is equal to the number of previosly parsed entries. It is an error to adjust it by one to get the number truncated by a stream error. This is probably inconsequential because valid entries are correctly accounted for. * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated number of tables.
* [sfnt, type42] Correct previous commit.Werner Lemberg2022-01-082-4/+11
| | | | | | | | | | Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773. * src/sfnt/ttload.c (check_table_dir): Revert change. * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access while handling malformed TrueType fonts later on.
* * src/sfnt/ttload.c (check_table_dir): Initialize `table`.Werner Lemberg2022-01-071-1/+1
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773
* [sfnt] Avoid 'runtime error: applying zero offset to null pointer'.Werner Lemberg2022-01-071-0/+3
| | | | | * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if `line` is NULL.
* [autofit, pshinter] Use `FT_OFFSET`.Werner Lemberg2022-01-074-14/+14
| | | | | | | | | | | | | | | | | | | | | | | This avoids ``` runtime error: applying zero offset to null pointer ``` warnings of clang's undefined behaviour sanitizer. * src/autofit/afcjk.c (af_cjk_hints_link_segments, af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges, af_cjk_hint_edges, af_cjk_align_edge_points): Do it. * src/autofit/afhints.c (af_glyph_hints_align_edge_points, af_glyph_hints_align_strong_points): Ditto. * src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_hints_link_segments, af_latin_hints_compute_edges, af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto. * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto.
* [truetype] Reset localpoints when varying cvt.Ben Wagner2022-01-061-0/+1
| | | | | | | | | | | | | | When iterating over the cvt tuples and reading in the points it is necessary to set all of `localpoints`, `points`, and `point_count` in all cases. The existing code did not reset `localpoints` to `NULL` when there were no private point numbers. If the previous tuple did have private point numbers and set `localpoints` to `ALL_POINTS` this would not be cleared and the wrong branch would be taken later, leading to possible heap buffer overflow. * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL` when it isn't valid. Fixes: https://crbug.com/1284742
* * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable.Werner Lemberg2022-01-023-0/+14
| | | | This was accidentally removed with commit 93ebcbd0 almost eight years ago.
* Fix warnings for CMake Unity builds.Alexander Borsuk2021-12-272-0/+3
| | | | | * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition. * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto.
* Clang-Tidy warning fixes.Alexander Borsuk2021-12-184-5/+4
| | | | | | | | * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands. * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read. * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is never read. * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read.
* * meson.build: Optimize lookup for `python3` program.Eli Schwartz2021-12-171-2/+1
| | | | | | | | | | | | | | | | | The python module's `find_installation` method is intended to provide routines for compiling and installing python modules into the `site-packages` directory. It does a couple of slow things, including run an introspection command to scrape sysconfig info from the detected interpreter, which are not needed for the sole use case of invoking the found installation as an executable. Furthermore, when invoked without the name or path of a python binary, it is hardcoded to always look for `python3` corresponding to the interpreter meson itself uses to run. So using `find_installation` did not even allow detecting `python2` as a fallback. Instead, switch to a simple `find_program` lookup that finishes as soon as the program is found.
* * builds/meson/*.py: Fix name of python executable for auxiliary scripts.Eli Schwartz2021-12-175-5/+5
| | | | | | | | | | | | | | The previous change to check the return code of `run_command` invocations caused the CI to fail. Although most scripts used `python_exe` as the program command, the script to determine the project version did not. But, all scripts used `python` as the shebang, and this is not available on all systems. Particularly Debian does not provide a `python` command, though `python3` does exist. This meant that formerly the version number was lacking, and now the build simply fails. Instead, rely on `python3` since it is guaranteed to exist when running meson, and `python2` is end of life anyway.
* * meson.build: Check the return value of `run_command`.Eli Schwartz2021-12-171-6/+12
| | | | | | | | | | | By default, errors are not checked and a command that is somehow broken will just capture incorrect output (likely an empty string). Current development versions of meson now raise a warning for this implicit behavior, and advise explicitly setting the `check:` keyword argumend to determine whether a failing return code should be considered an error. Since none of the commands in this project are expected to fail, mark them as required to succeed.
* [truetype] Upstream the hdmx binary search.Alexei Podtelezhnikov2021-12-133-3/+5
| | | | | | | | | * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx widths. * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even though it might never be used by the interpreter. * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches in the hdmx table.
* [truetype] Reset the IUP-called flags for each subglyph.Alexei Podtelezhnikov2021-12-122-5/+8
| | | | | | | | | This fixes fall-out from 7809007a5b88b15, where the composite accents were no longer hinted. * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag initialization from here... * src/truetype/ttinterp.c (TT_Run_Context): ... to here.
* [truetype] Binary search through the `hdmx` records.Alexei Podtelezhnikov2021-12-112-20/+36
| | | | | | | | | | | | | 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.
* [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable.Alexei Podtelezhnikov2021-12-111-0/+10
| | | | | | | | | This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY is specified by FT_Get_Advances and the `hdmx` data are located. Particularly, the classic v35 interpreter or "verified" ClearType fonts might see 100x speed up in retrieving the hdmx cache. * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut.
* [truetype] Initialize the loader with `hdmx` data.Alexei Podtelezhnikov2021-12-112-35/+33
| | | | | | | | | 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.
* [truetype] Relocate subpixel flag setting.Alexei Podtelezhnikov2021-12-112-31/+29
| | | | | | | | | | `TT_RunIns` is too busy to deal with subpixel flags. It is better to set them in `tt_loader_init`, which is executed before each glyph program. * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from here... * src/truetype/ttgload.c (tt_loader_init): ... to here.
* [truetype] Limit INSTCTRL appication within specs.Alexei Podtelezhnikov2021-12-111-4/+11
| | | | | | | | * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects to the CVT program and local effects to the glyph program. This also fixes an Infinality buglet. The `ignore_x_mode` should be locally unset by the glyph program.
* [bdf] Fix use of uninitialized value.Ben Wagner2021-12-091-2/+1
| | | | | | | | | | | | | | | | | | In _bdf_readstream if the data contained no newline then the buffer would continue to grow and uninitialized data read until either the uninitialized data contained a newline or the buffer reached its maxiumum size. The assumption was that the line was always too long and the buffer had been filled, however this case can also happen when there is not enough data to fill the buffer. Correct this by properly setting the cursor to the end of the available data, which may be different from the end of the buffer. This may still result in one extra allocation, but only on malformed fonts. * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove unread set of `avail`. Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html
* [truetype] Reduce Infinality footprint again.Alexei Podtelezhnikov2021-12-071-28/+12
| | | | | * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and prioritize the Infinality checks to use `hdmx`.
* [builds/windows] Guard some non-ancient API.Cameron Cawley2021-12-062-1/+11
| | | | | | | We can support Windows 98 and NT 4.0 in principle... * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT.
* * builds/windows/visualc/freetype.vcproj: Add missing file.Cameron Cawley2021-12-061-0/+4
|
* * Version 2.11.1 released.VER-2-11-1Werner Lemberg2021-12-0214-27/+33
| | | | | | | | | | | | | | | | | | | | | | ========================== 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.
* [builds/windows] Improve debugging.Alexei Podtelezhnikov2021-11-291-13/+48
| | | | | | * builds/windows/ftdebug.c (FT_Message, FT_Panic): Buffer output and call `OutputDebugStringA` only if `IsDebuggerPresent`. [_WIN32_WCE] (OutputDebugStringA): Implement the missing API.
* * src/base/ftobjs.c (FT_Request_Metrics): Fix build warning on Android.Seigo Nonaka2021-11-291-2/+2
| | | | | Use casts since `FT_USHORT_MAX` is unsigned short in bionic (libc used in Android).
* * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Minor tweak.Alexei Podtelezhnikov2021-11-271-1/+1
|
* * src/truetype/ttpload.c (tt_face_load_hdmx): Added comments.Alexei Podtelezhnikov2021-11-261-5/+8
|
* [truetype] Quietly reject out-of-spec `hdmx` tables.Alexei Podtelezhnikov2021-11-251-11/+15
| | | | | | | | | The `hdmx` table is optional and can be safely rejected without an error if it does not follow specifications. The record size must be equal to the number of glyphs + 2 + 32-bit padding. * src/truetype/ttpload.c (tt_face_load_hdmx): Thoroughly check the record size and improve tracing.
* [truetype] Partly revert 5b626281.Alexei Podtelezhnikov2021-11-231-1/+1
| | | | | | | Fixes #1118. * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that `record_size` is rounded even though the records are padded.
* * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Use transforms.Alexei Podtelezhnikov2021-11-231-8/+11
|
* Update `CHANGES` files, other minor whitespace and documentation issues.Werner Lemberg2021-11-229-39/+59
|
* formats.txt: Add info about WOFF and WOFF2.Werner Lemberg2021-11-211-3/+12
|
* meson.build: Initialize `common_ldflags`.Werner Lemberg2021-11-211-2/+4
|
* * meson.build: Fix compatibility version on MacOS.Lukas Oberhuber2021-11-211-0/+15
| | | | Fixes #1117.
* * src/truetype/ttinterp.c (Ins_MD): Avoid `FT_ABS`.Werner Lemberg2021-11-211-3/+3
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38562
* * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting.Alexei Podtelezhnikov2021-11-201-7/+5
|
* [gxvalid] Fix minor compilation warning.Werner Lemberg2021-11-201-1/+1
| | | | | * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup): Declare as static.
* [smooth] Fix stand-alone compilation.Werner Lemberg2021-11-201-1/+4
| | | | | * src/smooth/ftgrays.c (FT_Trace_Enable, FT_Trace_Disable)[STANDALONE_]: Define.
* Avoid undefined left-shifts.Werner Lemberg2021-11-207-34/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Provide C++ versions for public macros with casts.Werner Lemberg2021-11-186-26/+43
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix clang++ warnings.Werner Lemberg2021-11-169-16/+16
| | | | * src/*: Initialize some variables to NULL.