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

[makeotfexe] ignore rsub is resolved to ignore sub #992

Open
khaledhosny opened this issue Oct 12, 2019 · 3 comments
Open

[makeotfexe] ignore rsub is resolved to ignore sub #992

khaledhosny opened this issue Oct 12, 2019 · 3 comments

Comments

@khaledhosny
Copy link
Collaborator

Not sure if this intentional or not, but ignore rsub produces the same lookup as ignore sub. The following two lookups:

lookup test {                                                                   
 ignore rsub A [B];                                                             
} test;
lookup test {                                                                   
 ignore sub A [B];                                                             
} test;

Produce:

  <GSUB>                                                                        
    <Version value="0x00010000"/>                                               
    <ScriptList>                                                                
      <!-- ScriptCount=0 -->                                                    
    </ScriptList>                                                               
    <FeatureList>                                                               
      <!-- FeatureCount=0 -->                                                   
    </FeatureList>                                                              
    <LookupList>                                                                
      <!-- LookupCount=1 -->                                                    
      <Lookup index="0">                                                        
        <LookupType value="6"/>                                                 
        <LookupFlag value="0"/>                                                 
        <!-- SubTableCount=1 -->                                                
        <ChainContextSubst index="0" Format="3">                                
          <!-- BacktrackGlyphCount=0 -->                                        
          <!-- InputGlyphCount=1 -->                                            
          <InputCoverage index="0" Format="1">                                  
            <Glyph value="A"/>                                                  
          </InputCoverage>                                                      
          <!-- LookAheadGlyphCount=1 -->                                        
          <LookAheadCoverage index="0" Format="1">                              
            <Glyph value="B"/>                                                  
          </LookAheadCoverage>                                                  
          <!-- SubstCount=0 -->                                                 
        </ChainContextSubst>                                                    
      </Lookup>                                                                 
    </LookupList>                                                               
  </GSUB>              
@readroberts
Copy link
Contributor

Definitely a bug. The rsub should show a different lookup type.

@NorbertLindenberg
Copy link

In addition, when ignore rsub is used together with another rsub rule, this leads to weird behavior that’s hard to understand:

  • If the two rules are inside a lookup block, makeotf reports a bug Error: "Lookup type different from previous rules in this lookup block" in Feature mark in line: xx. As usual with makeotf, xx is far far from the location of the code that it misunderstands.

  • If the two rules are outside a lookup block, makeotf doesn’t complain, but quietly packages them in two separate lookups, thus defeating the purpose of the ignore rule.

@khaledhosny
Copy link
Collaborator Author

Both of these would be manifestations of the same root issue, since makeotf is effectively parsing ignore rsub as ignore sub which can’t be mixed with rsub in same lookup as there are different types.

khaledhosny added a commit that referenced this issue Jun 9, 2020
The code was unconditionally overriding the lookup type to become
Chaining Contextual Substitution, instead do it only if it is not
Reverse Chaining Contextual Substitution.

Fixes #992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants