Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deleting glyphs #1251

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions c/makeotf/makeotf_lib/source/hotconv/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3303,7 +3303,7 @@ static int validateGSUBMultiple(hotCtx g, GNode *targ, GNode *repl,
valid = 0;
}

if (!((isSubrule || IS_GLYPH(targ)) && isUnmarkedGlyphSeq(repl))) {
if (!((isSubrule || IS_GLYPH(targ)) && isUnmarkedGlyphSeq(repl)) && (repl != NULL || targ->flags & FEAT_LOOKUP_NODE)) {
featMsg(hotERROR, "Invalid multiple substitution rule");
valid = 0;
}
Expand Down Expand Up @@ -3599,7 +3599,7 @@ static void addSub(GNode *targ, GNode *repl, int lkpType, int targLine) {
}
}

if ((repl == NULL) || lkpType == GSUBChain || (targ->flags & FEAT_IGNORE_CLAUSE)) {
if (lkpType == GSUBChain || (targ->flags & FEAT_IGNORE_CLAUSE)) {
/* Chain sub exceptions (further analyzed below). */
/* "sub f i by fi;" will be here if there was an "except" clause */

Expand Down
25 changes: 25 additions & 0 deletions tests/makeotfexe_data/expected_output/spec/5b-1.ttx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont>

<GSUB>
<Version value="0x00010000"/>
<ScriptList>
<!-- ScriptCount=0 -->
</ScriptList>
<FeatureList>
<!-- FeatureCount=0 -->
</FeatureList>
<LookupList>
<!-- LookupCount=1 -->
<Lookup index="0">
<LookupType value="2"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<MultipleSubst index="0" Format="1">
<Substitution in="a" out=""/>
</MultipleSubst>
</Lookup>
</LookupList>
</GSUB>

</ttFont>
3 changes: 3 additions & 0 deletions tests/makeotfexe_data/input/spec/5b-1.fea
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lookup test {
sub a by NULL;
} test;