Commit Graph
13603 Commits
Author SHA1 Message Date
Garret Rieger bb5c7ccb14 Also enforce IFTB requirements during instantiation of gvar. 2023-12-19 17:02:35 -05:00
Garret Rieger d80e0974d2 [repacker] Increase repacker max rounds to 32.
Found an example font that needs the higher limit.
2023-12-15 16:50:08 -07:00
Behdad Esfahbod 5b325c0ae9 [cff] Fix late sanitize
Last summer I changed sanitizer->check_struct() to only check
the trailing point of the struct on 64bit machines. This works
mostly because offsets are always positive.

Not anymore. Recently we introduced negative offsets in CFF,
and this was causing sanitize() for such structs pass while
the struct's leading edge was out of range.

Fix that.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64859
2023-12-13 15:27:47 -07:00
Qunxin Liu df735213a8 [instancer-solver] port solver fix (#4519)
* [instancer-solver] port solver fix

from https://github.com/fonttools/fonttools/pull/3374
2023-12-06 10:50:29 -07:00
Behdad Esfahbod bf84135edd [cff] Support negative offsets
Fixes https://github.com/harfbuzz/harfbuzz/issues/4508
2023-12-06 11:49:02 -05:00
Garret Rieger 7160c5b9e5 [repacker] add tests for multi-duplication.
Further improve the resolution attempt by pre-emptively raising priority of a duplicated shared node.
2023-12-05 16:25:12 -05:00
Garret Rieger 6f64fa75e3 [repacker] improve resolution of overflows to shared nodes.
Prior to this change overflows to shared nodes were handled by duplicating the link from only a single parent on each iteration. However, I've encountered fonts where there is a large number of parents sharing a single child. Using the prior strategy requires large number of overflow resolution iterations to resolve overflows. This changes shared overflow resolution to duplicate the shared child and re-assign multiple overflowing parents in a single iteration. This reduces total packing size in these cases and allows resolution to complete in far fewer iterations.
2023-12-05 16:25:12 -05:00
utelle 0d9f497974 Adjust function hb_blob_create_from_file_or_fail
On Windows the filename will be interpreted as UTF-8.
If the filename is NOT valid UTF-8, it will be interpreted according to the system codepage.
2023-12-04 17:08:17 -05:00
Chun-wei Fan 1d86b844df CMake: Build libharfbuzz-cairo and fix hb-view build
There is now a separate library that we build if Cairo support is enabled,
which will also be used to build hb-view, so we:

* Add support in the CMake build files to build libharfbuzz-cairo, if enabled
  via HB_HAVE_CAIRO. Move the Cairo detection bits around as a result.
* Generate pkg-config file for libharfbuzz-cairo, and add 'cairo' to
  Requires.private.
* Fix building hb-view, which will now depend on libharfbuzz-cairo, so Cairo
  support must be explicitly enabled.
* Stop depending automatically on Cairo if HB_BUILD_UTILS is enabled unless
  Cairo support is enabled as a result.
2023-11-30 16:31:44 +08:00
Behdad Esfahbod df635ab78a Merge pull request #4473 from googlefonts/help
[instancer] add the option to leave blanks in the min:def:max syntax.
2023-11-15 14:55:11 -07:00
Garret Rieger 66a404cad4 [subset] Fix hb_subset_input_get_axis_range documentation. 2023-11-15 21:41:30 +00:00
Garret Rieger 15a3889ee1 Add hb_subset_input_get_axis_range to experimental symbols list. 2023-11-15 21:13:59 +00:00
Qunxin Liu f1ac36ba7f [instancer] update hhea vertical metrics with OS/2 ones 2023-11-15 13:25:43 -07:00
Garret Rieger d30c1dacf5 Add test suite for instancing option parsing. 2023-11-15 20:16:07 +00:00
Garret Rieger 43236ce345 [instancer] add the option to leave blanks in the min:def:max syntax.
When parsing axis positions in the --variations flag recognize empty values as meaning the existing value for that part. For example:

:300:500

Specifies min = existing, def = 300, max = 500.

See: https://github.com/fonttools/fonttools/issues/3322
2023-11-15 17:54:56 +00:00
Behdad Esfahbod 6a3ca37373 [map] Optimize storage
Such that population isn't a bitfield as we access it often.
2023-11-13 16:36:56 -07:00
Khaled Hosny 894a1f72ee 8.3.0 2023-11-11 16:07:57 +02:00
Behdad Esfahbod 2b5af6f42e [subset-plan] Micro-optimize set iteration
Getting ranges is faster even with the current trivial implementation.
2023-11-10 15:23:27 -07:00
Behdad Esfahbod 90fc809f15 [set] Minor likely and __prev__ 2023-11-10 15:05:08 -07:00
Behdad Esfahbod 6d3b7931fd [subset-plan] Add a couple of allocs 2023-11-10 14:51:34 -07:00
Behdad Esfahbod d46cd93b6a [map] Speed up copy-constructor 2023-11-10 14:36:37 -07:00
Behdad Esfahbod e7879d6c55 [map] Micro-optimize destruction 2023-11-10 14:13:20 -07:00
Behdad Esfahbod d9357a1a67 [cmap] Speed up Format12/13 collect_mapping 2023-11-10 14:08:03 -07:00
Behdad Esfahbod ae6ea6f4b7 [cmap] Micro-optimize 2023-11-10 13:52:34 -07:00
Behdad Esfahbod 330c32f902 [graph] Another preallocation 2023-11-10 12:27:48 -07:00
Behdad Esfahbod 9c4d3c3c70 [graph] Pre-alloc priority-heap array 2023-11-10 12:26:02 -07:00
Behdad Esfahbod 29f8d9f795 [gen-use-table] Fix __doc__ 2023-11-10 12:26:02 -07:00
Boris Dalstein 32ee89dd48 [cmake] Fix double dots in CMake library location on macOS 2023-11-10 13:48:24 +01:00
Qunxin Liu 2d001a0adc [subset] OTS doesn't allow ligature attachment offset to be 0 2023-11-08 14:10:06 -07:00
Garret Rieger 9701b0024e [subset] Always place CFF1/2 char strings at the end of the packed table.
Makes the behaviour from HB_SUBSET_FLAGS_IFTB_REQUIREMENTS the default.
2023-11-06 16:49:09 -07:00
Garret Rieger c6884377ec [subset] Add HB_SUBSET_FLAGS_IFTB_REQUIREMENTS flag.
When enabled the output subset conforms to the requirements for a base font to be patched by IFTB patches. IFTB is a proposed incremental font transfer patch. This new flag is set as experimental. Currently, setting this flag causes the output subset to also use long offsets for outline data in loca/glyf, gvar, CFF, and CFF2.

This change is a version of https://github.com/skef/harfbuzz/commit/3ae2fe2084d96f61d8ad1bbe42a6ef4e62ec830a rebased onto head w/ tests added.
2023-11-06 16:49:09 -07:00
Qunxin Liu c2f42fbb14 fix meson compiled_tests 2023-11-06 13:12:04 -07:00
Qunxin Liu d550e16acc [instancer] Recalc avgcharwidth after instancing 2023-11-06 13:12:04 -07:00
Behdad Esfahbod d053426bb4 Format 2023-11-06 11:44:14 -07:00
Behdad Esfahbod 2f528ce4ed Tweak a couple more barriers 2023-11-06 11:40:19 -07:00
Behdad Esfahbod f31fb43155 Remove a couple unnecessary barriers 2023-11-06 11:29:30 -07:00
Behdad Esfahbod d10cc79a6c Move a couple of barriers 2023-11-06 10:41:46 -07:00
Qunxin Liu 80cb6b580f [instancer_solver] port solver fix: where axisDef < lower and upper < axisMax
Port from https://github.com/fonttools/fonttools/commit/f1e56cd757ed457ffd3b58c262d3f4c2e4586555
2023-11-06 10:06:26 -07:00
Behdad Esfahbod 7ee7e2e340 [sanitize] Add remaining hb_barrier() annotations
I'm sure I've forgot some. But this is a good start.
2023-11-04 15:21:47 -06:00
Behdad Esfahbod 3a9262cc3d [sanitize] More hb_barrier() annotations 2023-11-04 15:21:47 -06:00
Behdad Esfahbod 30672c7e75 Add hb_barrier()
And annotate some more.
2023-11-04 15:21:47 -06:00
Behdad Esfahbod 775320a4f6 [sanitize] Add barriers to runtime-checked values 2023-11-04 15:21:47 -06:00
Behdad Esfahbod cf49f3f2cb [sanitize] Add barrier() 2023-11-04 15:21:47 -06:00
Behdad Esfahbod b16f180044 [sanitize] Yet another hack to "fix" barrier issue 2023-11-04 15:21:47 -06:00
Behdad Esfahbod fd5eb10d3b Merge pull request #4477 from googlefonts/fix_feature_variations
[instancer] Fix feature variations collect lookups
2023-11-03 15:30:15 -06:00
Behdad Esfahbod cdcad93b73 [set] Mark as realloc-movable 2023-11-03 12:46:20 -06:00
Qunxin Liu aca55dbe36 [instancer] fix feature variations collect lookups
We already know which record to keep, so just collect lookups and no
need to check the substitutes_map
2023-11-03 10:51:37 -07:00
Qunxin Liu f05636e1be [instancer] fix build issue after rebase 2023-11-03 10:27:40 -07:00
Qunxin Liu 6c017a1162 [instancer] SinglePos/PairPos: do not strip_hints for partial instancing 2023-11-03 10:27:07 -07:00
Qunxin Liu 413af0a9b2 [instancer] When partial instancing, subset LigCaretList after VarStore instantiation 2023-11-03 10:24:56 -06:00