Follow-up to #92. Phase 1 there scopes 1.0 to name-only predicates which need nothing beyond the GlyphMap fea-rs already has. This issue is the deferred remainder: predicates that query glyph metadata, and nested boolean expressions.
As far as I can tell, only two crater sources need this:
ZalandoSans (zalando/sans): category/subCategory:
$[category like 'Number']
$[subCategory like 'Space']
Borel (RosaWagner/Borel): the full NSPredicate subset plus nested/parenthesised boolean, e.g. one @short class meaning "every exporting glyph that is an uppercase Letter with a Unicode value whose name starts with AE/C/E/T/X":
@short = [$[category like "Letter" && case==upper && unicode != nil && (name beginswith "AE" OR name beginswith "C" OR name beginswith "E" OR name beginswith "T" OR name beginswith "X")]];
What this needs on top of phase 1:
- Threading glyph metadata (category, subCategory, case, unicode) through to wherever predicates are expanded. fea-rs currently only receives glyph names.
case in particular isn't retained by glyphs-reader today (it's dropped in glyphdata.rs), so that needs adding to the reader first.
- The
like operator (fnmatch-style) and the nil literal (for unicode != nil).
- A real boolean parser: mixing
&&/OR, parenthesised grouping, and NOT with proper precedence (phase 1 only needs a flat single-operator chain).
These are two fairly independent chunks: ZalandoSans needs only the metadata threading + like; Borel additionally needs case (including the glyphs-reader change), unicode/nil, and the nested-boolean parser.
Follow-up to #92. Phase 1 there scopes 1.0 to name-only predicates which need nothing beyond the GlyphMap fea-rs already has. This issue is the deferred remainder: predicates that query glyph metadata, and nested boolean expressions.
As far as I can tell, only two crater sources need this:
ZalandoSans (zalando/sans): category/subCategory:
Borel (RosaWagner/Borel): the full NSPredicate subset plus nested/parenthesised boolean, e.g. one
@shortclass meaning "every exporting glyph that is an uppercase Letter with a Unicode value whose name starts with AE/C/E/T/X":What this needs on top of phase 1:
casein particular isn't retained by glyphs-reader today (it's dropped in glyphdata.rs), so that needs adding to the reader first.likeoperator (fnmatch-style) and thenilliteral (forunicode != nil).&&/OR, parenthesised grouping, andNOTwith proper precedence (phase 1 only needs a flat single-operator chain).These are two fairly independent chunks: ZalandoSans needs only the metadata threading +
like; Borel additionally needscase(including the glyphs-reader change),unicode/nil, and the nested-boolean parser.