Commit Graph

11420 Commits

Author SHA1 Message Date
Behdad Esfahbod 5d6f1a88e4 [layout] Add hb_ot_layout_get_optical_bound() 2022-09-01 13:36:26 -06:00
Behdad Esfahbod 14eb3d37ad [layout] Improve annotations 2022-09-01 13:18:42 -06:00
Qunxin Liu f8ddb9998b [instance] Fix os/2 table width to widthclass mapping 2022-09-01 09:44:28 -07:00
Qunxin Liu 8f84c58a34 [instance] don't copy phantom points from component
No need to consider USE_MY_METRICS for instancing
2022-09-01 09:44:28 -07:00
Qunxin Liu 58dbc00162 [instance] Fix compiling Composite glyph bytes
The x/y offset encoded with int8 originally might overflow after deltas
are applied. So we cannot just copy and update old values.
2022-09-01 09:44:28 -07:00
Qunxin Liu 8b7e2a1373 [instance] we need to update hmtx/vmtx values even for empty glyphs
Update metrics using the 4 phantom points
2022-09-01 09:44:28 -07:00
Qunxin Liu 7d7b492344 [instance] move _normalize_axes_location to the beginning of
subset_plan_create

pinned_at_default flag decides whether delta will be collected as well
when collecting layout variation indices
2022-09-01 09:44:28 -07:00
Qunxin Liu 6de0a6f0b7 [instance] update GPOS ValueRecord table 2022-09-01 09:43:46 -07:00
Qunxin Liu 61636d4efe [instance] update GPOS AnchorFormat3 table 2022-09-01 09:37:00 -07:00
Qunxin Liu 9ab6605f20 [instance] update GDEF table 2022-09-01 09:35:22 -07:00
Qunxin Liu b72995ff16 [instance] GDEF table: collect both varidxes and deltas 2022-09-01 09:33:02 -07:00
Qunxin Liu e03043bd0b [subset] don't let VariationStore subset() produce inner_maps
Make it a subset-planning object so VariationStore can subset to
specified inner_maps.

Also add a layout_variation_idx_delta_map in subset_plan
2022-09-01 09:32:41 -07:00
Matthias Clasen 29d5c7f67a docs: Improve docs for some apis
Various functions take hb_tag_t arrays. Those
arrays are expected to be 0-terminated. Document
that.
2022-08-31 14:54:12 -06:00
Behdad Esfahbod c96bfca380 [get-alternates] Minor simplify 2022-08-31 08:05:14 -06:00
Behdad Esfahbod 41aa02ae72 [layout] Improve get_feature_tags documentation
Fixes https://github.com/harfbuzz/harfbuzz/issues/3798
2022-08-29 11:17:22 -06:00
David Corbett 14e754cd2c [Unicode 15] Update the Arabic joining script list 2022-08-27 19:11:19 -04:00
David Corbett 29386d963c [Unicode 15] Send the new scripts to USE 2022-08-27 19:11:19 -04:00
David Corbett cc0e0f7056 [Unicode 15] Update the USE table 2022-08-27 19:11:19 -04:00
David Corbett e93c2d1309 [Unicode 15] Update the emoji table & cluster test 2022-08-27 19:11:19 -04:00
David Corbett f0da4a587a [Unicode 15] Update the vowel constraint table 2022-08-27 19:11:19 -04:00
David Corbett a223a61209 [Unicode 15] Update the Indic table 2022-08-27 19:11:19 -04:00
David Corbett 8467e12a74 [Unicode 15] Update the Arabic table 2022-08-27 19:11:19 -04:00
David Corbett d0c32c5a0e [Unicode 15] Update the UCD table 2022-08-27 19:11:16 -04:00
David Corbett 893512219e Add a target to download Blocks.txt 2022-08-27 19:08:02 -04:00
David Corbett b68d0af889 [Unicode 15] Add new `hb_script_t` values 2022-08-27 15:41:07 -04:00
David Corbett f9d48150e1 Regenerate files using Ragel 2022-08-27 15:39:39 -04:00
Khaled Hosny 371c88678f Add few missing since tags 2022-08-23 22:30:39 +02:00
Behdad Esfahbod 84d33a1ed8 [glyf] Fix compiler warning 2022-08-23 13:13:13 -06:00
Qunxin Liu f887ee0c67 [instance] update post.italicAngle
Add tests for instancing glyf/hmtx
2022-08-22 09:30:09 -07:00
Qunxin Liu 4882c717b5 [instance] update OS/2.usWeightClass and OS/2.usWidthClass 2022-08-22 09:30:09 -07:00
Qunxin Liu ac0e22fa8e [instance] update glyf/hmtx/vmtx tables 2022-08-22 09:29:37 -07:00
Behdad Esfahbod 23461b7502 [hb-ft] Only apply FT_Face's transform if we created FT_Face
Fixes https://github.com/harfbuzz/harfbuzz/issues/3788

https://github.com/harfbuzz/harfbuzz/issues/3790
2022-08-19 10:28:30 -06:00
Behdad Esfahbod 4f59211762
Merge pull request #3787 from harfbuzz/split_mark_base_bos
[repacker] Add support for splitting MarkBasePosFormat1 in the packer.
2022-08-18 16:33:44 -06:00
Behdad Esfahbod 2eda2ab3bb [object] Forward hb_object_create() arguments to constructor 2022-08-18 16:15:54 -06:00
Behdad Esfahbod df040de9b4 [array] Add a std::forward 2022-08-18 16:15:00 -06:00
Behdad Esfahbod c606978ee0 [array] Remove unused type pack 2022-08-18 16:13:56 -06:00
Garret Rieger 37d61afd5e [subset] add destructor to subset plan.
This ensures that it's members get destructed before the plan itself is destructed, as hb_object_destroy calls the destructor for plan.
2022-08-18 16:09:36 -06:00
Garret Rieger a91bfeeda5 [repacker] comment cleanup. 2022-08-18 22:01:48 +00:00
Garret Rieger 015ca5bc3c [repacker] fix compiler alignment warning. 2022-08-18 21:52:55 +00:00
Behdad Esfahbod de37b2650d [object] Only destruct object if it's not trivially-destructible
Such that we're legally free to access the object to destruct its
(pointer) fields ourselves afterwards.  For things like hb_font_t,
hb_face_t, etc.
2022-08-18 15:21:48 -06:00
Garret Rieger 683c5dd21e [repacker] further reduce base count. 2022-08-18 20:57:04 +00:00
Garret Rieger 5ddf41fc9c [repacker] speed up MarkBasePos test case by using a smaller basecount. 2022-08-18 20:28:05 +00:00
Garret Rieger bf28b84ae8 [repacker] cleanup unused base_array_id. 2022-08-18 01:51:37 +00:00
Garret Rieger 31976bfb50 [repacker] cleanup unused base_array_links. 2022-08-18 01:50:35 +00:00
Garret Rieger 6f5c52b604 [repacker] optimize AnchorMatrix::clone.
Previous runtime is O(n^2) reduced to O(n).
2022-08-18 01:48:10 +00:00
Garret Rieger 29e3b2467e [repacker] optimzie remove_real_links as it's a hot method. 2022-08-18 01:19:54 +00:00
Garret Rieger 46b5dbd7ce [repacker] optimize index_for_offset. 2022-08-18 01:18:16 +00:00
Garret Rieger 52303638b9 [repacker] correct size calculation for MarkBasePosFormat1. 2022-08-18 01:10:42 +00:00
Garret Rieger ac1a853abc [repacker] implement sanitize methods for MarkBasePos. 2022-08-18 00:55:47 +00:00
Garret Rieger a3ed9f9099 [repacker] fix graph comparison, and mark base pos generation for the tests. 2022-08-17 23:39:11 +00:00
Garret Rieger 19c51ed35c [repacker] Get mark base pos test working. 2022-08-17 19:15:55 +00:00
Garret Rieger b46ced9562 [repacker] correct MarkArray size calculation. 2022-08-17 17:51:29 +00:00
Garret Rieger 36c76c27c6 [repacker] when clearing links in MarkArray, also clear parents of the children. 2022-08-17 17:30:21 +00:00
Garret Rieger 8c3db8bdfd [repacker] more progress on MarkBasePos tests. 2022-08-17 00:36:23 +00:00
Garret Rieger 1405f96b6f [repacker] change run_resolve_overflow_test to check for graph equivalence.
Replaces a check for an exact match on the final serialized bytes. The previous check enforced equivalent topological sorting between result and expected, but we only really care that the graph's are equivalent and don't overflow.
2022-08-15 23:48:00 +00:00
Garret Rieger 07fd0528c0 [repacker] add graph equality check.
Does not compare topological sorting, but looks for equivalence of the two graphs.
2022-08-15 23:16:51 +00:00
Garret Rieger 5cf2a25a60 [repacker] Expose on internal method in the repacker that allows the caller to pass in/out a graph.
Will be used in testing so we can compare graphs instead of packed result.
2022-08-15 22:49:24 +00:00
Garret Rieger c414ef292b [repacker] Implement MarkArray::shrink. 2022-08-15 22:10:37 +00:00
Behdad Esfahbod 4ab7e579cb Make HB_BORING_EXPANSION opt-in instead of opt-out
Fixes https://github.com/harfbuzz/harfbuzz/issues/3757
2022-08-12 12:23:48 -06:00
Garret Rieger f8b5520556 [repacker] Add AnchorMatrix::shrink. 2022-08-11 23:09:36 +00:00
Garret Rieger bbe14417ad [repacker] Begin implementing MarkBasePosFormat1::shrink. 2022-08-11 22:53:30 +00:00
Garret Rieger c9ddf0815a [repacker] Implement AnchorMatrix::clone. 2022-08-11 22:34:59 +00:00
Garret Rieger 5ea3c0be8f [repacker] Implement MarkArray::clone. 2022-08-11 22:21:28 +00:00
Garret Rieger 0083fd109c [repacker] add as_table() helper to graph. 2022-08-11 22:09:46 +00:00
Garret Rieger b00eb77682 [repack] Add add_link helper to graph. 2022-08-11 20:33:21 +00:00
Garret Rieger 1acd2a8bf9 [repacker] implement MarkBasePosFormat1::clone_range. 2022-08-11 20:22:31 +00:00
Garret Rieger cf817f3d99 [repacker] Hook up MarkBasePos splitting. 2022-08-11 19:26:59 +00:00
Garret Rieger 4418beac93 [repacker] start implmenting MarkBasePos splitting. 2022-08-11 19:08:04 +00:00
Behdad Esfahbod f4f7d691af
Merge pull request #3779 from harfbuzz/split_pair_pos_2
[repacker] Add PairPosFormat2 table splitting in the repacker.
2022-08-09 22:23:23 -06:00
Garret Rieger fa46dbca9d [repacker] Make actuate_subtable_split internal. 2022-08-08 17:07:14 +00:00
Garret Rieger fe15f2559f [repacker] use position instead of memory address as key in device_tables map. 2022-08-08 16:57:28 +00:00
Garret Rieger 163fbf0be1 [repacker] Check for nullptr's before sanitizing. 2022-08-05 23:37:11 +00:00
Garret Rieger 13253233f7 [repacker] in PairPosFormat2 splitting use the max estimated coverage/classdef size for sizing serialization buffers. 2022-08-05 23:15:10 +00:00
Garret Rieger dde0a2b071 [repacker] track estimated coverage size during PairPosFormat1 split point analysis. 2022-08-05 22:30:37 +00:00
Garret Rieger b37e8bef0e [repacker] count size of the current class at the split point in the next segment. 2022-08-05 22:16:20 +00:00
Qunxin Liu 7fde6ab025 fuzzer fix: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49790 2022-08-05 15:10:31 -06:00
Behdad Esfahbod a4e0fd1685 [MultipleSubst] Rewrite serialize signature as single iterator 2022-08-05 15:05:51 -06:00
Behdad Esfahbod 65d28bc5a7 [MultipleSubst] Rewrite serialize() in terms of iterators
Unused still, and hence untested
2022-08-05 14:56:07 -06:00
Behdad Esfahbod b57ea3b053 Revert "[iter] Use && in uses of is_source_of"
This reverts commit ccbba667a9.
2022-08-05 14:29:27 -06:00
Garret Rieger 0e48a65d32 [repacker] estimate size of classDef1 and coverage during PairPos2 split point analysis. 2022-08-05 20:19:11 +00:00
Garret Rieger 2264df6da3 [repacker] add utility that can calculate the size of Coverage+ClassDef via incremental class inclusion. 2022-08-05 18:33:03 +00:00
Behdad Esfahbod ccbba667a9 [iter] Use && in uses of is_source_of 2022-08-05 11:51:51 -06:00
Behdad Esfahbod 8fb7cc1c63 [iter] Use && in is_sink_of uses 2022-08-05 11:49:29 -06:00
Garret Rieger 5d824c09c0 [repacker] during table splits don't mutate shared coverage/classdef in place.
If other subtables are sharing coverage with a subtable being split we have to duplicate the coverage/classdef tables before they are modified during the shrink operation.
2022-08-05 01:37:14 +00:00
Garret Rieger e1ab355056 [repacker] correct lookup link insertion. 2022-08-05 01:25:16 +00:00
Garret Rieger a733a9afa5 [repacker] insert new subtables immediately after the subtable they split from in the lookup. 2022-08-05 00:32:47 +00:00
Garret Rieger 506547c958 [repacker] Use hb_pair_t constructor instead of hb_pair ().
hb_pair was causing corrupted gid values.
2022-08-04 21:36:21 +00:00
Garret Rieger fdd1952c75 [repacker] PairPosFormat2 splitting - fix coverage and classdef splitting.
The old code was splitting based on coverage index, but should have been splitting on class value.
2022-08-04 19:21:16 +00:00
Behdad Esfahbod c67c1b745b VarStore: simplify again 2022-08-04 11:42:22 -06:00
Behdad Esfahbod 914542bd18 Whitespace 2022-08-04 11:40:54 -06:00
Behdad Esfahbod d7adc55e18 [ot-font] Allow 24bit glyphs in advance cache 2022-08-04 11:40:54 -06:00
Behdad Esfahbod 99070a734a [cache] Use short instead of int if fits 2022-08-04 11:40:54 -06:00
Qunxin Liu d831e935df bug fix in VarData get_delta ()
when LONG_WORDS flag is set, item row is not computed correctly
lcursor should be interpreted as INT32
2022-08-04 11:40:42 -06:00
Garret Rieger b154b1e4c3 [repacker] pull out PairPosFormat1,2::do_split() into a common helper method. 2022-08-04 01:37:21 +00:00
Garret Rieger 88e0dd02cb [repacker] add sanitization for PairPosFormat2. 2022-08-04 01:03:07 +00:00
Garret Rieger 51a5060273 [repacker] add test for splitting a PairPos2 w/ device tables. 2022-08-03 22:30:42 +00:00
Garret Rieger 54fab21cb1 [repacker] get basic pair pos 2 split test working. 2022-08-03 21:57:37 +00:00
Garret Rieger 60d6ffb375 [repacker] always duplicate classDef2 when splitting a PairPos2.
Splits are done in a way that it shouldn't be possible to share the classDef2 between split PairPos2's so pre-emptively duplicate it.
2022-08-03 21:01:23 +00:00
Garret Rieger 6be152420f [repacker] add basic test for PairPos2 splitting. 2022-08-03 19:02:20 +00:00
Behdad Esfahbod b78546b1d2 [cache] Residual 2022-08-03 13:02:18 -06:00
Behdad Esfahbod ec90d1e161 [cache] Add a non-threadsafe version
Use in hb-ft, since already mutex'ed.
2022-08-03 13:01:04 -06:00
Behdad Esfahbod f73c15ca6c [atomic-int] Add operators for relaxed ops 2022-08-03 13:01:04 -06:00
Behdad Esfahbod 86d1e22d4f [atomic-ptr] Rename get 2022-08-03 13:01:04 -06:00
Behdad Esfahbod d3f2287e0b [atomic-int] Rename get/set 2022-08-03 13:01:04 -06:00
Behdad Esfahbod c80e32972f [mvar] Use VarIdx 2022-08-03 11:31:34 -06:00
Khaled Hosny 52bdc750c1 Revert "[meson] Use pathlib in gen-harfbuzzcc.py"
This reverts commit eaf7e5686c.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3776

No idea what is going on, but lets restore the old code.
2022-08-03 10:40:57 +02:00
Garret Rieger 65ed82fde5 [repacker] PairPosFormat2::do_split. 2022-08-02 22:22:42 +00:00
Garret Rieger f43055f35a [repacker] Implement PairPosFormat2::shrink. 2022-08-02 22:16:29 +00:00
Khaled Hosny 16bfe6536b [meson] use cpp.get_argument_syntax not cpp.get_id
To account for both MSVC and clang-cl.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3756
2022-08-03 00:07:40 +02:00
Garret Rieger 9f2a44640c [repack] implement device table transfer for PairPosFormat2. 2022-08-02 21:47:53 +00:00
Garret Rieger 22eae32b3b [repacker] add classDef1 clone_range to PairPosFormat2 split. 2022-08-02 21:04:38 +00:00
Garret Rieger 68b90153ea [repacker] Add class def sanitize and range cloning. 2022-08-02 20:58:35 +00:00
Garret Rieger ca0df565f7 [repacker] extract coverage cloning into helper. 2022-08-02 20:04:46 +00:00
Behdad Esfahbod ee18ae3b76 [avar] Minor move code around 2022-08-02 12:56:06 -06:00
Garret Rieger 7f4b2037a5 [repacker] include size of device tables when determining PairPos2 split points. 2022-08-02 18:43:25 +00:00
Behdad Esfahbod 826639fab2 [src] Add test-use-table
Fixes https://github.com/harfbuzz/harfbuzz/issues/3758
2022-08-02 12:18:18 -06:00
Garret Rieger 58fdbd8e5d [repacker] begin adding PairPosFormat2 splitting support. 2022-08-02 17:32:13 +00:00
Behdad Esfahbod e387b3acd3 [ft] Try harder 2022-08-02 10:02:48 -06:00
Khaled Hosny 40a3468906 hb-ft: cast to float to help windows sqrtf 2022-08-02 10:02:48 -06:00
Behdad Esfahbod 6549aec89d [SingleSubstFormat1] Help avoid timeouts in closure() some more
For https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49712
2022-08-01 13:11:14 -06:00
Behdad Esfahbod ba9b20534c [ft] Try working around fonts with transform set
Fixes https://github.com/harfbuzz/harfbuzz/issues/3772
2022-08-01 12:42:05 -06:00
psykose 04d28d94e5 [repacker] fix signedness of char in tests 2022-08-01 11:48:57 -06:00
Khaled Hosny f1f2be776b 5.1.0 2022-07-31 15:48:32 +02:00
Khaled Hosny d6e55f1baf [automake] Use LANG=C when generating harfbuzz*.cc
Since `sort` is locale-dependent.
2022-07-30 23:35:47 +02:00
Behdad Esfahbod a722b3e666 [shape] Only add any unsafe-to-concat flag if requested
Previously it was confusing as random incorrect flags were produced.
2022-07-30 14:33:33 -06:00
Behdad Esfahbod 0a31cfb225 [buffer] Fix produce-tatweel enum value 2022-07-30 14:32:58 -06:00
Behdad Esfahbod a0111e4fab [graph] Fix warning
Fixes https://github.com/harfbuzz/harfbuzz/issues/3766
2022-07-30 12:09:45 -06:00
Behdad Esfahbod 083d4ef5c4 [harfbuzz-subset.cc] Revert back the sort order
Generator seems unstable.
2022-07-30 11:53:56 -06:00
Behdad Esfahbod 065f1e33c8
Merge pull request #3763 from harfbuzz/split_pair_pos
[repacker] Add ability for repacker to pre split PairPosFormat1 subtables.
2022-07-30 11:09:33 -06:00
Behdad Esfahbod 7c9e1ffa7c
Merge pull request #3762 from harfbuzz/safe-to-kashida
Prototype glyph flag safe-to-kashida
2022-07-30 10:33:27 -06:00
Behdad Esfahbod f43dadb8ee Rename kashida -> tatweel 2022-07-30 10:23:03 -06:00
Behdad Esfahbod 73c3ac9172 Document kashida stuff 2022-07-30 10:21:34 -06:00
Behdad Esfahbod d277addb2f [buffer] Add HB_BUFFER_FLAG_PRODUCE_SAFE_TO_INSERT_KASHIDA 2022-07-30 10:10:21 -06:00
Behdad Esfahbod 915e12ccbb Prototype glyph flag safe-to-kashida
Fixes https://github.com/harfbuzz/harfbuzz/issues/3721
2022-07-30 10:05:36 -06:00
Behdad Esfahbod 5e31a582c9 [emoji] Bump compression level 2022-07-30 00:09:33 -06:00
Behdad Esfahbod 56a5bc3bd0 [emoji] Regenerate test data
Fix generator.
2022-07-30 00:08:44 -06:00
Behdad Esfahbod 90a3355e66 [ucd-table] Use more compact compression numbers
Doesn't show any slowdown in benchmarks.
2022-07-30 00:01:50 -06:00
Behdad Esfahbod 23dbd35ca3
Merge branch 'main' into split_pair_pos 2022-07-29 19:51:57 -06:00
Behdad Esfahbod a5d9012e94 Revert "[ot-font] Minor simplification"
This reverts commit 28c02b3768.

Old code was used in case of memory allocation failure (as shown
by fuzzers...)
2022-07-29 19:51:00 -06:00
Garret Rieger 9578c44ea2 [repacker] add HB_FALLTRHOUGH. 2022-07-29 22:21:32 +00:00
Garret Rieger 6a5e2cb2f8 [repacker] add todo. 2022-07-29 22:21:32 +00:00
Garret Rieger 14f95ee0cf [repacker] re-count shared node sizes in split PairPos segments. 2022-07-29 22:21:32 +00:00
Garret Rieger 3b91fb2a9f [repacker] cleanup todo. 2022-07-29 22:21:31 +00:00
Garret Rieger a0b8893e46 [repacker] add Coverage sanitize. 2022-07-29 22:21:31 +00:00
Garret Rieger 38846f41d3 [repacker] more TODO cleanup. 2022-07-29 22:21:31 +00:00
Garret Rieger 46c1fa7d1b [repacker] sanitize PairPos during subtable extension. 2022-07-29 22:21:31 +00:00
Garret Rieger 2a5902ee50 [repacker] cleanup. 2022-07-29 22:21:31 +00:00
Garret Rieger 674f0194a3 [repacker] add extension pairpos split test. 2022-07-29 22:21:31 +00:00
Garret Rieger 1d2516f037 [repack] get basic pairpos split test working. 2022-07-29 22:21:31 +00:00
Garret Rieger fb3f6ad7c0 [repacker] ensure lookup map is updated when lookup memory location changes. 2022-07-29 22:21:31 +00:00
Garret Rieger 4e7360f78d [repacker] begin adding tests for PairPosFormat1 splitting. 2022-07-29 22:21:31 +00:00
Garret Rieger f1bfb6585f [repacker] cleanup debug prints. 2022-07-29 22:21:31 +00:00
Garret Rieger 65afed047d [repacker] more bug fixes. 2022-07-29 22:21:31 +00:00
Garret Rieger 1002a3dcd3 [repacker] bug fixes. 2022-07-29 22:21:31 +00:00
Garret Rieger a5c2c8c131 [repack] fix incorrect shrink. 2022-07-29 22:21:31 +00:00
Garret Rieger d589ce68ea [repacker] add extension subtable when needed while adding new PairPos table's. 2022-07-29 22:21:31 +00:00
Garret Rieger 5024d4de67 [repack] more PairPos split implementation. 2022-07-29 22:21:31 +00:00
Garret Rieger 510b8ab101 [repack] link new coverage in PairPosFormat1::clone_range. 2022-07-29 22:21:31 +00:00
Garret Rieger 29cb8818cd [repacker] new coverage serialization in PairPosFormat1. 2022-07-29 22:21:31 +00:00
Garret Rieger 8d63f60e5b [repack] add graph_t::move_child helper function. 2022-07-29 22:21:31 +00:00
Garret Rieger 8e5fffc44a [repack] add helper to create new nodes.
Switch to malloc'ing each node individually rather than trying to guess up front the total buffer space needed.
2022-07-29 22:21:31 +00:00
Garret Rieger bf0986c7d1 [repack] sketch splitting mechanism for PairPosFormat1. 2022-07-29 22:21:30 +00:00
Garret Rieger f6a242b605 [repacker] begin adding PairPos splitting support. 2022-07-29 22:21:30 +00:00
Garret Rieger 69913e012e [repacker] Update repacker api method to take a table tag.
This is needed to allow table specific optimizations to be performed during repacking.
2022-07-29 16:16:46 -06:00
Behdad Esfahbod 28c02b3768 [ot-font] Minor simplification 2022-07-29 15:55:16 -06:00
Behdad Esfahbod 149b030520 Fix thinko 2022-07-29 12:41:30 -06:00
Behdad Esfahbod f7677213d7 [SingleSubstFormat1] Don't close glyphs in degenerate cases
Fixes https://oss-fuzz.com/testcase-detail/5145429829877760
2022-07-29 12:00:29 -06:00
Behdad Esfahbod 3da50c50aa Remove unused const 2022-07-29 11:57:15 -06:00
Khaled Hosny 0c4495e555 [meson] Don’t use f-string
It requires Python 3.6+
https://github.com/harfbuzz/harfbuzz/pull/3760#issuecomment-1198972788
2022-07-29 13:22:18 +02:00
Behdad Esfahbod e51526bf06 [CompositeGlyph] Add HB_NO_BEYOND_64K 2022-07-28 09:53:30 -06:00
Behdad Esfahbod 6e6b9cf972 [use-table] Adjust main() code 2022-07-28 09:48:43 -06:00
Khaled Hosny eaf7e5686c [meson] Use pathlib in gen-harfbuzzcc.py 2022-07-28 13:49:06 +02:00
Khaled Hosny 5df2347cf3 [meson] Don’t tamper with paths in amalgam files
Using os.path.basename() breaks files in subdirectories
(gsubgpos-graph.cc instead of graph/gsubgpos-graph.cc).

Use paths relative to current source dir instead.
2022-07-28 13:49:06 +02:00
Behdad Esfahbod 0c5b60acbd [use-table] Fix previous commit 2022-07-27 14:00:06 -06:00
Behdad Esfahbod 0788f77371 [use-table] Add a main() to print categories 2022-07-27 13:58:44 -06:00
Behdad Esfahbod 9aaa835ac1 [use-table] Regenerate with latest packtab 2022-07-27 12:24:43 -06:00
Behdad Esfahbod 3698ae25bf [harfbuzz-subset.cc] Update 2022-07-26 14:41:34 -06:00
Behdad Esfahbod e2cc34e190 [subset/GPOS] Fix a fuzzer timeout test
Fixes https://oss-fuzz.com/testcase-detail/5234369031176192
2022-07-26 12:31:40 -06:00
Garret Rieger 241ebc9354 [repacker] fix include paths. 2022-07-26 12:22:17 -06:00
Garret Rieger 5f4adb9bf3 [repacker] fix to lookup size comparison. 2022-07-26 12:22:17 -06:00
Garret Rieger 6627204c4d [repacker] Makefile fix. 2022-07-26 12:22:17 -06:00
Garret Rieger f56e66f3f0 [repacker] for ext promotion choose lookups from highest subtables per byte to lowest.
Attempts to roughly maximize the number of subtables that are non-ext.
2022-07-26 12:22:17 -06:00
Garret Rieger 9d0b2da51b [repacker] count subtable size in each group of consecutive layers for extension promotion decisions.
Enforce that the following groups are all <64k in size:
- LookupList + Lookups
- Lookups + SubTables
- SubTables + Descendants
2022-07-26 12:22:17 -06:00
Garret Rieger 3d37b9f4db [repacker] when calculating 16bit space size also consider ext lookup subtables. 2022-07-26 12:22:17 -06:00
Garret Rieger 9db3beb721 [repacker] include LookupList size when calculating size of 16bit space for ext promotion decisions. 2022-07-26 12:22:17 -06:00
Garret Rieger e0607af976 [repacker] Use extension promotion when repacking invoked via hb-subset-repacker (eg. from fonttools). 2022-07-26 12:22:17 -06:00
Garret Rieger 8d611a7fd0 [repacker] remove temporary visibility overrides in gsubgpos. 2022-07-26 12:22:17 -06:00
Garret Rieger 7de136f8a8 [repacker] add ext promotion test. 2022-07-26 12:22:17 -06:00
Garret Rieger c38896e07c [repacker] todo. 2022-07-26 12:22:17 -06:00
Garret Rieger ad0041f5f7 [repacker] Add basic version of the extension promotion selection algorithm. 2022-07-26 12:22:17 -06:00
Garret Rieger 0b6ca424fc [repacker] fix GSTAR sanitize. 2022-07-26 12:22:17 -06:00
Garret Rieger 11709f0fbe [repacker] support extension promotion in 24bit GSUB/GPOS. 2022-07-26 12:22:17 -06:00
Garret Rieger b37374b04f [repacker] save buffer reference (not copy). 2022-07-26 12:22:17 -06:00
Garret Rieger ae290ff4fe [repacker] add sanitization for GSUB/LookupList/Lookup during extension promotion. 2022-07-26 12:22:17 -06:00
Garret Rieger ce03c3538a [repacker] add make_extension_context_t. 2022-07-26 12:22:17 -06:00
Garret Rieger ebb64b50da [repacker] size buffer correctly. 2022-07-26 12:22:17 -06:00
Garret Rieger 815bb82b4d [repack] fix incorrect extension object bounds. 2022-07-26 12:22:17 -06:00
Garret Rieger 7e6f6c3e88 [repack] fix new node bounds. 2022-07-26 12:22:17 -06:00
Garret Rieger b1d38a6d0b [repack] WIP implement extension promotion mechanism. 2022-07-26 12:22:17 -06:00
Garret Rieger 3f7a74ff40 [repacker] WIP extension promotion implementation. 2022-07-26 12:22:17 -06:00
Behdad Esfahbod 1945b400da [cpluscplus] Wrap hb-subset types as well
Also changes signature of get_user_data of hb.h types to take const
object. This is safe.
2022-07-25 10:45:55 -06:00
Behdad Esfahbod 1ac21246a7 [hb-ft] Fix bitmap font rendering with hb_ft_font_changed()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3754
Fixes https://github.com/harfbuzz/harfbuzz/issues/3755
2022-07-25 08:40:02 -06:00
Behdad Esfahbod 94de328011 [GSUB/GPOS] Adjust buffer message 2022-07-24 18:51:55 -06:00
Behdad Esfahbod bc80e4b923 [GSUB/GPOS] More buffer message for contextuals
Fixes https://github.com/harfbuzz/harfbuzz/issues/3753
2022-07-24 18:50:14 -06:00
Behdad Esfahbod 59b05359cd [GSUB/GPOS] Add more buffer messages
Behind HB_BUFFER_MESSAGE_MORE.

https://github.com/harfbuzz/harfbuzz/pull/3495
2022-07-24 18:39:30 -06:00
Behdad Esfahbod 0722b627f4 [buffer] Return delta from sync_so_far 2022-07-24 17:35:44 -06:00
Behdad Esfahbod c55c019771 [buffer] Add assertions of buffer sync status to message_impl 2022-07-24 16:30:33 -06:00
Behdad Esfahbod da9edce84c [buffer] Add sync_so_far()
This removes separate out-buffer, at the cost of possibly changing
idx.
2022-07-24 16:30:19 -06:00
Khaled Hosny cbccadba8d 5.0.1 2022-07-23 22:09:06 +02:00
Behdad Esfahbod 61d0c54701 [ft] Pass design, not normalized, coords to freetype
Needed for avar2 to work.
2022-07-23 13:26:18 -06:00
Behdad Esfahbod 473a5e5651 [font] Fix design-coords
Ouch!
2022-07-23 13:26:18 -06:00
Khaled Hosny 40b21edf48 5.0.0 2022-07-23 19:53:14 +02:00
Behdad Esfahbod 4cb83967aa [subset/ClassDefFormat2] Fix timeout
Fixes https://oss-fuzz.com/testcase-detail/5417800474165248
2022-07-23 11:00:20 -06:00
Behdad Esfahbod 32c85b8c8c [avar2] Fix mapping when coords length don't match
Ouch.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49407
2022-07-23 10:50:26 -06:00
Behdad Esfahbod 06c3ec0a19 [avar2] Minor sanitize rewrite 2022-07-23 10:45:28 -06:00
Behdad Esfahbod f94a3ba1db [varStore] Better protect against HB_NO_VAR builds 2022-07-23 10:36:08 -06:00
Behdad Esfahbod 17863bd16b [config/avar2] add HB_NO_VARIATIONS2 2022-07-22 22:38:08 -06:00
Behdad Esfahbod 5a9c7930ef Add HB_NO_BEYOND_64K 2022-07-22 21:33:31 -06:00
Behdad Esfahbod c76fd3c5f9 [avar2] Add link to "Spec". 2022-07-22 15:29:57 -06:00
Behdad Esfahbod edca52c3b6 [avar2] Use a varStore cache 2022-07-22 15:29:57 -06:00
Behdad Esfahbod 59f8afa73e [avar2] Remove XXX item 2022-07-22 15:29:57 -06:00
Behdad Esfahbod d6c4f757a4 [avar2] Clamp out values 2022-07-22 15:29:57 -06:00
Behdad Esfahbod d0e2ad9297 [avar] Pre-alloc vector 2022-07-22 15:29:57 -06:00
Behdad Esfahbod 2a877b554a [avar2] First stab at mapping v2 values 2022-07-22 15:29:57 -06:00
Behdad Esfahbod c3eb6713e9 [avar2] Add v2 structure and sanitize 2022-07-22 15:29:57 -06:00
Behdad Esfahbod c9e843942e [min/max] Don't forward argument 2022-07-22 09:01:28 -06:00
Behdad Esfahbod cb5ca6be29 [ft] Actually call check_changed() from _changed()
Ouch!

Fixes https://github.com/harfbuzz/harfbuzz/issues/3746
2022-07-22 05:48:27 -06:00
Behdad Esfahbod fd535a240b [ft] Remove check_changed from get_glyph_shape()
Leftover.
2022-07-22 05:48:12 -06:00
Behdad Esfahbod 7cdde6a241 [ClassDef] Write a loop as range for 2022-07-21 17:18:45 -06:00
Behdad Esfahbod 0cc2f3c218 [algs] Remove hb_pair_t() 2022-07-21 16:46:45 -06:00
Behdad Esfahbod 9eab3ac72d [CoverageFormat2] Remove hand-written loop
While on a fuzzer-found test case (added) that loop was faster,
on real fonts, including NotoNastaliq in our benchmark, it was
actually slower, which intuitively I would have expected.

Still no idea why on that fuzzer case it's faster though. :(
2022-07-21 12:36:53 -06:00
Behdad Esfahbod bbb4db90dd [Coverage/SingleSubst] Move hand-written loop to Coverage 2022-07-21 12:34:46 -06:00
Behdad Esfahbod 7b95783efb [Coverage] Internal rename 2022-07-21 12:18:51 -06:00
Behdad Esfahbod afa65f2903 [Coverage] Minor type change 2022-07-21 12:17:08 -06:00
Behdad Esfahbod b38587aa0b [Coverage] Internal renames 2022-07-21 12:14:06 -06:00
Behdad Esfahbod 84d38df828 [Coverage] Minor use range-based loop 2022-07-21 12:12:04 -06:00
Behdad Esfahbod b017b73ffe [Coverage] Minor remove a couple unnecessary as_array()'s 2022-07-21 12:06:55 -06:00
Behdad Esfahbod 9e650b4e0c [Coverage] Speedup intersect_set 2022-07-21 12:01:52 -06:00
Behdad Esfahbod efa388074d [subset/SingleSubsetFormat1] Use Coverage.intersect_set 2022-07-21 11:52:36 -06:00
Behdad Esfahbod 00dfbbce1c [Coverage] Rename and templatize intersected_coverage_glyphs 2022-07-21 11:45:05 -06:00
Behdad Esfahbod d0eb273791 [subset/GSUB/GPOS] Use more intersected_coverage_glyphs() 2022-07-21 11:24:56 -06:00
Behdad Esfahbod 450d834679 [subset/PairPosFormat1] Speed up significantly 2022-07-21 11:05:35 -06:00
Behdad Esfahbod 5d7556e184 Revert "[subst/SingleSubstFormat1] Rewrite nicer"
This reverts commit bababe1072.

The hand-written code is still much faster :(.
2022-07-21 10:58:36 -06:00
Behdad Esfahbod 71ce931e6d [PairPos] Don't compute newFormat
It was wrong, because it would be writing wrong values.

Test suite doesn't seem to catch any.
2022-07-21 10:41:29 -06:00
Behdad Esfahbod 02ca025443 [layout] Add large_int to Types 2022-07-21 10:30:23 -06:00
Behdad Esfahbod bababe1072 [subst/SingleSubstFormat1] Rewrite nicer 2022-07-21 10:25:27 -06:00
Behdad Esfahbod cf123e6a0d [Coverage] Add get_population () 2022-07-21 10:24:04 -06:00
Behdad Esfahbod 2ad3c0c770 Fix uninitialized variable 2022-07-21 09:46:25 -06:00
Behdad Esfahbod fa471043fc [subset] Fix previous commit 2022-07-20 22:42:18 -06:00
Behdad Esfahbod c4d2ef9004 [subset] Speed up subsetting of SingleSubstFormat1_3 2022-07-20 22:36:35 -06:00
Behdad Esfahbod d01e6babe6 [subset] Speed up SingleSubstFormat1_3 closure 2022-07-20 22:17:33 -06:00
Qunxin Liu 0f80076937 [subset] Do not repeat COLR table closure 2022-07-20 19:17:34 -06:00
Behdad Esfahbod 9fc31db6fa [blob] Initialize members if ever on the stack 2022-07-20 16:03:02 -06:00
Behdad Esfahbod 60a9175f2c [blob] Remove fini_shallow() 2022-07-20 15:59:46 -06:00
Behdad Esfahbod bcd59b5142 [set/map] Remove init_shallow/fini_shallow() 2022-07-20 15:58:28 -06:00
Behdad Esfahbod 79b23cc25d Fix another leak 2022-07-20 15:38:34 -06:00
Behdad Esfahbod 3fad942ee2 Try fix leak 2022-07-20 15:26:32 -06:00
Behdad Esfahbod e1b5f2f806 [object] Call destructor in hb_object_destroy() 2022-07-20 15:07:55 -06:00
Behdad Esfahbod 9ea4ab6051 [object] Call constructor 2022-07-20 14:57:32 -06:00
Behdad Esfahbod 61c0438425 [map] Allow geting non-const value pointer out with has() 2022-07-20 14:43:58 -06:00
Behdad Esfahbod 00cfc5c17d [map] Don't set out value in has() if not found 2022-07-20 14:38:28 -06:00
Behdad Esfahbod 485f043211 [map] Enable using hashmap with unique_ptr 2022-07-20 14:34:55 -06:00
Behdad Esfahbod 53fd4c9236 [set] A variable rename 2022-07-20 13:33:49 -06:00
Behdad Esfahbod 6826b2c3fd [gsubgpos/closure] Minor condition use bool operator 2022-07-20 13:25:34 -06:00
Behdad Esfahbod 55a1e0bb11 [ot-map] Use hb_array for a return value 2022-07-20 13:15:55 -06:00
Behdad Esfahbod 8d923363db [layout] Reduce number of closure rounds 2022-07-20 12:09:00 -06:00
Behdad Esfahbod aae8c74e05 [>64k:layout:SingleSubstFormat3] Fix masking
https://github.com/be-fonts/boring-expansion-spec/issues/31
2022-07-20 11:51:27 -06:00
Behdad Esfahbod 3c137ef041 [GPOS/CursivePos] Fix unsafe-to-break marking
Fixes test.
2022-07-20 11:29:30 -06:00
Behdad Esfahbod 5998cd00c8 [hebrew] Break out of reordering loop when pattern found 2022-07-20 11:16:32 -06:00
Behdad Esfahbod d861303797 [hebrew] Comment 2022-07-20 10:57:12 -06:00
Behdad Esfahbod c60d810d50 [hebrew] Implement Jerusalem mark reordering
Fixes https://github.com/harfbuzz/harfbuzz/issues/2947
2022-07-20 10:25:31 -06:00
Khaled Hosny 605bb1ee3d [subset] Add amalgam harfbuzz-subset.cc
Fixes https://github.com/harfbuzz/harfbuzz/issues/3733
2022-07-19 17:15:35 -06:00
Qunxin Liu 712bfa8872 build fix for HB_NO_VAR 2022-07-19 15:16:37 -06:00
Behdad Esfahbod 798a0c8a58 Fix build 2022-07-19 14:40:47 -06:00
Behdad Esfahbod 8737dea4d9 [>64k:layout:GDEF] Implement version 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/36

Subset does NOT lower format.
2022-07-19 14:39:47 -06:00
Behdad Esfahbod 8080e01afc [>64k:layout] Templatize GDEFVersion1 2022-07-19 14:35:58 -06:00
Behdad Esfahbod 1665cf6bc4 [>64k:layout] Split GDEFVersion1
https://github.com/be-fonts/boring-expansion-spec/issues/36
2022-07-19 14:21:48 -06:00
Behdad Esfahbod 1de5591cf7 [>64k:layout] Prepare GDEF for templatizing
https://github.com/be-fonts/boring-expansion-spec/issues/36
2022-07-19 14:21:48 -06:00
Khaled Hosny c0d60bd496 [meta] Fix warning with emscripten
For whatever reason, em++ takes the first branch and spouts a gazillion
warnings like:

./harfbuzz/src/hb-vector.hh:229:20: warning: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Wdeprecated-builtins]
            hb_enable_if (hb_is_trivially_copy_assignable(T))>
                          ^
./harfbuzz/src/hb-meta.hh:193:44: note: expanded from macro 'hb_is_trivially_copy_assignable'
2022-07-19 11:33:54 -06:00
Behdad Esfahbod 91c60802e6 [open-type] Fix overflow check
Without the cast, the compiler is within its rights to reason that
overflow didn't happen and optimize away the check, as clang was.
2022-07-18 22:24:28 -06:00
Behdad Esfahbod 4279304a62 [stat] Fix double-promotion warnings 2022-07-18 22:20:06 -06:00
Behdad Esfahbod 54e9ab4a91 [GPOS/Cursive] Fix breaking of parent-child attachment
Mostly fixes https://github.com/harfbuzz/harfbuzz/issues/2469
2022-07-18 18:57:14 -06:00
Behdad Esfahbod c2baf2796c [arabic] Make more features F_MANUAL_ZWJ
The change to `ccmp` fixes shaping of certain sequences with
Calibri on Windows 11.  Addition of `liga` and `clig` is
speculative.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3530
2022-07-18 15:41:20 -06:00
Behdad Esfahbod ddeef8c875 [test-ot-glyphname] Fix return value 2022-07-18 15:13:47 -06:00
Qunxin Liu be8e8e8c80 [instance] prune name tables after axes pinned at fixed locations
Restricting axes to ranges is not supported yet.
2022-07-18 14:59:07 -06:00
Qunxin Liu df55f840cb [instance] instantiate STAT table when axes are pinned at fixed locations
restricting ranges is not supported yet.
2022-07-18 14:59:07 -06:00
Qunxin Liu 2a4773e43d add option "--instance", store axes_location in subset_plan and drop all
variation tables when all axes are pinned at default
2022-07-18 14:59:07 -06:00
Behdad Esfahbod 5744e951fc [gir] Skip graphite API
Fixes https://github.com/harfbuzz/harfbuzz/issues/2557
2022-07-18 14:54:44 -06:00
Behdad Esfahbod 3723b8544b [cff] Better max op counting 2022-07-18 14:00:14 -06:00
Behdad Esfahbod 3c84aa8416 [cff] Add a max work counter
Set to 10,000 per interpretation right now.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3700
Fixes https://oss-fuzz.com/testcase-detail/5667125715927040
2022-07-18 13:57:59 -06:00
Behdad Esfahbod 89de8c700f [CoverageFormat2] Another fix for broken tables
Fixes https://oss-fuzz.com/testcase-detail/6005342714068992
2022-07-18 13:07:29 -06:00
Behdad Esfahbod 4f22397f05 [ft] A couple of introspection fixes 2022-07-18 11:03:54 -06:00
Behdad Esfahbod f7f6d278bb Add hb_language_matches()
New API:
+ hb_language_matches()
2022-07-17 22:15:42 -06:00
Behdad Esfahbod d57ce30054 [ot-shape] Pass reference to props instead of pointer
Since cannot be nullptr.
2022-07-17 21:56:56 -06:00
Behdad Esfahbod a972d05d7e [aat] Fix build 2022-07-17 21:42:04 -06:00
Behdad Esfahbod 2124ad8906 [aat/morx] Implement language-specific forms
Test on Mac with, eg.

$ hb-view /Library/Fonts/BigCaslon.ttf -u 107
vs
$ hb-view /Library/Fonts/BigCaslon.ttf -u 107 --language pl

Fixes https://github.com/harfbuzz/harfbuzz/issues/1373
2022-07-17 21:32:27 -06:00
Behdad Esfahbod d8574b44cc [CoverageFormat2] Fix iterator to avoid infinite loop
on invalid data.

Fixes https://oss-fuzz.com/testcase-detail/5304497047470080
2022-07-17 18:44:27 -06:00
Behdad Esfahbod b475a2ab29 [array] Adjust operator != 2022-07-17 18:44:11 -06:00
Behdad Esfahbod 9518d602f3 [atomic] Disable compiler memory barrier on MSVC
It keeps giving me internal compiler error.

https://github.com/harfbuzz/harfbuzz/issues/3728
2022-07-17 17:03:40 -06:00
Behdad Esfahbod f0707e2348 [atomic] Add compiler memory_r_barrier
https://github.com/harfbuzz/harfbuzz/issues/3728
2022-07-17 16:47:16 -06:00
Behdad Esfahbod f3151b6582 [ArrayOf family] Use memory barrier before accessing array
Without it, the compiler was reordering and batching the read
of array length and array[0] if the 0'th member was accessed
constantly and function was inlined.  This felt safe to the
compiler because HB_VAR_ARRAY is 1, but could be unsafe actually.
The memory barrier disallows that.

This was found by afl/honggfuzz address sanitizers.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49187
2022-07-17 16:22:29 -06:00
Behdad Esfahbod 90e40f24fe [algs] Tweak attribute(packed) usage
Allow disabling it. Also don't cast this pointer.
2022-07-17 15:01:04 -06:00
Behdad Esfahbod af84680f23 [GSUB] Remove a reinterpret_cast 2022-07-17 12:00:04 -06:00
Behdad Esfahbod 9843f07658 [OffsetTo] Try catching nullable offsets to unbounded types
Doesn't catch all cases; if type is not fully defined at
OffsetTo time, we can't know.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
to the best we can do.
2022-07-15 16:04:40 -06:00
Behdad Esfahbod 1327d8e3df [layout-common] Reshuffle code so Feature is defined before it's used 2022-07-15 16:03:38 -06:00
Behdad Esfahbod f7147835eb [colr] Add MIN_SIZE to Paint 2022-07-15 16:03:25 -06:00
Behdad Esfahbod e1d2facd53 [null] Add hb_has_null_size() and hb_has_min_size() 2022-07-15 16:02:58 -06:00
Behdad Esfahbod 6ed57de15c [ft] Fix negative font sizes for bitmaps 2022-07-15 15:09:28 -06:00
Behdad Esfahbod 307ee9baff [ft] Fix bitmap-only vertical metrics 2022-07-15 14:48:29 -06:00
Behdad Esfahbod 87d338eb61 [ft] Fix test 2022-07-15 14:26:47 -06:00
Khaled Hosny e294200dac [ft] Check for FT_Get_Transform at build time 2022-07-15 21:59:33 +02:00
Behdad Esfahbod 901236f721 [ft] Implement loading (color) bitmap fonts
Fixes https://github.com/harfbuzz/harfbuzz/issues/489

Something about the vertical metrics is still off, not matching
hb-ot.  I cannot figure out what.
2022-07-15 13:35:14 -06:00
Behdad Esfahbod 3ac110560d [ft] Fix scale when font-sizes are negative 2022-07-15 12:48:11 -06:00
Behdad Esfahbod d68507d062 [arabic] Pause after calt only if no rclt
Fixes https://github.com/harfbuzz/harfbuzz/issues/1573
2022-07-15 12:27:46 -06:00
Behdad Esfahbod 8b379ddc76 [test-iter] Add back test of OT namespace iteration 2022-07-14 16:20:04 -06:00
Garret Rieger 5363e40de1 [reorg] update build files. 2022-07-13 20:25:13 -06:00
Garret Rieger d82ace5c6f [reorg] add TODO to RangeRecord. 2022-07-13 20:25:13 -06:00
Garret Rieger c1e280ea78 [reorg] Move Coverage, RangeRecord into new namespace layout. 2022-07-13 20:25:13 -06:00
Garret Rieger 9c2518988d [repack] Don't count space isolation against round limit.
Restore max rounds to 20 but don't count space isolation against the limit. The number of iterations space isolation can make changes for is already bounded to a reasonable max (the number of lookups in the font) so no need to cap the number of iterations.
2022-07-13 20:24:59 -06:00
Behdad Esfahbod a2f0723148 [GPOS] Adjust mark attachment on multiple substitution some more
Fixes https://github.com/harfbuzz/harfbuzz/issues/1545
2022-07-13 16:02:39 -06:00
Behdad Esfahbod ac216972ab [subset] Add table size blowup bound
Fixes https://github.com/harfbuzz/harfbuzz/issues/3091
2022-07-13 15:32:19 -06:00
Behdad Esfahbod 4b3afafb00 [array] Use hb_swap() in reverse() 2022-07-13 15:13:07 -06:00
Behdad Esfahbod 87167acfe3
Merge pull request #3704 from harfbuzz/64k
Towards breaking the 64k in GSUB/GPOS
2022-07-13 14:58:09 -06:00
Garret Rieger a369ab133b [repacker] Increase max_rounds when called via public api. 2022-07-13 14:01:42 -06:00
Behdad Esfahbod 4ee471922d More -Wcomma fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/3716
2022-07-13 13:59:35 -06:00
Behdad Esfahbod c2712ff4f5 Reorder hb_ot_shaper_t members to save 8 bytes of data per shaper 2022-07-13 13:34:11 -06:00
Behdad Esfahbod e5f0bc8f0a [set] Save a few kilobytes via type erasure of process() 2022-07-13 13:22:34 -06:00
Behdad Esfahbod 42da7da5ef Fix HB_NO_SHAPER HB_NO_OT_SHAPE build 2022-07-13 12:46:36 -06:00
Behdad Esfahbod 015aecfcdd [use-table] Port to using packtab
Saves around 9kb.
2022-07-13 12:24:46 -06:00
Behdad Esfahbod 0fcd1decb7 Fix file permissions 2022-07-13 12:17:35 -06:00
Behdad Esfahbod 7549d447ba [>64k:glyf] Implement composites for >64k
Implements https://github.com/be-fonts/boring-expansion-spec/issues/42
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 09de94788b [>64k:glyf] Hid composite glyphIndex 2022-07-12 13:42:52 -06:00
Behdad Esfahbod df7eebf40a [>64k:layout] Fix layout of RangeRecord
https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 99f017f41d [>64k:layout:GSUBGPOS] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/58

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9ef9fc0114 [>64k:layout] Templatize GSUBGPOSFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 5fd0a3f0b9 [>64k:layout] Templatize GSUBGPOSFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod f6c2aaeea4 [>64k:layout] Add List16OfOffsetTo 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 6d0e3e677b [>64k:layout] Split GSUBGPOSVersion1 into own struct 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 04c5cd4085 [subset/layout] Move find_duplicate_features to subset from layout 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 1bf8fa2f1f [>64k:layout:(Chain)Context] Implement format 4
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/34

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 0f13eb1f5c [>64k:layout] Templatize (Chain)ContextFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod d1f58e5979 [>64k:layout:(Chain)Context] Implement format 5
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/34

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod a90c5af9d2 [>64k:layout] Templatize (Chain)ContextFormat2 2022-07-12 13:42:52 -06:00
Behdad Esfahbod cc83b0b8fd [>64k:layout:MarkBasePos/MarkMarkPos/MarkLigPos] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/40

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 4b43070e2f [>64k:layout] Templatize MarkBasePos/MarkMarkPos/MarkLigPos 2022-07-12 13:42:52 -06:00
Behdad Esfahbod f0d6dda5a6 [>64k:layout:PairPos] Implement format 3
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/38

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 298ee47c55 [>64k:layout] Templatize PairPosFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod e9f8010fd0 [>64k:layout:PairPos] Templatize & implement format 4
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/38

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod ecd8bc5a9c [>64k:layout:LigatureSubst] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/33

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9d0e9faa43 [>64k:layout] Templatable bunch of GSUBGPOS internal functions 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 429b387a6f [>64k:layout] Support HBUINT24 in skippy_iter 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 1ef67a6d66 [gsubgpos] Remove HBUINT16 from matcher 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 704e696ad0 [>64k:layout] Templatize LigatureSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 27d24212db [>64k:layout:AlternateSubst] Implement format 2
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/32

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod c53d3ad51e [>64k:layout] Templatize AlternateSet 2022-07-12 13:42:52 -06:00
Behdad Esfahbod a58a48622a [>64k:layout:MultipleSubst] Implement format 2
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/32

Subset is NOT updated to lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 684c8fcea7 [>64k:layout] Templatize MultipleSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 8775e9b4a4 [>64k:layout:SingleSubst] Implement format 3/4
Implements https://github.com/be-fonts/boring-expansion-spec/issues/31
2022-07-12 13:42:52 -06:00
Behdad Esfahbod e3caf8d50a [>64k:layout] Templatize SingleSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod ca5c8a6419 [>64k:layout:Coverage] Implement format 3/4
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 25de6fb4e7 [>64k:layout:ClassDef] Implement format 3/4
This implements part of https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9286526f37 [>64k:layout] Templatize Coverage & ClassDef
Have not added new formats yet.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod e8cce9d1b3 [>64k:layout] Add SmallTypes & MediumTypes 2022-07-12 13:42:52 -06:00
Behdad Esfahbod d8f9d51780 [hashmap] Add keys_ref() and values_ref() 2022-07-12 13:19:31 -06:00
Behdad Esfahbod cddcb31065 [vector] Remove residual nullptr_t from when hashmap needed it 2022-07-12 13:15:38 -06:00
Behdad Esfahbod 46a36771f4 [draw] Fix leak from e0a5231657 2022-07-12 12:03:00 -06:00
Behdad Esfahbod f8544cbfc0 [draw] Fix regression from e0a5231657 2022-07-12 11:52:33 -06:00
Behdad Esfahbod d15041be7d [GSUB/GPOS] Trace toplevel sanitize 2022-07-12 11:11:22 -06:00
Behdad Esfahbod 7c4e9080c0 [sanitize] Minor trace format fixup
This likely() is unlikely to make a difference, and obscures
the return_trace() message by writing out "something" instead
of the true/false value.
2022-07-11 21:52:41 -06:00
Matthias Clasen d826a5920c docs: Clarify 0xFFFF as palette index
Mention that a palette index of 0xFFFF
means to use the foreground color.
2022-07-10 11:08:52 -06:00
Behdad Esfahbod 6d051f4018 [layout] Simplify StructAfter<> usage 2022-07-08 14:09:04 -06:00
Behdad Esfahbod 5192294f83 . 2022-07-08 14:09:04 -06:00
Garret Rieger 29f149c16c [subset] cache sanitized tables in subset plan to avoid sanitizing tables multiple times. 2022-07-08 13:42:38 -06:00
Behdad Esfahbod 8b349e1139 [gsubgpos] Remove HBUINT16 from match functions signatures 2022-07-08 12:05:01 -06:00
Behdad Esfahbod f114b18c58 [gsubgpos] Break skippy_iter set_match_func into two 2022-07-08 12:04:14 -06:00
Behdad Esfahbod 8a107125a5 [layout] Make SubstLookup:serialize_single take iterators 2022-07-08 12:02:11 -06:00
Behdad Esfahbod 8a971d01e9 [layout] Use is_source_of instead of is_iterator 2022-07-08 12:01:48 -06:00
Behdad Esfahbod 0dc0da054d [iter] Add hb_is_sorted_iterator(_of) 2022-07-08 12:01:38 -06:00
Behdad Esfahbod 2c67261723 [open-type] Add HBGlyph24 2022-07-08 12:01:26 -06:00
Behdad Esfahbod 7cfe7fe651 [null] Change null bytes for RangeRecord
Should be harmless.
2022-07-08 12:01:18 -06:00
Behdad Esfahbod 486555c691 [open-type] Add Array24Of<> and SortedArray24Of<> 2022-07-08 12:01:07 -06:00
Behdad Esfahbod 1e503f587b [null] Add DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1 2022-07-08 12:00:53 -06:00
Behdad Esfahbod ea11029a6e [GPOS] Split LigatureArray.hh 2022-07-08 11:58:43 -06:00
Behdad Esfahbod 68b2742fe4 [GPOS] Move code around 2022-07-07 16:11:15 -06:00
Behdad Esfahbod 6a3043a0c1 Fix tests 2022-07-07 14:51:37 -06:00
Behdad Esfahbod aa68657434 [Makefile.sources/meson.build] Sort file names 2022-07-07 14:07:45 -06:00
Behdad Esfahbod 0b0e3b30ce [GPOS] Break down PairPosFormat1 into new layout 2022-07-07 14:06:44 -06:00
Garret Rieger 6fad6b4113 [repacker] add tests for special casing of 24bit offsets. 2022-07-06 19:18:27 +00:00
Garret Rieger b4f561dbbf [subset] Add some comments to find_space_roots/find_32_bit_roots methods. 2022-07-06 18:49:23 +00:00
Garret Rieger 401066bf3d [subset] Prepare the repacker for handling 24bit offsets in GSUB/GPOS.
The boring expansion (https://github.com/be-fonts/boring-expansion-spec) plans to introduce 24bit offsets into GSUB/GPOS. This changes the repacker to treat 24 bit offsets similar to 32 bit offsets and assign the top level 24 bit offsets into spaces to improve packing.
2022-07-06 18:44:40 +00:00
Behdad Esfahbod c091d029c2
Merge pull request #3706 from lb90/dwrite-dll
Load DirectWrite dynamically
2022-07-06 10:51:04 -06:00
Luca Bacci 1abc14b463 Do not link with the DWrite lib
It's loaded dynamically now
2022-07-06 17:55:39 +02:00
Luca Bacci c22acfa8bd Fix function pointer typedef 2022-07-06 17:55:24 +02:00
Kleis Auke Wolthuizen 79eb0f7486 [GSUB] Fix build on GCC < 7 2022-07-06 14:00:16 +02:00
Kleis Auke Wolthuizen 3238cb744b [GPOS] Fix build on GCC < 7 2022-07-06 14:00:16 +02:00
Luca Bacci 3e881efbe4 Revert "Revert "Revert "[hb-directwrite] Don't load dwrit.dll dynamically"""
This reverts commit 361a438658.
2022-07-06 13:51:56 +02:00
Kleis Auke Wolthuizen 7b51bc95d9 [cplusplus] Fix build on GCC < 7 2022-07-06 13:12:00 +02:00
Behdad Esfahbod 386e1bbad8
Merge pull request #3699 from googlefonts/filter_scripts
[subset] Add support for --layout-scripts
2022-07-05 12:46:05 -06:00
Garret Rieger 30309ec8d3 [subset] add null element in _filter_tag_list. 2022-07-05 18:33:19 +00:00
Garret Rieger 216cf5946b [subset] Allocate space for null entry in script/feature list. 2022-07-05 17:49:12 +00:00