summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* configure.raw: use void* instead of SInt16* for actualRefNum for ↵check-deprecated-warning-for-macosxsuzuki toshiya2022-10-091-1/+8
| | | | FSGetForkCBInfo()
* configure.raw: use -Werror=deprecated-declarations for MacOS specific testingsuzuki toshiya2022-10-091-18/+50
|
* configure.raw: --with-{fsspec/fsref/quickdraw-toolbox/quickdraw-carbon|ats} ↵suzuki toshiya2022-10-091-10/+15
| | | | are defauled to no
* use my own __attribute__((deprecated)) checkingsuzuki toshiya2022-10-072-266/+75
|
* configure.raw: initial draft to ignore the availability of legacy MacOSX ↵suzuki toshiya2022-10-072-41/+331
| | | | functions, if they are warned as deprecated by the compiler attributes
* Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name.Alexei Podtelezhnikov2022-10-041-94/+96
|
* [autofit] Reset the face charmap directly.Alexei Podtelezhnikov2022-10-034-5/+4
| | | | | | | | | There is no need to validate the original charmap in `FT_Set_Charmap`. It can be reset directly. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Use direct assignment. * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto.
* * src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly.Alexei Podtelezhnikov2022-10-031-8/+2
| | | | | | As with the previous commit, we can avoid the validation checks of `FT_Set_Charmap` and set it directly when choosing from the available list.
* * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`. Alexei Podtelezhnikov2022-10-031-8/+6
| | | | | Set charmap aggressively without all validations of `FT_Set_Charmap` because we take it from the available array and only temporarily. Even CMap Format 14 will gracefully return 0.
* * src/cache/ftcbasic.c (ftc_basic_family_get_count): Remove redundancy.Alexei Podtelezhnikov2022-10-031-2/+1
|
* * src/psaux/pshints.c (cf2_hintmap_insertHint): Fix midpoint computation.Werner Lemberg2022-09-301-2/+4
| | | | | | | Replace '(start + end) / 2' with 'start + (end - start) / 2' to avoid overflow. Fixes #1180.
* * src/psaux/pshints.c (cf2_hintmap_build): Improve debugging output.Werner Lemberg2022-09-301-3/+3
|
* [truetype] Fix undefined pointer arithmetic.mlugg2022-09-291-4/+5
| | | | | * src/truetype/ttgxvar.c (tt_var_get_item_delta, ft_var_load_mvar): Use `FT_OFFSET`.
* * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Use lighter FT_DivFix.Alexei Podtelezhnikov2022-09-291-4/+2
|
* [base] FT_Attach_Stream: Make `parameters` argument constant.Ali Chraghi2022-09-292-4/+4
|
* * src/tools/*.py: Migrate to Python 3.Azamat Hackimov2022-09-283-808/+805
| | | | Fixes #1185, closes !205. Formatting changes according to PEP8.
* [sfnt] Guard access in 'COLR' table when requesting child table pointer.Dominik Röttsches2022-09-271-5/+13
| | | | | | | | | | | * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Tighten pointer bounds checks. (get_child_table_pointer): Check whether incoming pointer `p` lies within the 'COLR' table. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51816
* [sfnt] Add SVG document bounds checking.Ben Wagner2022-09-271-36/+45
| | | | | | | | | | | | | | | | | Add a check that the document content is actually contained within the `SVG ` table. Without this check a malformed font may claim arbitrary memory as its document content. * src/sfnt/ttsvg.c (tt_face_load_svg): Take `numEntries` into account when testing 'documentRecord' extents. (find_doc): Rename `stream` to `document_records` for clarity. (tt_face_load_svg_doc): Split `doc` from `doc_list` pointer for clarity. Test that the document content is contained within the table. Ensure minimum length of document before testing for gzip format. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51812
* [base] Clean up the bitmap flow control.Alexei Podtelezhnikov2022-09-221-20/+20
| | | | | | | * src/base/ftbitmap.c (FT_Bitmap_Copy): Flip the copy if its pitch is trully opposite, zero is not a positive value. (FT_Bitmap_Convert): Set negative pitch as needed, accept negative alignment values.
* [base] Discard and recreate bitmaps for copying and converting. Alexei Podtelezhnikov2022-09-221-49/+17
| | | | | | | | Reusing target bitmaps for copying and converting is permitted. It is, however, pointless to preserve their content before overwriting. Free- malloc might be faster than realloc. * src/base/ftbitmap.c (FT_Bitmap_Copy, FT_Bitmap_Convert): Free an old buffer and create a new one.
* Reject 'COLR' table if version is 1 but header too small.Dominik Röttsches2022-09-161-3/+13
| | | | | | | | | * src/sfnt/ttcolr.c (tt_face_load_colr): If the version is determined to be 1, then the table size has to be at least the size of the v1 header. Also, for peeking the number of base glyphs and entries in the layer list, ensure that the table is sufficiently long. Fixes #1179. Original patch by Sergey Temnikov.
* * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix format 1 handling.Werner Lemberg2022-09-151-5/+15
| | | | Fixes #1181.
* [truetype] Reject 'fvar' loading when `num_instances` is too small.Dominik Röttsches2022-09-061-5/+16
| | | | | | | | | | * src/truetype/ttgxvar.c (TT_Get_MM_Var): Reject retrieving master when 'fvar' values locally do not match with sanitized values from initialization at `sfnt_init_face` time. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1360295
* [sfnt] Handle variable `COLR` v1 fonts without delta set index mapDominik Röttsches2022-09-051-3/+2
| | | | | | | | Fixes #1178. * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Set outer index to 0 and inner index to the delta index when retrieving deltas if the `COLR` table has no delta set index map.
* [sfnt] Pointer sanity checks before reading layer info in 'COLR' v0Dominik Röttsches2022-09-051-1/+3
| | | | | | | | | * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Check that the pointer to read from is within the 'COLR' table. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50633
* [autofit] Minor fix.Werner Lemberg2022-09-051-1/+1
| | | | | * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid compiler warning.
* [sfnt] Don't require 'gvar' table to support variation fonts.Dominik Röttsches2022-09-052-22/+10
| | | | | | | | | | | | | Fixes #1172. * src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if `fvar` is present; do not require other tables to be present. * src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table when setting variation coordinates. However, if a 'gvar' table is actually present, do perform a sanity check and fail on malformedness. (TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all cases, which is an overly tight check.
* * src/base/ftver.rc: Explicitly use UTF-16.Alexei Podtelezhnikov2022-08-261-3/+3
| | | | Fixes #1177 to avoid mistranslation and other problems.
* [sfnt] Avoid undefined shifts in `COLR` v1 color line retrievalDominik Röttsches2022-08-261-2/+2
| | | | | | | * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift behavior by using multiplication using macros from ftcalc.h. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50573
* CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option.Sean Farrell2022-08-211-0/+10
| | | | | | | | This option uncomments FreeType configuration macro `FT_CONFIG_OPTION_ERROR_STRINGS` to make function `FT_Error_String` return meaningful error strings. This option is off by default.
* [base, type1] Better handling of out-of-memory situations.Chris Liddell2022-08-212-3/+6
| | | | | | | | | | | This follows similar code in `cff_slot_done`. * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c (T1_GlyphSlot_Done): Check `internal` pointer. The Type1 problems was reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057.
* ci: bump windows image and use newer runner and vs2019Tim-Philipp Müller2022-08-061-7/+7
| | | | The old 1809 runner will be decommissioned at some point.
* * src/cache/ftcmanag.c (FTC_Manager_New): Initialize `cur_weight`.@udoudou2022-08-031-0/+1
| | | | See !192.
* * src/sfnt/ttload.c: Trace formatting updates.Alexei Podtelezhnikov2022-08-021-13/+13
|
* * src/psaux/psobjs.c (ps_table_release): Remove redundant casting. Alexei Podtelezhnikov2022-08-021-1/+1
|
* * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Reduce casting.Alexei Podtelezhnikov2022-08-011-6/+6
|
* [cache] Remove some casts, clean up tracing.Alexei Podtelezhnikov2022-08-014-11/+11
| | | | | | | | | * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup): Clean up tracing types. * src/cache/ftccache.c (ftc_node_destroy): Ditto. * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto. (FTC_Manager_Check, FTC_Node_Unref): Remove a cast. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
* [autofit] Updated to reduce casting (cont'd).Alexei Podtelezhnikov2022-08-013-16/+13
| | | | | | | * src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Remove casting. * src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly.
* [autofit] Updated to reduce casting.Alexei Podtelezhnikov2022-08-013-20/+20
| | | | | | | | * src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage, af_face_globals_get_metrics, af_face_globals_is_digit, af_face_globals_new): Changed local types and updated accordingly. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto.
* [psaux] Remove unused structure field.Alexei Podtelezhnikov2022-07-312-5/+0
| | | | | * include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`. * src/psaux/psobjs.c (ps_table_new): Remoove its initialization.
* [sfnt] Implement VarClipBox.Dominik Röttsches2022-07-301-2/+30
| | | | | * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Depending on the format, read `var_index_base`, then retrieve and apply scaled deltas.
* [sfnt] Fix typo in clip box computation.Dominik Röttsches2022-07-301-2/+3
| | | | | * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Use appropriate scale factor for `yMin` and `yMax`.
* [autofit] Use unsigned accounting for hints.Alexei Podtelezhnikov2022-07-294-16/+16
| | | | | | | | | | * src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types. * src/autofit/afhints.c (af_axis_hints_new_{segment,edge}, af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset): Updated accordingly. * src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto. * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto.
* * src/autofit/afhints.h: Remove dead code.Alexei Podtelezhnikov2022-07-291-5/+0
|
* * src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error.Werner Lemberg2022-07-292-3/+6
|
* Fix compilation if `TT_CONFIG_OPTION_GX_VAR_SUPPORT` is not set.Werner Lemberg2022-07-291-14/+32
| | | | | * src/sfnt/ttcolr.c: Protect relevant code with `TT_CONFIG_OPTION_GX_VAR_SUPPORT`.
* Fix clang14 compiler warnings.Werner Lemberg2022-07-292-7/+4
| | | | | | | | | * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE): Fix type. * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean value. (tt_face_get_colorline_stops): Fix type of `var_index_base`.
* [pfr] Fortify the kerning code.Alexei Podtelezhnikov2022-07-261-8/+7
| | | | | | | | | | | | Any array index must be strictly less then the array size. Therefore, we must reject indexes that are equal to the array size. Alternatively, we should move the bounds check before the index decrement but that would be confusing. In addition, it is ok to decrement zero (.notdef) and get UINT_MAX, which is then automatically rejected in the bounds check. * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix the bounds checking.
* [pfr] Add some safety guards.Werner Lemberg2022-07-261-0/+15
| | | | | | | * src/pfr/pfrload.c (pfr_phy_font_load): Check resolutions and number of characters. Fixes #1174.
* * src/pfr/*.c: Trivial improvements and formatting.Werner Lemberg2022-07-264-21/+14
|