Behdad Esfahbod
84c2a30214
[bit-set-invertible] Second try fixing previous()
2021-08-19 16:33:48 -06:00
Behdad Esfahbod
8f88747a5e
[bit-set-invertible] Fix previous() iteration
2021-08-19 16:31:01 -06:00
Behdad Esfahbod
1d832693e1
[set] Protect against immutible null set with invertible addition
2021-08-19 16:02:30 -06:00
Behdad Esfahbod
dc800ffd6c
[bit-set] Remove TODO items we don't intend to finish
2021-08-19 15:41:27 -06:00
Behdad Esfahbod
92908c122b
[bit-set-invertible] Remove extra check
...
We don't expect immutable / null set in this code.
2021-08-19 15:28:26 -06:00
Behdad Esfahbod
1babe80ed2
[bit-set-invertible] Fix last remaining corner-case
2021-08-19 15:18:32 -06:00
Behdad Esfahbod
e8911d137c
[bit-set-invertible] Implement a couple other missing corner cases
...
Also, in bit-set, don't compute population in is_equal/is_subset()
if we don't have it computed already.
2021-08-19 15:00:33 -06:00
Behdad Esfahbod
2579dc648f
[bit-set-invertible] Move code around
2021-08-19 14:48:27 -06:00
Behdad Esfahbod
2dfc104236
[bit-set-invertible] Implement is_empty() for inverted case as well
2021-08-19 14:47:33 -06:00
Behdad Esfahbod
ec4812a7d4
[bit-page] Remove unused inverted code
2021-08-19 13:32:44 -06:00
Behdad Esfahbod
87885e6f02
[bit-set-invertible] Fix next/previous() logic
2021-08-19 13:26:25 -06:00
Behdad Esfahbod
ee4e331a6e
[bit-set] Remove unused get_min(inverted)
2021-08-19 13:24:15 -06:00
Behdad Esfahbod
eec1a25e71
[bit-set-invertible] Rewrite get_min/max() in terms of next/previous()
2021-08-19 13:24:00 -06:00
Behdad Esfahbod
f09d5ed0f5
[algs] Remove hb_bitwise_non()
2021-08-19 13:06:10 -06:00
Behdad Esfahbod
f4fd7baf7e
[bit-set-invertible] Fix subtract() logic
2021-08-19 13:05:12 -06:00
Behdad Esfahbod
f317d8e426
[bit-set-invertible] Fix intersect() logic
2021-08-19 13:01:07 -06:00
Behdad Esfahbod
b21038d91d
[bit-set-invertible] Rewrite next/previous_range() in terms of s.next/previous()
2021-08-19 11:24:17 -06:00
Behdad Esfahbod
eb98bc1e32
[bit-set-invertible] Rewrite next/previous() using s.next/previous_range()
2021-08-19 11:19:24 -06:00
Behdad Esfahbod
248ad3bce5
[bit-set-invertible] Implement next/previous
...
This makes invertible set functionality complete.
2021-08-19 10:17:51 -06:00
Behdad Esfahbod
c27f5b1288
[bit-set-invertible] Plug in next_range()/previous_range()
2021-08-19 10:01:24 -06:00
Behdad Esfahbod
f6aa37159b
[bit-set-invertible] Fix process logic for inverted
...
[# On branch set-invert
2021-08-19 01:12:25 -06:00
Behdad Esfahbod
060de189ec
[bit-page] Fix sanitizer error
...
This essentially reverts 9449cfeefd
Problem was dereferencing pointer at end of array...
2021-08-19 00:58:34 -06:00
Behdad Esfahbod
b119b48079
[bit-set-invertible] Add unlikely() around inverted checks
2021-08-19 00:51:24 -06:00
Behdad Esfahbod
b94f24ec79
[bit-set-invertible] Implement set algebra
2021-08-19 00:48:00 -06:00
Behdad Esfahbod
6afefe1dc3
[algs] Remove unnecessary struct tag names
2021-08-19 00:27:03 -06:00
Behdad Esfahbod
8aa92ff8f0
[bit-set-invertible] Implement get_min/max
2021-08-18 23:01:06 -06:00
Behdad Esfahbod
18f50275ed
[bit-set] Restructure get_min/max() in prep for adding inverted
2021-08-18 22:08:06 -06:00
Behdad Esfahbod
669b97d949
[bit-set-invertible] Implement iterator
2021-08-18 21:39:04 -06:00
Behdad Esfahbod
c66894d7c9
[bit-set-invertible] Write a subset branch as dagger
2021-08-18 21:24:29 -06:00
Behdad Esfahbod
c39d2f7a76
[bit-set-invertible] Implement add_array / add_sorted_array / intersects
2021-08-18 21:20:54 -06:00
Behdad Esfahbod
0efa614c04
[bit-set] Add del_array/del_sorted_array()
2021-08-18 21:18:32 -06:00
Behdad Esfahbod
48ad9eef1e
[bit-set] Merge page_for_insert() into page_for()
2021-08-18 21:05:21 -06:00
Garret Rieger
280366ba6a
Add TODO to update NN offsets to allow nulls.
2021-08-18 16:52:45 -06:00
Garret Rieger
dc31920bbe
Don't serialize null offsets in CPAL.
...
Fixes https://oss-fuzz.com/testcase-detail/5443213648330752
2021-08-18 16:52:45 -06:00
Khaled Hosny
80ff72f39d
[doc] Misc fixes
2021-08-18 13:16:51 +02:00
Khaled Hosny
9aa6f8a93f
2.9.0
2021-08-18 09:32:04 +02:00
Behdad Esfahbod
f0c3804fa2
[set] Add hb_bit_set_invertible_t and resurrect hb_set_invert()
...
Implementation is NOT complete yet.
2021-08-17 19:53:43 -06:00
Behdad Esfahbod
b5cdbdc030
[set] Turn hb_set_t into instance of template taking implementation t
2021-08-17 10:53:08 -06:00
Behdad Esfahbod
fad452bffb
[set] Move main functionality into hb_bit_set_t
...
To add inversion on top in hb_invertible_set_t and use that as hb_set_t.
2021-08-17 10:47:18 -06:00
Behdad Esfahbod
9cc4da962f
[object] Remove hb_object_is_inert()
2021-08-16 20:17:53 -06:00
Behdad Esfahbod
2d5ef05d67
Use !g_object_is_valid() instead of g_object_is_inert()
2021-08-16 20:13:58 -06:00
Behdad Esfahbod
f6d6eff6a2
[object] Remove unused HB_REFERENCE_COUNT_INIT
2021-08-16 19:41:44 -06:00
Behdad Esfahbod
f245dc4db8
[set] Whitespace
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
9b390f8c40
[set] Move page_t into hb-bit-page.hh
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
0c3e02ee2d
[set] Add "inverted" to page_t::is_empty()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
9bd64fa077
[set] Add "inverted" to page_t::next/prev()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
c88e7ec935
[set] Add page_t::elt_maybe_invert()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
9449cfeefd
[set] Simplify page_t::next/prev()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
4394ee1f1d
[set] Add inverted to page_t::get_min/max()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
0dcd9b15d9
[set] Add page_t::set_range()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
cb273fd17c
[set] Add page_t::set()
2021-08-15 18:59:58 -06:00
Behdad Esfahbod
32bbf53d9c
[set] Minor rewrite one cmp() in term of other
2021-08-15 18:59:58 -06:00
Garret Rieger
cb05c363d7
[subset] add some basic tests for the legacy subset methods.
2021-08-14 10:37:02 -06:00
Garret Rieger
d18aad7ec5
[subset] restore old subsetting api methods.
...
These will be left in place until the 3.0.0 release.
2021-08-14 10:37:02 -06:00
Garret Rieger
c0f3af91b8
[subset] speed up add_gid_and_children and adjust op limit.
...
Fix for fuzzer timeout: https://oss-fuzz.com/testcase-detail/5001604901240832 .
- Operation limit is per glyph, so 100,000 should still be far more than needed.
- Switches from for(...) to while(...) loop for iteration. for(...) calls it.end() which in this case triggers a complete iteration.
- Cache CompositeGlyph size in the iterator to avoid needing to recalculate it.
2021-08-12 14:50:42 -06:00
Garret Rieger
c08f1b8903
[map] fix incorrect population count in hash map.
...
If the same key was set twice the population was being incorrectly incremented.
2021-08-10 14:00:55 -06:00
Garret Rieger
e39c3bde7b
[subset] fix bug in parsing glyf flags.
...
the bytes of the flag stream were being treated as signed integers instead of unsigned as specified in the spec.
2021-08-10 12:57:07 -06:00
Ben Wagner
f5ba1fabce
Fix documentation of hb_subset_flags_t defaults
...
HB_SUBSET_FLAGS_DEFAULT is 0, and hb_subset_input_create_or_fail
initializes its flags to HB_SUBSET_FLAGS_DEFAULT, so currently all flags
are set to false by default. It has been decided that future flags will
also be false by default for simplicity (using NO_ in the name if
needed). Correct and simplify the documentation for hb_subset_flags_t to
reflect this.
2021-08-09 09:05:24 -06:00
Garret Rieger
8c0c217b5a
[subset] fail reference blob in face builder if allocation for table sorting fails.
...
Fixes https://oss-fuzz.com/testcase-detail/5041767803125760
2021-08-06 15:54:41 -06:00
Garret Rieger
e5bfd49ae5
[subset] don't allow table adds for tag == -1.
2021-08-05 17:49:37 -06:00
Garret Rieger
222b74f08f
[subset] don't leak memory for duplicate tables.
2021-08-05 17:49:37 -06:00
Behdad Esfahbod
f7a9c3ea93
[open-file] Use hb_is_source_of instead of hb_is_iterator
2021-08-05 13:05:07 -06:00
Behdad Esfahbod
fa90cb8a31
Whitespace again
2021-08-05 12:31:06 -06:00
Behdad Esfahbod
a110a47eb5
Whitespace
2021-08-05 12:28:39 -06:00
Behdad Esfahbod
2cb8c928d7
[face] Let hashmap derive invalid key/value types
...
Works now with the previous two fixes.
2021-08-05 12:27:22 -06:00
Behdad Esfahbod
95c888e192
[meta] Define hb_int_min for pointer types as nullptr
2021-08-05 12:27:02 -06:00
Behdad Esfahbod
407a112e7b
[meta] Make hb_is_signed/hb_is_unsigned work on all types
...
They were failing if type was non-scalar, eg. pointer.
2021-08-05 12:23:53 -06:00
Behdad Esfahbod
baf2166a24
[meta] Use hb_true_type/hb_false_type more
2021-08-05 12:08:47 -06:00
Behdad Esfahbod
74ad5ddcd7
[face] Minor cleaning of previous commit
2021-08-05 11:51:54 -06:00
Garret Rieger
c2ee1fdd40
[subset] remove unsed table_entry struct.
2021-08-05 11:47:07 -06:00
Garret Rieger
dea0fe5717
[subset] discard extra copies of a table in face builder.
...
Fixes #2361 . Stores tables in the builder in a hashmap so you end up with at most one copy of each table. Table serialization order is now based on tag sort order instead of order of insertion into the builder.
2021-08-05 11:47:07 -06:00
Behdad Esfahbod
368e957887
[ot-shape] Add comment re `vert` feature
2021-08-05 10:41:18 -06:00
Garret Rieger
2c024dc3cb
[subset] prune redundant cmap12 subtables.
...
If the post subset cmap12 table is equivalent to another cmap subtable don't include the 12 table in the final subset. Matches change https://github.com/fonttools/fonttools/pull/2146 from fontTools.
2021-08-04 17:36:24 -06:00
Behdad Esfahbod
09c3b82f5e
[buffer] When shifting forward, leave no gap
...
Trying to see if this fixes the fuzzer issue:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36236
2021-08-04 11:55:53 -06:00
Behdad Esfahbod
a150baf32c
[ot-map] Allocate top mask bit as global bit
...
Avoids undefined-shift of 32 in the following line:
map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit)
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1219263
2021-08-04 11:53:27 -06:00
Behdad Esfahbod
e80c86ffa6
[coretext] Fix formatting
2021-08-04 10:25:06 -06:00
Simon Cozens
66aef2818e
Support passing variations to coretext shaper
2021-08-04 10:24:40 -06:00
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