summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* API documentation: Re-organize chapters and sectionsAPI-organizationWerner Lemberg2023-04-302-118/+412
| | | | | | | * Split the very long 'Base Interface' section into smaller sections. * Split the 'Core API' chapter into two chapters. * Remove single enumeration values from `@order` fields since they have no effect.
* [truetype] tt_size_reset_height to take FT_SizeBen Wagner2023-04-172-5/+9
| | | | | | | | | | | | | | | | | | The `MetricsVariations` `FT_Size_Reset_Func` is defined to take an `FT_Size`. Because `tt_size_reset_height` is to be used as such a function, it must also take an `FT_Size` instead of a `TT_Size`. Even though the pointers passed will be the same at runtime, calling a function through a pointer of a different type from the original function pointer type is undefined behavior. This may be caught at runtime by Control Flow Integrity with something like clang's `cfi-icall`. Issue: https://crbug.com/1433651 * src/truetype/ttobjs.h (tt_size_reset_height): take `FT_Size` * src/truetype/ttobjs.c (tt_size_reset_height): take `FT_Size` and update documentation
* * src/truetype/ttinterp.c: Remove outdated comments.Werner Lemberg2023-04-131-10/+0
|
* [sfnt, truetype] Add `size_reset` to `MetricsVariations`.Ben Wagner2023-04-1110-56/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a generalization of commit ``` commit e6699596af5c5d6f0ae0ea06e19df87dce088df8 Author: Werner Lemberg <wl@gnu.org> Date: Thu Feb 2 11:38:04 2017 +0100 [truetype] Fix MVAR post-action handling. ``` It is also possible for plain `CFF ` style fonts to contain an `fvar` and `MVAR` table and use `cff_metrics_adjust`. `tt_size_reset` should only be called with `TT_Size` and never with `CFF_Size`. Allow the "metrics-variations" service to specify the correct function (if any) to reset `FT_Size`s after adjusting metrics. * src/truetype/ttobjs.c (tt_size_reset): Split off some functionality into... (tt_size_reset_height): ... this new function. * src/truetype/ttdriver.c (tt_service_metrics_variations): Add `size_reset`. (tt_size_select, tt_size_request): Updated. * src/truetype/ttobjs.h: Updated. * include/freetype/internal/services/svmetric.h (MetricsVariations): Add `size_reset`. (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec_): Rename `var` to `tt_var` and add `face_var`. * src/cff/cffdrivr.c (cff_service_metrics_variations): Add `size_reset`. (cff_hadvance_adjust, cff_metrics_adjust): Updated. * src/cff/cffobjs.c (cff_face_init): Use `face_var`. * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `face_var`. * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `tt_var`. * src/truetype/ttgxvar.c (tt_size_reset_iterator): Renamed to... (ft_size_reset_iterator): ... this new function. Call `size_reset`. (tt_apply_mvar): Pass `size_reset` to `ft_size_reset_iterator`. Fixes #1211
* * src/cff/cffcmap.c (cff_cmap_encoding_char_next): Abbreviate.Alexei Podtelezhnikov2023-04-101-18/+6
|
* Align `char_next` return types.Alexei Podtelezhnikov2023-04-107-19/+19
| | | | | | | This is mostly cosmetic because FT_UInt and FT_UInt32 are likely identical. * src/sfnt/ttcmap.c, src/cff/cffcmap.c, src/psaux/t1cmap.c, src/psnames/psmodule.c, include/freetype/internal/service/svpcsmap.h, src/pfr/pfrcmap.c, src/winfonts/winfnt.c (*_char_next): return FT_UInt.
* [sfnt] Clean up CMAP{4,12,13} handling.Alexei Podtelezhnikov2023-04-081-79/+27
| | | | | | | | | | | This moves the charcode overflow checks upstream and turns some while-loops into the do-while ones to avoid the uninitialized warnings. This should slightly reduce the number of checks and jumps. * src/sfnt/ttcmap.c (tt_cmap{4,12,13}_next, tt_cmap{4.12.13}_char_map_linear): Remove the charcode overflow check. (tt_cmap{4,12,13}_char_map_binary): Ditto and use do-while. (tt_cmap{12,13}_char_next): Add the overflow check.
* * src/sfnt/ttpost.c (load_format_25): Do not abort frame reading.Alexei Podtelezhnikov2023-04-021-4/+1
|
* * src/sfnt/ttpost.c (load_format_*): Streamline frame reading.Alexei Podtelezhnikov2023-04-021-2/+8
|
* * src/sfnt/ttpost.c: Formatting and comments.Alexei Podtelezhnikov2023-04-021-5/+6
|
* [sfnt] Consolidate POST version 2.0 and 2.5 (pt 2).Alexei Podtelezhnikov2023-04-011-107/+61
| | | | | | | * src/sfnt/ttpost.c (load_format_20, load_format_25): Update arguments and move shared calls and checks upstream to... (load_post_names): ... this function. (tt_face_free_ps_names, tt_face_get_ps_name): Updated.
* [sfnt] Consolidate POST version 2.0 and 2.5 (pt 1).Alexei Podtelezhnikov2023-04-012-107/+40
| | | | | | | | | | | The deprecated POST version 2.5 can be handled using the data structures of version 2.0. The goal is to reduce the footprint. * include/freetype/internal/tttypes.h (TT_Post_Names): Absorb and... (TT_Post_20, TT_Post_25): ... remove these structures. src/sfnt/ttpost.c (load_post_names, tt_face_get_ps_name, tt_face_free_ps_names, load_format_20): Updated accordingly. (load_format_25): ditto and convert offsets to glyph indices.
* [sfnt] Miscellaneous POST clean-ups.Alexei Podtelezhnikov2023-03-311-25/+24
| | | | | | | * src/sfnt/ttpost.c (load_format_20): Decrease casts. (load_format_25): Check the table length and impose a theoretical glyph number limit usable with 8-bit offset. Decrease casts. (load_post_names): Pass the mapping data length without 2 bytes.
* * src/sfnt/ttpost.c (load_format_20): Simplify comutations.Alexei Podtelezhnikov2023-03-301-24/+11
|
* [sfnt] Streamline POST format 2.0 handing (cont'd).Alexei Podtelezhnikov2023-03-292-25/+13
| | | | | | | * src/sfnt/ttpost.c (load_format_20): Co-allocate the string data and their pointers, which makes it easier to handle and free them. (tt_face_free_ps_names): Updated. * include/freetype/internal/tttypes.h (TT_Post_20): Update type.
* [cff] Simplify `t2_strings` management in the old engine.Alexei Podtelezhnikov2023-03-202-58/+7
| | | | | | | * src/cff/cffparse.c (cff_parser_run): Allocate the charstring buffers and the list nodes together so that they can be freed at once. (finalize_t2_strings): Removed as no longer needed. (cff_parser_done): Updated.
* [cff] Rework the stream limit checks.Alexei Podtelezhnikov2023-03-191-63/+22
| | | | | | | | | | | | | The old stream limit checks, before 6986ddac1ece, were good but pointless for the crafted t2_strings. Checking limits there is not necessary as they are created to hold all data. By using two conditions, we can detect the actual crossing of the stream boundary as appropriate for the stream pointer only. The t2_strings parsing will not be triggering these checks. * src/cff/cffparse.c (cff_parser_within_limits): Removed. (cff_parse_real, cff_parse_integer): Redesign the stream limit check. (cff_parse_num, do fixed, cff_parse_fixed_dynamic): Update callers.
* * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use for-loop.Alexei Podtelezhnikov2023-03-171-2/+2
| | | | | Even though we never call `TT_Load_Simple_Glyph` with zero contours, out of abundance of precaution, let's handle this case properly.
* [truetype] Clean up zeroing and local variables.Alexei Podtelezhnikov2023-03-171-29/+18
| | | | | * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Avoid zeroing. (load_truetype_glyph): Avoid zeroing and clean local variables.
* * include/freetype/ftsystem.h (FT_Stream_IoFunc): Improve documentation.Werner Lemberg2023-03-161-12/+4
| | | | Fixes #1208.
* * src/base/ftsynth.c (FT_GlyphSlot_AdjustWeight): New API.Alexei Podtelezhnikov2023-03-162-6/+26
|
* [truetype] Clean up glyph loading.Alexei Podtelezhnikov2023-03-151-25/+14
| | | | | | * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean space checking. (TT_Hint_Glyph): Don't copy the outline structure. (TT_Process_Simple_Glyph): Cosmetic update.
* * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean up.Alexei Podtelezhnikov2023-03-151-36/+18
|
* builds/vms/apinames_vms.bash: Fix `unzip` artifactWerner Lemberg2023-03-131-0/+0
| | | | | | | | The problem occured when unpacking a zip file created on OpenVMS on Linux. While OpenVMS knows many different file formats, Unix only knows stream-LF and binary. In principle `zip` on Linux should have translated the file to stream-LF but failed to do so. That caused the file to incorrectly contain only one line with control-characters.
* [truetype] Fix recent fallout in memory management.Alexei Podtelezhnikov2023-03-101-33/+30
| | | | | | | * src/truetype/ttgload.c (TT_Process_Composite_Glyph, TT_Load_Simple_Glyph): Clean up old instructions regardless of new ones, postpone setting `control_len` and `control_data` until... (TT_Load_Glyph): ... the exit from this function.
* Update VMS installation support.Jouk Jansen2023-03-106-317/+435
|
* * src/truetype/ttgload.c (TT_Hint_Glyph): Mostly cosmetic update.Alexei Podtelezhnikov2023-03-091-16/+14
| | | | | | The number of instructions is now taken from the executed context. Technically, this means that `control_len` and `control_data` values are no longer _used_ internally but only expose them.
* apinames.c: Add comment.Werner Lemberg2023-03-081-1/+2
|
* [gzip] File `infback.c` is not needed.Werner Lemberg2023-03-072-645/+0
| | | | | * src/gzip/infback.c: Remove. * src/gzip/rules.mk (GZIP_DRV_SRCS): Updated.
* [apinames] Fix VMS handling of overly long function names.Werner Lemberg2023-03-072-7/+270
| | | | | | | | | | | | | | | | Based on ideas from Jouk Jansen <joukj@hrem.nano.tudelft.nl>. * src/tools/vms_shorten_symbol.c: New file, taken from https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/vms_shorten_symbol.c with some minor edits to allow compilation with C++ and being included in another source code file. * src/tools/apinames.c: Include `vms_shorten_symbol.c`. (PROGRAM_VERSION): Set to '0.5'. (names_dump) [OUTPUT_VMS_OPT]: Call `vms_shorten_symbol` to get unique function identifiers not longer than 31 characters.
* * src/tools/apinames.c (panic): Accept variable number of arguments.Werner Lemberg2023-03-071-2/+14
|
* * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix leak too.Alexei Podtelezhnikov2023-03-061-0/+2
|
* * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Triage memory leak.Alexei 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
|