Commit Graph

9396 Commits

Author SHA1 Message Date
Behdad Esfahbod 62a535f154 [khmer] Fix comment
Fixes https://github.com/harfbuzz/harfbuzz/issues/3104
2021-08-03 10:11:43 -06:00
Behdad Esfahbod ee7473b8a4 [mutex] Remove unused HB_MUTEX_IMPL_INIT / HB_MUTEX_INIT
https://github.com/harfbuzz/harfbuzz/pull/3100#issuecomment-890089096
2021-07-30 12:55:28 -06:00
Behdad Esfahbod 0e37c07f4c Revert "Construct user_data in hb_object"
This reverts commit a78eb43c79.

See: https://github.com/harfbuzz/harfbuzz/pull/3100#issuecomment-890088227
2021-07-30 12:52:59 -06:00
Behdad Esfahbod 5dc4cd71cc [blob] Minor change in destruction
No semantic change.
2021-07-30 12:37:40 -06:00
Garret Rieger b63ac57174 [subset] bail if collection region indices is in error. 2021-07-29 18:30:37 -07:00
Garret Rieger f9d8e4a976 [subset] switch ..._set_flags to not take a mask. 2021-07-29 18:30:27 -07:00
Garret Rieger 46d4a5e673 [subset] Convert subset plan to use a flags bit set. 2021-07-29 18:02:34 -07:00
Garret Rieger 3d534b146c [subset] convert subset input flags into bit flags.
Store the flags in a bit set. Updates the public api to work with the bit set directly.
2021-07-29 18:02:34 -07:00
Ben Wagner a78eb43c79 Construct user_data in hb_object
hb_object's user_data is created lazily. The previous implementation of
hb_object_set_user_data created space for the user_data but did not
actually construct it. This means that hb_user_data_array_t's lock was
not constructed. If hb_mutex_t is backed by an implementation which
requires that it be constructed (not just zero initialized) then errors
will occur when taking the lock when setting the user data.

Change hb_object_set_user_data to construct the user_data in the created
space and hb_object_fini to call the destructor.
2021-07-29 16:03:56 -06:00
Behdad Esfahbod 30579f5a37 [set] Document & use open-ended del_range() 2021-07-29 11:19:13 -06:00
Behdad Esfahbod 2d54c34680 [subset/VarStore] Fix OOM in fuzzer test
The test in question is the one added in c68a00b92e.
Culprit is that it's allocating lots of memory because of region_indices that
are out-of-range anyway. So, try to filter those out first.
2021-07-29 00:49:36 -06:00
Behdad Esfahbod ff1fe25a5d [VarStore] Rename internal get_scalars() to get_region_scalars() 2021-07-29 00:49:36 -06:00
Khaled Hosny 9a7ff54bb7 [test] Write one sequence per-line
https://github.com/harfbuzz/harfbuzz/pull/3087#issuecomment-888691436
2021-07-28 18:25:51 -06:00
Khaled Hosny ddf87ffb22 [test] Add generated tests for emoji clusters
Fixes https://github.com/harfbuzz/harfbuzz/issues/3017

Uses AdobeBlank2.ttf from:

  https://github.com/adobe-fonts/adobe-blank-2

instead of a dummy empty font so that everything maps to GID 1 and
control code points are kept instead of being dropped because there is
not space glyph (otherwise we’d need to identify control code points
somehow when generating the expectations).
2021-07-28 18:25:51 -06:00
Behdad Esfahbod f0a1892ff9 [serialize] Remove unnecessary pointer indirection 2021-07-28 17:36:22 -06:00
Behdad Esfahbod 1c511ed6f6 [subset] Simplify VarStore serialization 2021-07-28 17:33:26 -06:00
Behdad Esfahbod ad4c692492 [subset] Simplify VarStore serialize 2021-07-28 17:22:14 -06:00
Behdad Esfahbod 25dee60977 [sanitize] Revert some from c68a00b92e
That overflow check was already happening in arrayZ.sanitize().
2021-07-28 13:58:24 -06:00
Behdad Esfahbod 6fe0d7d6e8 [GSUB] If MultipleSubst is applied to a ligature-component, preserve lig-id
Fixes https://github.com/harfbuzz/harfbuzz/issues/3069
2021-07-28 12:06:49 -06:00
Behdad Esfahbod b926fb9bb0 Whitespace 2021-07-28 11:58:10 -06:00
Behdad Esfahbod cc3a7ceea3 Fix macro-in-macro invocation
../src/hb-ot-color-colr-table.hh:980:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
\#if COLRV1_ENABLE_SUBSETTING == 1
2021-07-28 11:53:06 -06:00
Behdad Esfahbod 087e2705de Fix signed-ness error in 0ded6a70c8 2021-07-28 11:42:48 -06:00
Garret Rieger f3e031539f Revert "[ci] Bin FontTools version due to recent COLRv1 changes"
This reverts commit 163748b505.
2021-07-28 11:36:34 -06:00
Garret Rieger acbd8b27dc [subset] temporarily disable COLRv1 subsetting.
Currently COLRv1 spec is being changed so the subsetting implementation is out of sync. Disable subsetting by failing sanitization for COLRv1 tables and disable all colrv1 tests.
2021-07-28 11:36:34 -06:00
Behdad Esfahbod 0ded6a70c8 [subset] Fix another fuzzer issue
Addition could overflow on 32bit arch.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36636
Fixes https://oss-fuzz.com/testcase-detail/5072358514753536
2021-07-28 11:35:27 -06:00
Garret Rieger 09474d8d7b [subset] Fix fuzzer timeout in add_gid_and_children.
The composite glyph graph isn't check for max operations by sanitize so track an operations count during the graph traversal.
2021-07-27 13:30:06 -06:00
Behdad Esfahbod c68a00b92e [subset] Fix possible overflows in VarRegionList serialize
Fixes https://oss-fuzz.com/testcase-detail/5362189182566400
2021-07-27 13:28:09 -06:00
Behdad Esfahbod 7b8464b655 [serialize] Check for overflow in allocate_size()
If size was > INT_MAX, then the out-of-room check was failing to perform
as intended.

Part of fixing https://oss-fuzz.com/testcase-detail/5362189182566400
2021-07-27 13:26:00 -06:00
Behdad Esfahbod bf2c87bfe6 Add hb_memcpy() that does len=0 check 2021-07-27 13:26:00 -06:00
Khaled Hosny 5f801da945 [hb-ms-features] Move code out of header file 2021-07-27 21:07:32 +02:00
Khaled Hosny 990c15dbe5 [hb-ms-features] Rename types to be less general 2021-07-27 21:07:32 +02:00
Khaled Hosny 69199211b7 [uniscribe/directwrite] Move feature setup to shared file
Fixes https://github.com/harfbuzz/harfbuzz/issues/3070
2021-07-27 21:07:32 +02:00
Garret Rieger fc7f778120
[subset] add a note to hb-subset on what is and isn't supported (#3076) 2021-07-27 11:21:19 -07:00
Khaled Hosny 791a1bf3a4 Don’t disable getenv on Windows
The condition is inverted, regression from
40ec187dec.
2021-07-27 15:22:13 +02:00
Behdad Esfahbod 4762fcb415
Merge pull request #3067 from googlefonts/glyph_names
[subset] support option --glyph-names
2021-07-26 11:48:55 -07:00
Behdad Esfahbod aeec278453
Merge pull request #3068 from harfbuzz/hoi
[variations] Support multiple axes with same tag, aka HOI
2021-07-26 11:31:54 -07:00
Khaled Hosny ec99fdb7e8 [sebset] Use [s|g]et_flag for retain_all_layout_features
Looks like this was missed when adding hb_subset_input_[s|g]et_flag()
2021-07-26 19:32:28 +02:00
Khaled Hosny acc7100a3f [docs] Improve subset documentation 2021-07-26 02:18:23 +02:00
Khaled Hosny 3e2734cf91 [docs] Don’t use GTK-Doc syntax for internal functions
We don’t generate docs for them, reduces the number of warnings.
2021-07-26 02:18:18 +02:00
Qunxin Liu 71b5509c19 [subset] support option --glyph-names 2021-07-23 13:57:39 -07:00
Behdad Esfahbod b235511ed8
Merge pull request #3021 from googlefonts/stable_api
[subset] update hb_subset api with final changes before going stable.
2021-07-23 12:15:15 -07:00
Behdad Esfahbod a9a607d360 [variations] Support multiple axes with same tag, aka HOI
The axes in fvar are in arbitrary order, NOT sorted. Hence have to
lsearch all entries.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1673
Fixes https://github.com/harfbuzz/harfbuzz/issues/2743

Test from https://github.com/ctrlcctrlv/FontForge-Higher-Order-Interpolation
2021-07-23 11:58:58 -07:00
Garret Rieger 1fde80ad28 [subset] update comments referencing hb_subset_input_t parameter. 2021-07-22 16:45:48 -07:00
Garret Rieger c581d11eba [set] in hb_set_set() avoid calling memcpy on nullptr. 2021-07-22 14:04:39 -07:00
Garret Rieger 2b9cb29923 [subset] cleanup no_subset_tables on destruction. 2021-07-22 13:26:03 -07:00
Garret Rieger 89fc399eba [subset] Add hb-subset section documentation. 2021-07-22 13:00:34 -07:00
Garret Rieger 792e2ed61c [subset] convert no get/set prune unicode ranges to enum. 2021-07-22 12:41:48 -07:00
Behdad Esfahbod 0a44feaeda [fvar] Make find_axis_index() return a range, not individual value 2021-07-22 12:18:48 -07:00
Garret Rieger 1b6c1aa684 [subset] add hb-subset api to documentation generator.
Standardize subset_input parameter to be input.
2021-07-22 12:15:45 -07:00
Garret Rieger 8ce9683412 [subset] add documentation for all hb-subset.h methods. 2021-07-22 12:14:53 -07:00