src/hb-ot-layout-common.hh


Log

Author Commit Date CI Message
Behdad Esfahbod 59c45f6d 2022-11-22T12:54:50 Use hb_memcpy instead of memcpy consistently
Behdad Esfahbod a0bde1e1 2022-11-16T21:27:12 [open-type] Remove (Sorted)ArrayOf.sub_array()
Garret Rieger 83769b9c 2022-10-21T22:37:32 [subset] add comment for why we retain empty lookups.
Garret Rieger 70e2de2b 2022-10-21T22:33:17 [subset] Always output Lookup's even if they are empty. The rest of layout subsetting depends on lookup indices being consistent with those computed during planning. So if an empty lookup is discarded during the subset phase it will invalidate all subsequent lookup indices. Generally we shouldn't end up with an empty lookup as we pre-prune them during the planning phase, but it can happen in rare cases such as when a subtable is considered degenerate (eg. #3853)
Joel Auterson c813f842 2022-10-20T19:45:23 Make build work for arm-none-eabi
Qunxin Liu b706c6f7 2022-09-12T13:58:55 [instance] update FeatureList with variations
Qunxin Liu 8f3a7017 2022-09-09T15:00:37 [instance] support FeatureVariations table
Qunxin Liu f4813e3b 2022-09-09T10:34:09 [instance] update collect_lookups/prune_features()/closure_features() with variations Some features will be substituted with variations, so we do not collect lookups from the original feature tables.
Qunxin Liu 64e2f2fc 2022-09-09T09:36:19 [instance] store active featurevariation record/condition idxes in the plan
Qunxin Liu 9ab6605f 2022-08-02T09:54:29 [instance] update GDEF table
Qunxin Liu b72995ff 2022-08-01T14:48:01 [instance] GDEF table: collect both varidxes and deltas
Qunxin Liu e03043bd 2022-08-01T11:37:47 [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
Qunxin Liu 7fde6ab0 2022-08-05T13:33:22 fuzzer fix: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49790
Behdad Esfahbod c67c1b74 2022-08-04T11:42:22 VarStore: simplify again
Qunxin Liu d831e935 2022-08-04T10:15:21 bug fix in VarData get_delta () when LONG_WORDS flag is set, item row is not computed correctly lcursor should be interpreted as INT32
Behdad Esfahbod 3da50c50 2022-07-29T11:40:33 Remove unused const
Garret Rieger 3f7a74ff 2022-07-19T21:50:13 [repacker] WIP extension promotion implementation.
Behdad Esfahbod 4cb83967 2022-07-23T10:59:42 [subset/ClassDefFormat2] Fix timeout Fixes https://oss-fuzz.com/testcase-detail/5417800474165248
Behdad Esfahbod f94a3ba1 2022-07-23T10:36:08 [varStore] Better protect against HB_NO_VAR builds
Behdad Esfahbod 5a9c7930 2022-07-22T21:33:15 Add HB_NO_BEYOND_64K
Behdad Esfahbod 7cdde6a2 2022-07-21T17:17:59 [ClassDef] Write a loop as range for
Behdad Esfahbod 00dfbbce 2022-07-21T11:39:32 [Coverage] Rename and templatize intersected_coverage_glyphs
Behdad Esfahbod 8d923363 2022-07-20T12:08:18 [layout] Reduce number of closure rounds
Behdad Esfahbod f3151b65 2022-07-17T16:19:28 [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
Behdad Esfahbod 1327d8e3 2022-07-15T16:03:38 [layout-common] Reshuffle code so Feature is defined before it's used
Garret Rieger c1e280ea 2022-07-13T22:43:38 [reorg] Move Coverage, RangeRecord into new namespace layout.
Behdad Esfahbod df7eebf4 2022-07-11T14:14:55 [>64k:layout] Fix layout of RangeRecord https://github.com/be-fonts/boring-expansion-spec/issues/30
Behdad Esfahbod 9ef9fc01 2022-07-11T13:29:23 [>64k:layout] Templatize GSUBGPOSFormat1
Behdad Esfahbod 5fd0a3f0 2022-07-11T13:10:04 [>64k:layout] Templatize GSUBGPOSFormat1
Behdad Esfahbod ca5c8a64 2022-07-06T13:02:49 [>64k:layout:Coverage] Implement format 3/4 Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/30
Behdad Esfahbod 25de6fb4 2022-07-06T12:52:03 [>64k:layout:ClassDef] Implement format 3/4 This implements part of https://github.com/be-fonts/boring-expansion-spec/issues/30
Behdad Esfahbod 9286526f 2022-07-06T12:26:58 [>64k:layout] Templatize Coverage & ClassDef Have not added new formats yet.
Behdad Esfahbod e8cce9d1 2022-07-05T14:05:43 [>64k:layout] Add SmallTypes & MediumTypes
Behdad Esfahbod 8a971d01 2022-07-06T12:37:43 [layout] Use is_source_of instead of is_iterator
Behdad Esfahbod 0dc0da05 2022-07-06T12:33:37 [iter] Add hb_is_sorted_iterator(_of)
Garret Rieger 587969af 2022-06-30T21:37:42 [subset] Drop scripts that are not in the layout_scripts list.
Behdad Esfahbod b96622d1 2022-06-05T02:45:41 [layout] Use a cache for main input ClassDef of (Chain)ContextLookupFormat2 This commit adds a per-lookup caching infrastructure to GSUB/GPOS, and uses it to cache input ClassDef.get_class value for (Chain)ContextLookupFormat2. For fonts heavy on use of heave class-based2 context matching, this shows a good speedup. For NotoNastaliqUrdu for example, I observe 17% speedup. Unfortunately not many other lookups can use a cache like this :(. https://github.com/harfbuzz/harfbuzz/pull/3636
Behdad Esfahbod e6409d39 2022-06-05T06:57:37 Revert "[layout] Use a cache for main input ClassDef of (Chain)ContextLookups" This reverts commit 57d1c08739d0acd94b96da2f9d5dd6c0ff3b3722. Err. This was an accident.
Behdad Esfahbod 57d1c087 2022-06-05T02:45:41 [layout] Use a cache for main input ClassDef of (Chain)ContextLookups
Behdad Esfahbod f13a7954 2022-06-03T01:17:20 [subset] Convert another use of hashmap to unique_ptr
Behdad Esfahbod 997d9cc4 2022-06-02T18:04:12 [map] Make unique_ptr hashable
Behdad Esfahbod 5af5a565 2022-05-30T08:32:50 [VarStore] Implement writing 32bit var-store Untested. Finishes fixing https://github.com/harfbuzz/harfbuzz/issues/2965
Behdad Esfahbod 75112098 2022-05-23T12:42:15 [VarStore] Implement reading 32bit var-store Untested. Part of https://github.com/harfbuzz/harfbuzz/issues/2965 Serializing is incomplete.
Behdad Esfahbod e5d6da79 2022-05-23T12:25:39 [varStore] rename shortCount to wordCount
Behdad Esfahbod 371e14d9 2022-05-28T13:40:30 Combine uses of map has() then get() with has(.., &..)
Behdad Esfahbod 6010feee 2022-05-24T09:00:44 [varStore] Rename variable as per review https://github.com/harfbuzz/harfbuzz/pull/3605
Behdad Esfahbod d9acc045 2022-05-21T14:16:21 [VarStore] Sprinkle cache_t type around It's available so no need to use void*.
Behdad Esfahbod da38312e 2022-05-20T17:32:56 [VarStore] Pepper cache with likely()
Behdad Esfahbod cf8f00e3 2022-05-20T17:14:10 [VarStore] Don't use NAN Is faster. With this, I'm seeing 25 to 28% speedup in glyph_h_advances benchmark of benchmark-font for var/hb tests.
Behdad Esfahbod 880f50f7 2022-05-20T16:50:00 Refactor varstore cache
Behdad Esfahbod f2a2fb91 2022-05-20T16:06:05 [GPOS] Cache VarStore region scalars
Behdad Esfahbod 5fbc70c5 2022-05-20T14:07:27 [VarStore] Add cache API
Garret Rieger 3ab2c793 2022-05-19T17:23:36 [subset-perf] Signficiantly speed up ClassDef*::subset. Eliminates the usage of a glyph -> klass hash map and replaces it with a vector storing the mapping. This allows us to use the vector directly as the iterator driving the serialize. Approximately 1% speedup for Noto Nastaliq.
Garret Rieger 0b1c2ff9 2022-05-18T23:32:03 [subset-perf] Remove extra map lookup in ClassDef subset methods.
Garret Rieger 13ace77f 2022-05-18T22:38:43 [subset-perf] Use glyph_map instead of set in ClassDefFormat.
Garret Rieger adae2f22 2022-05-18T21:42:28 [subset-perf] Cache a glyph map for gsub. This allows us in some cases to avoid using glyph_set_gsub as a filter.
Behdad Esfahbod cedf7396 2022-05-18T16:52:35 Add some commented-out code
Garret Rieger 48dfbd54 2022-05-18T21:03:56 [subset] minor cleanup.
Garret Rieger 482c6e5d 2022-05-18T19:58:55 [subset-perf] Speed up Coverage::serialize by caching iterator.
Behdad Esfahbod 14b18725 2022-05-18T15:14:32 In Coverage::iter_t, assume iterators are from same Coverage object No need to support otherwise.
Behdad Esfahbod 27141735 2022-05-18T15:12:49 [subset] Add Coverage::__end__ implementation
Behdad Esfahbod c476f58a 2022-05-18T14:20:23 [subset] Write CoverageFormat2::intersects_coverage() as bsearch()
Behdad Esfahbod 63c66951 2022-05-18T13:53:52 [ot-layout] Cosmetic The implementation of HBUINT16 operator == is slower than just comparing to ints.
Behdad Esfahbod 777debd7 2022-05-18T13:46:06 [subset] Rewrite CoverageFormat2::intersects as dagger
Behdad Esfahbod cf5001fa 2022-05-18T13:38:29 [subset] Optimize CoverageFormat2::intersected_coverage_glyphs
Behdad Esfahbod 6f37c207 2022-05-18T13:25:42 [subset] Minor rewrite in CoverageFormat2::serialize()
Behdad Esfahbod 175319cd 2022-05-11T13:47:17 [gsubgpos] Clean up OT::ClassDefFormat2::intersected_class_glyphs 0 case
Behdad Esfahbod 137af361 2022-05-11T13:39:30 [gsubgpos] Simplify OT::ClassDefFormat2::intersected_class_glyphs()
Behdad Esfahbod 3261e05b 2022-05-11T13:16:31 [subset] Optimize ClassDef1::intersected_class_glyphs() for class0
Behdad Esfahbod a792e16e 2022-03-24T13:08:51 [ot-layout] Change max nesting level of lookups from 6 to 64
Qunxin Liu 7cb002cb 2022-03-14T11:40:35 [subset] bug fix in prune_langsys we should not cache visited langsys cause 2 different Record<Langsys> could have different Tag while pointing to the same Langsys, a langsys is redundant in Record<Langsys> A does not mean it's redundant in Record B. Same thing for visited_script. Also adding the number of features in the LangSys's feature list to the visited langsys count so it's more accurate. Plus some improvement in langsys compare()
Behdad Esfahbod de2cef42 2022-01-18T09:21:31 [bimap] Remove init/fini
luz paz e2e30506 2022-01-16T07:00:53 Fix various typos Found via `codespell -q 3 -S ./perf/texts -L actualy,ba,beng,fo,gir,inout,nd,ot,pres,ro,te,teh,timne`
Garret Rieger 067f90a8 2021-12-14T16:24:38 [subset] Fix for fuzzer timeout. Fixes https://oss-fuzz.com/testcase-detail/5549945449480192 In prune_langsys: move LangSys visited check up before any work is done for a LangSys. In this particular case the compare() method is responsible for the majority of the time spent and wasn't being guarded with a visisted check.
Qunxin Liu 706014f6 2021-12-01T20:20:12 [subset] (Chain)ContextSubst glyph_closure fix - When pos_glyphs is empty, use current full glyphs set as input for subsequent recursive closure process - Also increase max_lookup_visit_count to 35000 cause a real font file hit previous limit 20000 and some lookups are dropped unexpectedly
Behdad Esfahbod 394f7729 2021-11-19T11:49:23 [map] Allow storing classes in the hashmap Fixes https://github.com/harfbuzz/harfbuzz/issues/3293 The trick was to change the type of the invalid key/value to be non-class.
Garret Rieger a75b96f7 2021-11-16T14:34:07 [sanitize] In lookup sanitize don't try to access subtable 0 if it isn't there.
Qunxin Liu 540f19b6 2021-10-29T17:11:53 [subset] fix bug in (Chain)ContextFormat2 Only keep rulesets for glyphs class numbers that survived in coverage
Behdad Esfahbod 6d555ce8 2021-11-02T00:18:22 [meta] Use std::forward instead of hb_forward()
Qunxin Liu ca7b9dae 2021-09-20T14:42:51 [subset] subset MATH table
Garret Rieger c2cc566c 2021-09-22T14:15:55 [subset] Fix subset_offset_array adding unused space to serializer. ArrayOf.serialize_append allocates space for the new item, but ArrayOf.pop() does not recover the allocated space. So in the case where the revert path was entered the extra space added by serialize_append gets left in the serialization buffer. This moves the snapshot to before ArrayOf.serialize_append is called so that revert cleans up the buffer extend.
Behdad Esfahbod 14a2df7b 2021-09-19T23:06:09 Add stub HBUINT15
Behdad Esfahbod c852b868 2021-09-19T16:30:12 Rename HBGlyphID to HBGlyphID16
Garret Rieger b63ac571 2021-07-29T18:23:41 [subset] bail if collection region indices is in error.
Behdad Esfahbod 30579f5a 2021-07-29T11:19:13 [set] Document & use open-ended del_range()
Behdad Esfahbod 2d54c346 2021-07-28T18:20:53 [subset/VarStore] Fix OOM in fuzzer test The test in question is the one added in c68a00b92eb62fdc79f9a2bd1fc7a6acc24a3602. 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.
Behdad Esfahbod ff1fe25a 2021-07-28T18:02:52 [VarStore] Rename internal get_scalars() to get_region_scalars()
Behdad Esfahbod f0a1892f 2021-07-28T17:36:22 [serialize] Remove unnecessary pointer indirection
Behdad Esfahbod 1c511ed6 2021-07-28T17:33:26 [subset] Simplify VarStore serialization
Behdad Esfahbod ad4c6924 2021-07-28T16:50:34 [subset] Simplify VarStore serialize
Behdad Esfahbod 25dee609 2021-07-28T13:58:24 [sanitize] Revert some from c68a00b92eb62fdc79f9a2bd1fc7a6acc24a3602 That overflow check was already happening in arrayZ.sanitize().
Behdad Esfahbod c68a00b9 2021-07-27T13:25:22 [subset] Fix possible overflows in VarRegionList serialize Fixes https://oss-fuzz.com/testcase-detail/5362189182566400
Behdad Esfahbod 03cd9c5c 2021-07-22T11:27:33 Align lfind() API to match bfind()
Garret Rieger 6269866b 2021-07-16T14:06:55 [subset] Keep bimap consistent if only one of the internal maps is in error.
Garret Rieger 48edbef9 2021-06-29T13:14:26 [subset] bail if region_map is in error. Fixes fuzzer case https://oss-fuzz.com/testcase-detail/5499162606043136.
Garret Rieger 0da9158f 2021-06-29T14:23:37 [subset] Remove OffsetTo::serialize(). Convert remaining uses of it to serialize_serialize() which correctly uses the object packer.
Garret Rieger be50779c 2021-04-30T12:59:17 [subset] correct ClassDef format determination. It was possible for glyph_min to be a glyph mapped to class zero which threw off the number of glyph calculation.
Qunxin Liu 84dbfacf 2021-04-15T16:52:11 [subset] fix collect_variation_idx in PairPosFormat2
Garret Rieger 596f4258 2021-04-02T12:41:09 [subset] copy Lookup::markFilteringSet when subseting.
Behdad Esfahbod 092094f7 2021-04-01T15:47:21 Use as_array() and range loops in a few places