summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [truetype] Hide Infinality.apodtele-master-patch-68578Alexei 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. * inclide/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.
* [sdf] Use 32-bit integers internally.anuj2023-02-071-2/+2
| | | | | | * src/sdf/ftsdfcommon.h (FT_16D16, FT_26D6): Use 32-bit integers instead of `FT_Fixed` for internal data types. `FT_Fixed` i.e. `signed long` is 64-bit on some architectures.
* docs/CHANGES: Updated.Werner Lemberg2023-02-071-0/+2
|
* Comment on optional ascender and descender.Alexei Podtelezhnikov2023-02-041-2/+2
|
* * src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.Alexei Podtelezhnikov2023-02-041-1/+2
|
* * src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender.Alexei Podtelezhnikov2023-02-041-3/+7
| | | | | The ascender and descender are optional in the AFM specifications. They could be omitted or even set to zero, e.g., in the current release of URW++ base 35 fonts.
* * src/cff/cffgload.c (cff_slot_load): Avoid memory leak.Werner Lemberg2023-02-021-4/+5
| | | | Fixes issue #1204.
* * src/truetype/ttgxvar.c (tt_var_get_item_delta): Check `face->blend`.Werner Lemberg2023-02-011-6/+6
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55581
* * docs/CHANGES: Add news for 'freetype-demos'.Werner Lemberg2023-02-011-0/+13
|
* * subprojects/harfbuzz.wrap, subprojects/libpng.wrap: Updated.Werner Lemberg2023-01-302-14/+14
|
* Minor changes.Werner Lemberg2023-01-285-22/+26
| | | | Comment fixes, typos, removing of unnecessary parentheses.
* Whitespace.Werner Lemberg2023-01-286-53/+58
|
* [ttgxvar] Fix crash in COLRv1.Behdad Esfahbod2023-01-271-0/+3
| | | | | | This is a stopgap until issue #1202 is properly fixed. * src/truetype/ttxgvar.c (tt_var_get_item_delta): Check `normalizedcoords`.
* The 'COLR' v1 API will no longer be experimental in the next release.Werner Lemberg2023-01-192-91/+34
|
* * docs/oldlogs/ChangeLog.210: Typos.Alexei Podtelezhnikov2023-01-181-16/+16
|
* [base] Fix typo.Ben Wagner2023-01-181-1/+1
| | | | | * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Request module 't1cid', not 'cid'.
* [base] Return error if requested driver is not found.Ben Wagner2023-01-181-9/+16
| | | | | | | | | | In `open_face_from_buffer` it is possible that a driver is requested but FreeType was built without the requested module. Return an error in this case to indicate that the request could not be satisfied, rather than trying all existing driver modules. * src/base/ftobjs.c (open_face_from_buffer): Return `FT_Err_Missing_Module` if a driver is specified but not found.
* [sfnt] Avoid nullptr dereference in reading malformed 'COLR' v1 table.Dominik Röttsches2023-01-181-1/+1
| | | | | | | Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1408044. * src/sfnt/ttcolr.c (tt_face_load_colr): When the 'COLR' v1 table header is too small, don't deallocate delta set index map structures.
* * src/tools/update-copyright: Allow execution from other repositories.Werner Lemberg2023-01-171-2/+2
| | | | We use this for `freetype-demos`.
* Update all copyright notices.Werner Lemberg2023-01-17582-582/+582
|
* * src/tools/no-copyright: Updated.Werner Lemberg2023-01-171-4/+5
|
* [base] 'close' callback may not use `stream->memory`.Ben Wagner2023-01-171-2/+3
| | | | | | | | | | | The documentation for `FT_StreamRec::memory` states that it 'shouldn't be touched by stream implementations'. This is true even for internal implementations of the 'close' callback, since it is not guaranteed that `memory` will even be set when the 'close' callback occurs. * src/base/ftobjs.c (new_memory_stream): stash current `memory` in `stream->descriptor`. (memory_stream_close): Use it.
* [base] Always close user-provided stream.Ben Wagner2023-01-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | The `FT_Open_Face` documentation states > If `FT_OPEN_STREAM` is set in `args->flags`, the stream in `args->stream` > is automatically closed before this function returns any error (including > `FT_Err_Invalid_Argument`). However, if the user provides a stream in `args.stream` with `FT_OPEN_STREAM` set and a `close` function, but then for some reason passes NULL for `aface` and a non-negative `face_index`, the error `Invalid_Argument` is returned but the `close` callback will not be called on the user-provided stream. This may cause resource leaks if the caller is depending on the `close` callback to free resources. The difficulty is that a user may fill out a `FT_StreamRec` and pass its address as `args.stream`, but the stream isn't really 'live' until `FT_Stream_New` is called on it (and `memory` is set). In particular, it cannot really be cleaned up properly in `ft_open_face_internal` until the stream pointer has been copied into the `stream` local variable. * src/base/ftobj.c (ft_open_face_internal): Ensure that user-provided `args.stream.close` is called even with early errors.
* [base] Fix leak of internal stream marked external.Ben Wagner2023-01-171-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `open_face_from_buffer` allocates a new `FT_Stream` to pass to `ft_open_face_internal`. Because this is an `FT_OPEN_STREAM`, `ft_open_face_internal` will mark this as an 'external stream', which the caller must free. However, `open_face_from_buffer` cannot directly free it because the stream must last as long as the face. There is currently an attempt at this by clearing the 'external stream' bit after `open_face_from_buffer` returns successfully. However, this is too late as the original stream may have already been closed and the stream on the face may not be the same stream as originally passed. It is tempting to use `FT_OPEN_MEMORY` and let `ft_open_face_internal` create the stream internally. However, with this method there is no means to pass through a 'close' function to the created stream to free the underlying data, which must be owned by the stream. A possibility is to check on success if the stream of the face is the same as the original stream. If it is then unset the external flag. If not, then free the original stream. Unfortunately, while no current implementation does so, it is possible that the face still has the original stream somewhere other than as the `FT_FaceRec::stream`. The stream needs to remain available for the life of the face or until it is closed, whichever comes earlier. The approach taken here is to let the stream own itself. When the stream is closed it will free itself. * src/base/ftobjs.c (memory_stream_close): Free `stream`. (open_face_from_buffer): Simplify error handling, since `ft_open_face_internal` always closes `args.stream` on any error. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54930
* sr/*.c: Various minor fixes.Werner Lemberg2023-01-165-5/+8
| | | | | | | | | | | | | | | | * src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after variable declarations. * src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate unused variable. * src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++ compiler. * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid compiler warning. * src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
* [sfnt] Remove temporary runtime flag for variable 'COLR' v1.Dominik Röttsches2023-01-164-104/+14
| | | | | | | | | | | | | | | Fixes #1187. * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr, tt_face_free_colr, get_deltas_for_var_index_base, tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro definition `VARIABLE_COLRV1_ENABLED` and its usage. * src/truetype/ttdriver.c (tt_property_set): Remove parsing of 'TEMPORARY-enable-variable-colrv1' property name. * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1` flag.
* * src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes.Werner Lemberg2023-01-071-2/+3
|
* [truetype] Reset cvt and storage in context load.Ben Wagner2023-01-072-15/+2
| | | | | | | | | | | | | | | | | Currently the cvt and storage are saved and restored in `TT_RunIns`. However, this is too granular as the cvt and storage area should be set to the original cvt and storage area only when setting up the hinting context. This allows for the cvt and storage area to be modified while parsing multiple glyphs, as is the case with composite glyphs. * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and `origStorage`. * src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and storage area. (Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data do copy on write" to "if in glyph and not using glyph specific data do copy on write".
* [autofit] Don't depend on 'hb-ft'.Matthias Clasen2023-01-066-2/+148
| | | | | | | | | | | | | | | | The circular dependency is still there, but at least we no longer depend on the HarfBuzz API that is only present if HarfBuzz has been built with FreeType support, making the bootstrapping a bit easier. * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing `_hb_ft_font_create`, which is more or less a verbatim copy of the corresponding HarfBuzz code from file `hb-ft.cc`. * src/autofit/afglobal.c (af_face_globals_new): Use it. * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`. * src/autofit/autofit.c: Include `ft-hb.c`. * LICENSE.TXT: Updated.
* [truetype] Keep variation store consistent.Ben Wagner2023-01-061-45/+54
| | | | | | | | | | | | | | | | | | `tt_var_load_item_variation_store` fills out a `GX_ItemVarStore`. While it may return an error, the item store must be left in a consistent state so that any use or destruction of the item store can properly use or free the data in it. Before this change the counts from the font data were read directly into the item store before the actual allocation of the arrays to which they referred. There exist many opportunities between the time the counts are read and the arrays are allocated to return early due to invalid data. When this happened the item store claimed to have entires it actually did not, leading to crashes later when it was used. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54449 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Read the counts into local variables and store them in the item store only after the related arrays are actually created on the item store.
* [base] Report used stream's external status.Ben Wagner2023-01-051-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In `open_face` the initial stream is set on the face, along with the information about if FreeType is the owner of the stream object itself. The loaders may in the course of their work replace this stream with a new stream (as is the case for 'woff' and 'woff2'), which may have a different ownership than the initial stream object (likely the original stream object is owned by the user and is external, while the new stream object is created internally to FreeType and is internal). When the stream is replaced, the face's flags are updated with the new ownership status. However, `open_face` cannot itself free this stream as its caller `ft_open_face_internal` is responsible for this. In addition, in the case of an error `open_face` cannot return an actual face with the new stream and its ownership status to the caller. As a result, it must pass this information back to the caller as a sort of "failed face" so that the caller can clean up. `open_face` was already passing back the new stream but was not passing back the stream ownership information. As a result the stream may not have been free'd when needed. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54700 * src/base/ftobjs.c (open_face): Pass back the ownership information as well. (ft_open_face_internal): Updated.
* fix spelling err in LICENSE.txtNoah Cabral2023-01-051-1/+1
|
* [sfnt] Fix color stop bounds check calculation at table end.Dominik Röttsches2023-01-051-7/+17
| | | | | | | | Fixes https://bugs.chromium.org/p/skia/issues/detail?id=14021 * src/sfnt/ttcolr.c (VAR_IDX_BASE_SIZE): New macro. (tt_face_get_colorline_stops): Fix off-by-one bounds check calculation, take `VarColorStop` into account, and hopefully make it easier to read.
* * src/base/ftobjs.c (FT_Request_Metrics): Avoid division by zero.Alexei Podtelezhnikov2023-01-041-17/+32
| | | | | | The division-by-zero might happen in broken fonts (see #1194). Instead of returning a huge number from FT_DivFix and failing to scale later, we now bail immediately.
* [psaux] Delay the upem validity assertion. Alexei Podtelezhnikov2022-12-201-3/+1
| | | | | | Fixes #1194. * src/psaux/psft.c (cf2_getUnitsPerEm): Remove the upem assert. (cf2_checkTransform): Assert the upem validity after checking the scale.