Commit Graph
13617 Commits
Author SHA1 Message Date
Behdad Esfahbod 846d5204c0 [ft] Remove unnecessary cast 2024-01-27 16:34:29 -08:00
Behdad Esfahbod 9182315bba [hb.hh] Add error -Wcast-function-type-strict 2024-01-27 16:33:46 -08:00
Patrick Griffis aed309d1ec [autotools] Installing missing hb-features.h header
This is already installed by CMake and Meson.
2024-01-26 11:29:28 -08:00
Sergei Trofimovich 032c931e1c use calloc(nmemb, size), not calloc(size, nmemb)
This minor mismatch is detected by new `-Wcalloc-transposed-args`
`gcc-14` warning as:

    In file included from ../src/hb-subset-plan.cc:38:
    ../src/hb-ot-cff1-table.hh: In member function 'bool OT::cff1::accelerator_t::get_glyph_from_name(const char*, int, hb_codepoint_t*) const':
    ../src/hb-ot-cff1-table.hh:1419:60: warning: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
     1419 |         names = (hb_sorted_vector_t<gname_t> *) hb_calloc (sizeof (hb_sorted_vector_t<gname_t>), 1);
          |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-01-13 10:34:18 -07:00
Garret Rieger ef1f5c4e0c [subset] Re-use common Coverage subsetting function in PairPosFormat2.
Was using an identical but less efficient version. Fixes fuzzer test case: https://oss-fuzz.com/testcase-detail/6151390002806784
2024-01-08 15:34:45 -07:00
Behdad Esfahbod e0e2b29ea8 [cmap] Implement MacRoman encoding
For other Mac encodings just map the ASCII range.

Fixes https://github.com/harfbuzz/harfbuzz/issues/4540
2024-01-08 12:30:23 -07:00
Behdad Esfahbod ef289a9e20 [COLR] Reduce COLRv1 max edge count
64k sounds excessive.

Fixes https://oss-fuzz.com/testcase-detail/5383336738291712
2024-01-08 09:11:34 -07:00
Lie Yan 155015f4be refactor(math-kern): call hb_bsearch_impl instead of raw binary search 2024-01-08 07:05:56 -07:00
Behdad Esfahbod 2f41d54b85 Fix old-compiler warning 2024-01-07 13:50:56 -07:00
Ozkan Sezer 1cc7ddb3c4 hb-subset-plan.cc: Fix -Wparentheses warning.
In file included from hb-subset-plan.hh:30:0,
                 from hb-subset-plan.cc:27:
hb-subset-plan.cc: In function 'void _update_instance_metrics_map_from_cff2(hb_subset_plan_t*)':
hb-subset-plan.cc:998:81: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if (unlikely (!plan->check_success (font = _get_hb_font_with_variations (plan))))
                                                                                 ^
hb.hh:263:25: note: in definition of macro 'unlikely'
 #define unlikely(expr) (expr)
                         ^

Fixes: https://github.com/harfbuzz/harfbuzz/issues/4545
2024-01-07 12:30:06 -07:00
Lie Yan c17d67467f [ot-math] Fix a bug in MathKern::get_value()
Fixes https://github.com/harfbuzz/harfbuzz/issues/4542
2024-01-07 16:10:10 +02:00
Behdad Esfahbod e9d727173c [cmap] Remove more unused code 2024-01-04 09:36:24 -07:00
Behdad Esfahbod f8d924e5b8 [cmap] Remove unused code 2024-01-04 09:36:24 -07:00
Behdad Esfahbod 81c2212117 [test-instancer-solver] Fix on msys32 hopefully 2024-01-01 13:52:33 -05:00
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