Commit Graph

317 Commits

Author SHA1 Message Date
Behdad Esfahbod 8eb8494e8d WIP 2021-02-12 14:13:11 -07:00
Garret Rieger e583505334 [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.
2020-09-29 11:16:15 -07:00
Ebrahim Byagowi 5a7cc7fd8b minor spacing tweak 2020-07-29 08:33:38 +04:30
Ebrahim Byagowi d0e2addd43 minor 2020-07-18 22:16:02 +04:30
Behdad Esfahbod b2a1acccd9 Simplify get_glyph_alternates() dispatcher
Trying to make it **very simple** to add a specialized dispatcher for
one API to be routed to just a few objects (one in this case).
2020-06-18 16:41:31 -07:00
Behdad Esfahbod ffe8d3f39d Use dispatch for get_glyph_alternates_t
First time we do this in a way that if target object doesn't have the matching
function we basically "ignore".  Risky but I feel like is the right decision
for this case.

I'm going to put back the template varargs and use those, which would make
the dispatcher be just that: "dispatcher", and wouldn't need to carry the
call context.  That would be a refreshing change I think.
2020-06-18 16:31:39 -07:00
Behdad Esfahbod bedf417121 Push get_glyph_alternates() work all the way down 2020-06-18 15:49:01 -07:00
Ebrahim Byagowi 1bac85828c [layout] Rename _get_alternates to _get_glyph_alternates 2020-06-18 22:56:07 +04:30
Ebrahim Byagowi d3c169792b [layout] move alternate buffer iteration logic to AlternateSet 2020-06-18 09:23:13 +04:30
Ebrahim Byagowi 1348a2c865 [layout] hb_ot_layout_lookup_get_alternates, a new API
An API to retrieve one-to-one alternates from a given GSUB lookup index.
2020-06-18 09:11:07 +04:30
Behdad Esfahbod 41ef75f64a [gsub] Don't substitute in ReverseChainSingleSubstFormat1 if missing substitute
Fixes https://github.com/harfbuzz/harfbuzz/issues/2467
2020-06-17 16:29:09 -07:00
Qunxin Liu 973c47f6c9 [subset] Move 2 experimental public api methods to be private methods in GSUB/GPOS.
2 methods are: hb_ot_layout_closure_lookups and hb_ot_layout_closure_features
2020-06-12 01:20:30 +04:30
Behdad Esfahbod 56719474c2 s/blacklist/blocklist/g 2020-06-05 12:57:23 -07:00
Behdad Esfahbod 5cf53c06e6 Rename add_coverage to collect_coverage 2020-04-24 08:16:03 -07:00
ariza 188a0a47c2 removed default base; replaced w/ bias if required 2020-03-08 22:59:43 +03:30
Ebrahim Byagowi 07504569d5 [gsub] minor format 2020-02-21 13:05:44 +03:30
Garret Rieger 411225426f Fix glyph closure for alternate substitution.
It was not filtering on the glyphs to be retained.
2020-02-21 13:01:23 +03:30
ariza 72cbfb9059 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.
2020-01-21 16:53:19 -08:00
Qunxin Liu e565d1f9bc [subset] subset lookup/feature/script lists for GSUB/GPOS 2020-01-15 14:04:33 -08:00
Qunxin Liu 0b39c48064 [subset] closure lookups for GSUB/GPOS 2020-01-10 13:11:06 -08:00
Behdad Esfahbod a061e47fcc Change a few HB_INTERNAL static methods to static inline 2019-12-10 13:31:50 -06:00
Behdad Esfahbod dd3972a364 [GSUB] Simplify Extension is_reverse()
We don't allow extension lookups to chain to another extension lookup.
Simplify code for that.
2019-12-10 13:28:39 -06:00
Behdad Esfahbod 858b627984 [machinery] Remove CastR<>() 2019-12-10 13:18:32 -06:00
Garret Rieger e17e744300 Convert existing uses of serialize_append in gsub subsetting to use subset_offset_array. 2019-10-09 13:52:04 -07:00
Garret Rieger 36f18cecbb Add subset_offset_array helper function which simplifies subsetting offset arrays during stream operations. 2019-10-09 13:52:04 -07:00
Ebrahim Byagowi d512087e4d Rename GlyphID to HBGlyphID
Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
2019-09-14 11:55:53 +04:30
Behdad Esfahbod 38f95baf6b [subset] in SingleSubst subsetting, check for substitute in glyphset
That matches what fonttools does and allows for specifying exact
glyphset for subset.
2019-08-29 13:40:46 -07:00
Ebrahim Byagowi 499029644f
[gsub] Fix clang's semicolon complains 2019-08-29 15:09:39 +04:30
Behdad Esfahbod dc9222b1dd [subset] Implement AlternateSubst subsetting 2019-08-28 15:38:46 -07:00
Behdad Esfahbod 23681b6da4 Minor 2019-08-28 15:30:37 -07:00
Behdad Esfahbod 33c8e2303c [subset] Implement MultipleSubst subsetting 2019-08-28 15:25:55 -07:00
Behdad Esfahbod 5c43a7ba7e [GSUB] Use dagger in Ligature::intersects() 2019-08-28 15:10:38 -07:00
Behdad Esfahbod b8c642c1f5 Minor 2019-08-28 15:06:45 -07:00
Behdad Esfahbod bc5ef765a8 [subset] Subset ligature substitutes!
Test with:

$ ./hb-subset -o out.ttf NotoSansArabic-Regular.ttf --drop-tables=  سلام && ./hb-view out.ttf سلام
2019-08-28 14:52:13 -07:00
Behdad Esfahbod 0a18efd766 Minor 2019-07-26 14:34:26 -07:00
Behdad Esfahbod 7dcf8e126e [config] Fix build with HB_NO_OT_LAYOUT 2019-06-26 13:44:23 -07:00
Behdad Esfahbod 2ad4ba7bc0 [gsub] Minor 2019-05-31 15:51:29 -07:00
Behdad Esfahbod 2dbdec66a1 [gsub] Porting serialize to iterators 2019-05-31 15:41:54 -07:00
Garret Rieger 0af9de13b7 [subset] For gsub subsetting only consider glyphs reachable via gsub closure. 2019-05-21 13:02:11 -07:00
Behdad Esfahbod bcd3ffc948 Whitespace 2019-05-16 13:27:08 -07:00
Behdad Esfahbod 05bc5f96fb [subset] Remove extra iteration 2019-05-16 13:05:58 -07:00
Behdad Esfahbod 2376867649 Use hb_map(hb_add(this)) to dereference OffsetTo<>'s 2019-05-15 22:01:44 -07:00
Behdad Esfahbod d214b07883 Fix clang build
Ugh.

In file included from hb-ot-face.cc:41:
./hb-ot-layout-gsub-table.hh:293:7: error: template parameter redefines default argument
         hb_requires (hb_is_sorted_source_of (Iterator,
         ^
./hb-meta.hh:59:27: note: expanded from macro 'hb_requires'
 define hb_requires(Cond) hb_enable_if((Cond))
                          ^
./hb-meta.hh:57:67: note: expanded from macro 'hb_enable_if'
 define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr
                                                                  ^
./hb-ot-layout-gsub-table.hh:40:5: note: previous default template argument defined here
    hb_requires (hb_is_sorted_source_of (Iterator,
    ^
./hb-meta.hh:59:27: note: expanded from macro 'hb_requires'
 define hb_requires(Cond) hb_enable_if((Cond))
                          ^
./hb-meta.hh:57:67: note: expanded from macro 'hb_enable_if'
 define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr
                                                                  ^
2019-05-15 19:07:39 -07:00
Behdad Esfahbod 371b55c7a0 Fix clang build
In file included from hb-ot-face.cc:41:
./hb-ot-layout-gsub-table.hh:293:7: error: template parameter redefines default argument
         hb_requires (hb_is_sorted_source_of (Iterator,
         ^
./hb-meta.hh:59:27: note: expanded from macro 'hb_requires'
 define hb_requires(Cond) hb_enable_if((Cond))
                          ^
./hb-meta.hh:57:67: note: expanded from macro 'hb_enable_if'
 define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr
                                                                  ^
./hb-ot-layout-gsub-table.hh:40:5: note: previous default template argument defined here
    hb_requires (hb_is_sorted_source_of (Iterator,
    ^
./hb-meta.hh:59:27: note: expanded from macro 'hb_requires'
 define hb_requires(Cond) hb_enable_if((Cond))
                          ^
./hb-meta.hh:57:67: note: expanded from macro 'hb_enable_if'
 define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr
                                                                  ^
1 error generated.
2019-05-15 19:04:24 -07:00
Behdad Esfahbod f92d188d77 Whitespace 2019-05-15 18:52:57 -07:00
Garret Rieger 962f95cf80 [subset] Switch SingleSubst to use iterators in serialize. 2019-05-15 18:37:32 -07:00
Behdad Esfahbod 78d35f0e78 Reduce captures of lambdas 2019-05-15 18:15:05 -07:00
Behdad Esfahbod d0df996cdc Use implicit lambda return type 2019-05-15 00:32:41 -07:00
Behdad Esfahbod 7df3ecfb40 [meta] hb_void_t -> hb_empty_t 2019-05-10 20:43:26 -07:00
Behdad Esfahbod 83e3eabd84 Whitespace 2019-05-07 20:58:43 -07:00