summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Triage memory leak.truetype-mmAlexei Podtelezhnikov2023-03-061-0/+2
| | | | | | This leak has been introduced in the previous commit and immediately detected: https://chromium-review.googlesource.com/c/chromium/src/+/4313202
* [truetype] Simplify memory management.Alexei Podtelezhnikov2023-03-063-148/+64
| | | | | | | | | | | | Instead of using `Update_Max`, switch to regular FreeType memory allocation macros, stop pre-allocating the glyph instruction arrays. * src/truetype/ttgload.c (TT_Load_Simple_Glyph, TT_Process_Composite_Glyph): Switch to regular memory allocation. * src/truetype/ttinterp.c (Update_Max): Removed. (TT_Load_Context): Reallocate stack and free old instructions. (Modify_CVT_Check, Ins_WS): Switch to regular memory allocation. * src/truetype/ttinterp.h (Update_Max): Removed.
* Added information about the zlib version update in the changelogDavid PROVENT2023-03-061-0/+4
|
* Fix a couple of MSVC warnings.Alexei Podtelezhnikov2023-03-052-3/+3
| | | | | * src/base/ftcalc.c (FT_MulAddFix): Add cast. * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Ditto.
* * builds/windows/vc2010/freetype.vcxproj: Suppress C4267 on _WIN64.Alexei Podtelezhnikov2023-03-051-8/+8
| | | | | This usually comes from `strlen` returning 64-bit `size_t`, which we often assign to 32-bit `FT_ULong` on Windows-64 (LLP64).
* * src/cff/cffparse.c (cff_parser_run): Thinko.Alexei Podtelezhnikov2023-03-051-2/+2
|
* [cff] Clean up CharString number encoding.Alexei Podtelezhnikov2023-03-041-49/+18
| | | | * src/cff/cffparser.c (cff_parser_run): Work with signed numbers.
* * src/cff/cffparse.c (cff_parser_run): Fix variable type.Alexei Podtelezhnikov2023-03-041-1/+1
|
* [cff] Clean up memory management in the old engine.Alexei Podtelezhnikov2023-03-041-25/+13
| | | | | | | * src/cff/cffparse.c (finalize_t2_strings): Fix NULL-dereferencing in the out-of-memory situation, use `FT_FREE`. (cff_parser_run): Use FreeType memory allocation macros and avoid uninitialized pointers.
* * src/cff/cffobjs.c (cff_size_init): Synonymous change.Alexei Podtelezhnikov2023-03-041-4/+2
|
* * src/sfnt/sfobjs.c (sfnt_load_face): Shorten de-referencing.Alexei Podtelezhnikov2023-03-031-1/+1
|
* [pfr] Shorten de-referencing.Alexei Podtelezhnikov2023-03-032-5/+4
| | | | | * src/pfr/pfrobjs.c (pfr_face_done, pfr_face_init): Use closer `memory`. * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove `loader`.
* * src/cff/cffobjs.c (cff_size_get_globals_funcs): Shorten de-referencing.Alexei Podtelezhnikov2023-03-031-2/+2
|
* [cff,cid,type1] Shorten de-referencing.Alexei Podtelezhnikov2023-03-033-6/+3
| | | | | * src/cff/cffobjs.c (cff_clot_init): Use immediate library reference. * src/cid/cidobjs.c (cid_slot_init): Ditto. * src/type1/t1objs.c (T1_GlyphSlot_Init): Ditto.
* * configure: Use `sed` instead of `grep`.Alexei Podtelezhnikov2023-03-021-11/+2
| | | This is more portable and consistent with `autogen.sh`.
* Avoid strtol on non-null-terminated data.Ben Wagner2023-03-021-5/+11
| | | | | | | | | | | | | | | | | | | Technically, `strtol` can only be used with C strings terminated with `\0`. CID data is not generally null-terminated and often does not contain a `\0` if it is hex-encoded. AddressSanitizer with `ASAN_OPTIONS` containing `strict_string_checks=1` verifies this by using an adversarial `strtol` that always reads to the terminating `\0`. To avoid undefined behavior from `strtol` in `cid_parser_new`, use the parser to parse the tokens instead of attempting to parse them ad-hoc. This will internally use `PS_Conv_Strtol` to parse the integer, which respects the parser's limits and directly implements the PostScript parsing rules for integers. * src/cid/cidparse.c (cid_parser_new): Use the parser to parse the tokens. Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1420329
* * src/cff/cffload.c (cff_subfont_load): Synonymous update.Alexei Podtelezhnikov2023-03-021-1/+1
|
* * src/gzip/README.freetype: Update version.ubawurinna2023-03-011-1/+1
|
* [gzip] Fix static linking.ubawurinna2023-03-011-3/+2
| | | | | | | | Without this patch, static linking with MS Visual Studio causes linking errors. * src/gzip/ftgzip.c: Set `ZEXPORT` to nothing and `ZEXTERN` to static for all compilers.
* * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.Werner Lemberg2023-03-011-1/+1
| | | | | | This follows https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00200.html
* [truetype] Treat 38 as 40 without Infinality.Alexei Podtelezhnikov2023-02-272-7/+17
| | | | | * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Reinstate. * src/truetype/ttdriver.c (tt_property_set): Fallback from 38 to 40.
* * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.Werner Lemberg2023-02-261-2/+5
| | | | | | This follows https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00159.html
* * src/*: Replace leading underscores with trailing ones in dummy variables.Werner Lemberg2023-02-2619-19/+19
| | | | This is to avoid clang warnings.
* * configure: Don't hardcode `grep -E`.Karl Berry2023-02-261-2/+11
| | | | | | TeXLive still supports Solaris 5.10, where the system's `grep` doesn't accept the `-E` option. We thus introduce an `EGREP` variable that is set to either `grep -E` or `-egrep`.
* * src/cff/cffload.c (cff_encoding_load): Optimize array zeroing.Alexei Podtelezhnikov2023-02-251-7/+4
| | | | | | This is unnecessary for predefined standard and expert encodings. Even for custom encodings the arrays might be already zeroed when CFF_FontRec is created but we keep it just in case.
* * src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing.Alexei Podtelezhnikov2023-02-251-5/+4
|
* * src/base/ftsystem.c (ft_ansi_stream_io): Avoid undefined behaviour.Tamir Duberstein2023-02-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also short-circuit on `offset` to avoid checking `count` a second time when `ft_ansi_stream_io` is used for reading. Per ISO/IEC 9899: If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or apointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined. If a function argument is described as being an array, the pointer actually passed to the function shall have a value such that all address computations and accesses to objects (that would be valid if the pointer did point to the first element of such an array) are in fact valid. Per IEEE Std 1003.1: size_t fread(void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream); The `fread` function shall read into the array pointed to by `ptr` up to `nitems` elements whose size is specified by `size` in bytes, from the stream pointed to by `stream`. Since the first argument to `fread` is described as being an array, its behavior is undefined when that argument is a null pointer. Per the documentation on `ft_ansi_stream_io`: If `count' is zero (this is, the function is used for seeking), a non-zero return value indicates an error. Thus the intent is clear, and the call to `fread` can be skipped, avoiding undefined behaviour.
* [raster] Clean up contour indexing.Alexei Podtelezhnikov2023-02-211-12/+10
| | | | * src/raster/ftraster.c (Decompose_Curve, Convert_Glyph): Use consistent index types (Int) and compact iterations.
* [autofit] Clean up contour indexing.Alexei Podtelezhnikov2023-02-202-18/+13
| | | | | * src/autofit/aflatin.c (af_latin_metrics_init_blues): Refactor. * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Ditto.
* * src/base/ftoutln.c (FT_Outline_Check): Fix C4701 warning.Alexei Podtelezhnikov2023-02-201-1/+1
|
* * src/sdf/ftsdf.c (get_min_distance_cubic): Fix C4701, typos.Alexei Podtelezhnikov2023-02-201-4/+5
|
* * src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing.Alexei Podtelezhnikov2023-02-201-13/+8
|
* [base] Clean up contour indexing.Alexei Podtelezhnikov2023-02-202-37/+28
| | | | | | * src/base/ftoutln.c (FT_Outline_Reverse, FT_Outline_EmboldenXY, FT_Outline_Get_Orientation): Set the first and last indexes together. (FT_Outline_Decompose): Ditto and check them more stringently. * src/smooth/ftgrays.c (FT_Outline_Decompose)[STANDALONE_]: Ditto.
* * src/base/ftoutln.c (FT_Outline_Check): Update error code, clean up.Alexei Podtelezhnikov2023-02-201-2/+2
|
* [truetype] Hide Infinality.Alexei Podtelezhnikov2023-02-173-86/+17
| | | | | | | | Remove Infinality as an option before its complete extraction. * include/freetype/ftoption.h: Remove the Infinality option. * devel/ftoption.h: Ditto. * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Is 40 now.
* * src/base/ftoutln.c (FT_Outline_Reverse): Anchor first contour points.Alex Ringlein2023-02-161-0/+4
| | | | | | | A cubic contour has to always start from an on-point. Therefore, we should not swap the first with the last point, which might be off, and obtain an invalid contour. This does not matter for conic contours. If anything, it also saves one swap there. Fixes #1207.
* Documentation improvement for `FT_Bitmap`.Werner Lemberg2023-02-161-1/+7
| | | | Fixes #1205.
* [type1/MM] Round design coordinates.Alexei Podtelezhnikov2023-02-102-10/+11
| | | | | | | | | | The design coordinates for MM fonts were not rounded. For example, `FT_Get_Var_Design_Coordinates` returned values with fractional part. * src/type1/t1load.c (mm_axis_unmap): Refactor with rounding. * include/freetype/ftmm.h (FT_Var_Axis, FT_Set_Var_Design_Coordinates, FT_Get_Var_Design_Coordinates): Reword documentation.
* * builds/meson/parse_modules_cfg.py: Handle `gxvalid` and `otvalid`.Jan Alexander Steffens (heftig)2023-02-091-1/+5
| | | | | These need a name mapping similar to what was done for other modules, or linking will fail.
* * build/toplevel.mk (do_dist): Fix typo.Werner Lemberg2023-02-091-1/+1
|
* * Version 2.13 released.VER-2-13-0Werner Lemberg2023-02-0914-24/+27
| | | | | | | | | | | | | | | | | | | | | ========================== Tag sources with `VER-2-13-0'. * docs/VERSION.TXT: Add entry for version 2.13. * 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.12.1/2.13/, s/2121/2130/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 13. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 25:0:19. * CMakeLists.txt (VERSION_MINOR): Set to 13. (VERSION_PATCH): Set to 0.
* Comment on `FT_GlyphSlot_Slant'.Alexei Podtelezhnikov2023-02-091-1/+3
|
* [autofit] Fix 'multi' compilation.Werner Lemberg2023-02-083-5/+26
| | | | | | | | | | * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`. Add ANSI boilerplate code for otherwise empty file. * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`. Use `FT_BEGIN_HEADER` and `FT_END_HEADER`. Decorate with `FT_LOCAL`. * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
* Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags.Werner Lemberg2023-02-089-10/+11
|
* Fix 'fall-through' warning messages.Werner Lemberg2023-02-0810-39/+53
| | | | | | | Modern compilers get more insistent on that... * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define. * src/*: Use it instead of `/* fall through */` comments.
* For debugging, avoid implicit conversion from integer to double.Werner Lemberg2023-02-0811-168/+203
| | | | | | | | | | Otherwise we get zillions of clang 15 warnings. * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c, src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c, src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use `double` cast in debugging and tracing macros.
* Avoid reserved identifiers that are globally defined.Werner Lemberg2023-02-0815-219/+239
| | | | | | | | | | | This is mandated by the C99 standard, and clang 15 produces zillions of warnings otherwise. * devel/ftoption.h, include/freetype/config/ftoption.h, include/freetype/internal/ftmemory.h, src/autofit/afhints.h, src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
* Fix minor clang and clang++ warnings.Werner Lemberg2023-02-084-8/+8
|
* [truetype, type1] Additional variation tags.Alexei Podtelezhnikov2023-02-083-0/+7
| | | | | | | | | Sync with https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags * src/truetype/ttgxvar.h (TTAG_ital): New tag. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it. * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.
* * src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant.Alexei Podtelezhnikov2023-02-072-6/+9
| | | | * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.