src/hb-ot-layout-common.hh


Log

Author Commit Date CI Message
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
Garret Rieger 55e7f3fe 2021-04-01T13:35:30 [subset] Match FeatureVariationRecord dropping from fontTools. Only drop records with no matching features that are at the end of the list. See: https://github.com/fonttools/fonttools/commit/cab7d13dc0883765cde435215c7d65e9212f152d
Garret Rieger f0c78e02 2021-03-25T12:57:12 [subset] don't drop features referenced in a feature variation substitution.
Garret Rieger dae99b77 2021-03-25T12:33:51 [subset] don't keep FeatureVariationRecord's with no subsittutions.
Behdad Esfahbod 4dba749d 2021-03-31T16:09:39 Add SortedArray{16,32}Of<>
Behdad Esfahbod 5639e253 2021-03-31T16:04:43 Add Array16Of<>
Behdad Esfahbod 2520a82d 2021-03-31T15:34:26 s/LArrayOf/Array32Of/g
Behdad Esfahbod 5efe3609 2021-03-31T15:33:22 Rename (Unsized)OffsetListOf
Behdad Esfahbod 6c4e0491 2021-03-31T15:31:32 s/OffsetArrayOf/Array16OfOffset16To/g
Behdad Esfahbod 2a54c9f7 2021-03-31T15:26:42 .
Behdad Esfahbod ad28f973 2021-03-31T12:49:14 Rename offset types to be explicit about their size Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
Behdad Esfahbod bd2950b3 2021-03-31T11:36:36 Make VariationStore::get_delta(outer, inner) private
Behdad Esfahbod 934675a4 2021-03-31T11:34:41 Use VarIdx in VariationDevice
Behdad Esfahbod 9ed5f04a 2021-03-29T18:14:30 [subset] Simplify recent out-of-memory fixes By checking return status of map->set().
Garret Rieger 8741914a 2021-03-29T16:39:44 [subset] fix memory leak when map insert fails.
Qunxin Liu 56ca4357 2021-01-28T15:21:26 [subset] fix for collect_features and remove_redundant_lamngsys previously remove_redundant_sys () is missing in harfbuzz, after redundant langsys removal, some features are removed as well in prune_features() in fonttools. This change is trying to get the same result between harfbuzz and fonttools.
Qunxin Liu 0e1c0fa4 2021-01-12T10:17:14 [subset] optimize glyph closure method: step 5 add testcase and some fixes
Qunxin Liu 62423504 2021-01-05T14:54:40 [subset] optimize glyph closure method: step 3 Add function intersects_coverage_glyphs that collects set of matching glyphs in Coverage table
Qunxin Liu ef78d0f9 2021-01-05T10:16:50 [subset] optimize glyph closure method: step 2 Add function intersects_class_glyphs that collects set of glyphs matching class in ClassDef table
Garret Rieger 2df39bca 2021-03-16T14:20:49 [subset] don't allocate a set to use as a glyph filter for PairPosFormat2.
Garret Rieger 190b7a98 2020-10-08T14:44:54 [subset] Update PairPosFormat2 subsetting to match fontTools updated subsetting (https://github.com/fonttools/fonttools/pull/2221) - subset class def 1 against the coverage table. - Don't re-use class 0 in class def 2. - Ignore class 0 glyphs for the purposes of determing format 1 vs format 2 encoding for ClassDef. Add an additional test case which demonstrates these issues.
Behdad Esfahbod 3622120f 2021-03-10T12:21:43 [subset] Make ClassDef format2 .intersects() return false if range value 0 We treat Class0 as "doesn't intersect". That's the only meaningful interpretation. If one allos Class0 to mean "intersects", then the intersects() result should be true iff glyphset is non-empty. Related to https://github.com/harfbuzz/harfbuzz/issues/2703
Behdad Esfahbod 6c4bb608 2021-02-22T22:45:32 Fix narrowing errors with recent changes
Behdad Esfahbod f4f35a4d 2021-02-22T22:28:32 [constexpr] Use initializer instead of assignment
Behdad Esfahbod 6a3fd94f 2021-02-09T20:49:04 Merge pull request #2699 from googlefonts/gpos_8 [subset] Add a more complex layout subsetting test case and fix the issues it exposed.
Behdad Esfahbod ca0b7afe 2021-01-21T12:18:48 [set] Use hb_fill()
Behdad Esfahbod 6463ee02 2021-01-21T12:01:13 Speed up ClassDef/Coverage intersect methods Just avoiding overhead as measured by Garret. Should rewrite as dagger in the future and confirm that it has the same benefits. Later on, rewrite as lfind() maybe. Fixes https://github.com/harfbuzz/harfbuzz/issues/2826
Garret Rieger e5835053 2020-09-29T11:05:08 [subset] Use plan->glyphset_gsub instead of plan->glyphset for GSUB/GPOS This matches fontTools behaviour. glyphset_gsub does not contain gids added from closing over composite glyphs in glyf, since these cannot particpate in GSUB/GPOS processing.
Garret Rieger 9825e3dd 2020-08-26T17:31:50 [ENOMEM] fix access to unitialized memory. If the serialize() call fails to write the object then we can't safely read varstore_prime fields. Fixes https://oss-fuzz.com/testcase-detail/5137462782066688.
Ebrahim Byagowi 5a7cc7fd 2020-07-29T08:33:32 minor spacing tweak
Ebrahim Byagowi d0e2addd 2020-07-18T22:14:52 minor
Ebrahim Byagowi a6fb8ce9 2020-07-04T23:43:21 Minor, fix -Wrange-loop-analysis warnings Fixing these complains raised by newer versions of clang, ./hb-ot-layout-common.hh:1720:53: error: loop variable 'gid_klass_pair' is always a copy because the range of type 'hb_map_iter_t<hb_sorted_array_t<OT::HBGlyphID>, (lambda at ./hb-ot-layout-common.hh:1672:29), hb_function_sortedness_t::RETAINS_SORTING, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis] for (const hb_pair_t<hb_codepoint_t, unsigned>& gid_klass_pair : + it) And ./hb-ot-color-colr-table.hh:177:44: error: loop variable '_' is always a copy because the range of type 'hb_map_iter_t<hb_filter_iter_t<hb_map_iter_t<hb_range_iter_t<unsigned int, unsigned int>, (lambda at ./hb-ot-color-colr-table.hh:209:31), hb_function_sortedness_t::RETAINS_SORTING, nullptr>, (anonymous struct at ./hb-algs.hh:331:1) &, (anonymous struct at ./hb-algs.hh:51:1) &, nullptr>, (anonymous struct at ./hb-algs.hh:338:1) &, hb_function_sortedness_t::RETAINS_SORTING, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis] for (const hb_item_type<BaseIterator>& _ : + base_it.iter ())
Ebrahim Byagowi d38eb49f 2020-06-19T23:40:42 Move the iteration logic to FeatureParamsCharacterVariants Hopefully I can make members protected also.
Ebrahim Byagowi 407bba3e 2020-06-19T23:12:42 minor move FeatureParamsCharacterVariants::sanitize method right above members
Behdad Esfahbod 1535440b 2020-06-19T08:30:59 [dispatch] Fix debug builds
Behdad Esfahbod 6fbb59ab 2020-06-18T15:12:37 Use daggers in a few get_array functions As I review https://github.com/harfbuzz/harfbuzz/pull/2471
Behdad Esfahbod 70d6696c 2020-06-18T17:09:39 [dispatch] Don't require debug_depth for untraced objects
Behdad Esfahbod 25aec026 2020-06-18T16:58:01 [dispatch] Default return type to hb_empty_t
Behdad Esfahbod 8d0a90ac 2020-06-18T16:53:54 [dispatch] Default debug level to 0
Behdad Esfahbod e47a2ab8 2020-06-18T16:48:07 Remove unused dispatcher names
Qunxin Liu d7c012a0 2020-02-26T13:11:42 [subset] GDEF Variation Store: step 2 do subset based on variation indices collected in step 1
Qunxin Liu 8200e48f 2020-02-26T13:11:42 [subset] GDEF Variation Store: step 1 closure device variation indexes, create old->new variation idx mapping and store them in subset-plan
Behdad Esfahbod 89ad3c6c 2020-04-23T10:57:30 Rename add_class to collect_class
Behdad Esfahbod 5cf53c06 2020-04-23T10:55:41 Rename add_coverage to collect_coverage
Behdad Esfahbod 262eced2 2020-04-20T12:17:28 [subset] FeatureVariations subsetting is wrong Never drop FeatureVariationRecord for now. Fixes https://github.com/harfbuzz/harfbuzz/issues/2334
Ebrahim Byagowi 2dda6dd7 2020-04-20T14:12:45 minor, tweak spacing turn 8 spaces to tab, add space before Null/Crap
Qunxin Liu 0d569598 2020-04-05T18:44:26 [subset] fixes dangling object_t issue in FeatureVariationRecord Fixes https://crbug.com/oss-fuzz/21560 revert () does not clean up useless object_t. Adjust the order of subsetting substitutions and conditions to avoid dangling object_t.
Ebrahim Byagowi 57b7de03 2020-04-05T17:07:48 [subset] Fail ClassDefFormat1 serialization if no space available Fixes https://crbug.com/oss-fuzz/21580
Qunxin Liu c8cc1e37 2020-04-02T16:57:01 fix issues in ClassDefFormat1 serialize: glyph ids in Iterator may be non-consecutive, so the number in classValue might be larger than length of the Iterator
Qunxin Liu e0c3979a 2020-04-01T16:49:53 typo fix
Garret Rieger 5d345d0c 2020-03-31T17:46:19 [subset] Limit the number of lookup indices processed subsetting Feature. > Also, remove two unnessecary full iterations of the lookup index iterator during serialization of the index array. Fixes fuzzer found timeout.
Garret Rieger 834a224a 2020-03-12T03:02:36 [subset] Put a limit on the number of lookup indices that can be visited during closures Fixes https://crbug.com/oss-fuzz/21025
Ebrahim Byagowi 07acd1a0 2020-03-08T23:39:24 [subset] Rename src_base args to base to match sanitize methods So it will become easier to follow that serialize methods signatures should match with their sanitize methods counterparts.
ariza 188a0a47 2020-03-07T11:02:36 removed default base; replaced w/ bias if required
Ebrahim Byagowi d3836039 2020-03-02T22:41:08 Limit OT::Lookup subtables (#2219) Fixes https://crbug.com/oss-fuzz/13943
Garret Rieger 414529e4 2020-02-28T15:15:55 [subset] Limit the number of feature indices processed during script subsetting.
Garret Rieger c66ee213 2020-02-27T12:25:01 Limit the number of feature indices processed during feature collection.
Qunxin Liu fcd7f33b 2020-02-10T10:36:50 [subset] GDEF glyphClassDef subsetting support glyphClassDef uses the same ClassDef format. However, glyphClassDef table uses predefined class values so we do not remap class values.
Ebrahim Byagowi 5f23a76e 2020-02-24T08:23:23 [cff] Don't remove coords const qualification We should find some way to audit all the const removals, perhaps by enabling -Wold-style-cast warning on the project and turning all the implicit const removals to const_cast.
Ebrahim Byagowi 4dc3db73 2020-02-06T12:12:41 Minor, fix warnings raised when built with -std=c++2a Follow up to c184180, It was raising, src/hb-ot-layout-common.hh:1067:63: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture] | hb_filter ([=] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); }) ^ src/hb-ot-layout-common.hh:1067:19: note: add an explicit capture of 'this' to capture '*this' by reference | hb_filter ([=] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); }) ^ , this and src/hb-ot-layout-common.hh:2626:38: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture] { r.collect_lookups (this, lookup_indexes); }) ^ src/hb-ot-layout-common.hh:2625:18: note: add an explicit capture of 'this' to capture '*this' by reference | hb_apply ([=] (const FeatureTableSubstitutionRecord& r) ^ , this and src/hb-ot-hdmx-table.hh:141:44: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-Wdeprecated-this-capture] return device_record->widthsZ.as_array (get_num_glyphs ()) [_]; ^ src/hb-ot-hdmx-table.hh:137:17: note: add an explicit capture of 'this' to capture '*this' by reference | hb_map ([=] (hb_codepoint_t _) ^ , this
ariza 72cbfb90 2020-01-18T16:35:52 remove empty lookup subtables Added a variant of subset_offset_array which takes an extra arg passed to serialize_subset for this impl. Added a new api test "test-subset-gpos" for this.
Qunxin Liu e565d1f9 2019-11-01T10:21:36 [subset] subset lookup/feature/script lists for GSUB/GPOS
Qunxin Liu 8ffc9add 2019-10-31T15:59:02 [subset] layout closure_features and store them in subset-plan
Ebrahim Byagowi dc03a993 2020-01-12T14:21:29 Fix collect lookups logic of FeatureTableSubstitution (#2097) https://crbug.com/oss-fuzz/20036
Ebrahim Byagowi a32ecc15 2020-01-11T15:37:24 Fix collect lookups logic of FeatureVariationRecord As "Offset to a feature table substitution table, from beginning of the FeatureVariations table." from https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2 the record should match its sanitize logic not the reverse way. Fixes https://crbug.com/oss-fuzz/20021 and https://crbug.com/oss-fuzz/20022
Qunxin Liu 0b39c480 2019-10-22T16:00:43 [subset] closure lookups for GSUB/GPOS
Ebrahim Byagowi 257a197a 2020-01-09T22:55:45 Fail serialize when map has incorrect value fixes https://crbug.com/oss-fuzz/19956 am not super happy with the fix, guess we should do some check before the memcpy anyway as @blueshade7 thinks also, so let's have it or revert it when we have a better approach for the case.
Ebrahim Byagowi ce114d6b 2019-12-31T15:53:02 minor, tweak spaces
Behdad Esfahbod 858b6279 2019-12-10T13:18:32 [machinery] Remove CastR<>()
Behdad Esfahbod 9fb03058 2019-12-07T19:45:08 Rename start/end to first/last in RangeRecord Because that's what they are.
Qunxin Liu b33a0d62 2019-10-21T13:24:52 fuzzer crash fix: Null-dereference WRITE https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18363
Qunxin Liu b66094ad 2019-09-30T16:19:18 [subset] GSUB Lookup Type 6: ChainContextSubst
Garret Rieger eff91bbb 2019-10-16T16:58:57 Add missing pop() for the failure case of script subsetting.
Garret Rieger 831daf4c 2019-10-01T17:46:27 Enforce HB_MAX_LANGSYS limit during layout subsetting.
Garret Rieger 9871461b 2019-10-01T16:29:24 Enforce HB_MAX_SCRIPTS during subsetting of the script table.
Garret Rieger 36f18cec 2019-10-07T14:02:31 Add subset_offset_array helper function which simplifies subsetting offset arrays during stream operations.
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
Behdad Esfahbod faace943 2019-09-30T13:34:05 Merge pull request #1807 from harfbuzz/subset-varstore VariationStore serializer
Qunxin Liu b0c3eb06 2019-09-18T16:11:44 [subset] GPOS Lookup Type 3: CursivePos
Ebrahim Byagowi d512087e 2019-09-14T10:36:29 Rename GlyphID to HBGlyphID Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
Behdad Esfahbod 0e294c45 2019-09-06T16:54:27 Rename VAR to HB_VAR_ARRAY
Behdad Esfahbod c379faed 2019-09-06T16:41:12 Fix a few struct size declarations Was wrong. As excercised by defining VAR to other than 1 in hb.hh.
qxliu76 0313ef86 2019-08-29T14:09:05 bug fix in optimizing coverage table format (#1942) We are comparing number of shorts, NOT number of bytes.
Ebrahim Byagowi 9ff32b79 2019-08-29T19:53:18 Merge remote-tracking branch 'upstream/master' into glyf-rebase