fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
534 stars 99 forks source link

[unreachable_glyphs] is ignoring JSTF table #4773

Closed bobh0303 closed 4 days ago

bobh0303 commented 5 days ago

(NOTE: Please include the check-id in the issue's title.)

Observed behaviour

Glyphs identified in the Extender Glyph Table within JSTF are included in the unreachable_glyphs test output.

Expected behaviour

Glyphs identified in the Extender Glyph Table within JSTF are not included in the unreachable_glyphs test output.

Resources and steps needed to reproduce

SIL's Harmattan and Lateef fonts include a JSTF table that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.53">
  <JSTF>
    <Version value="0x00010000"/>
    <!-- JstfScriptCount=1 -->
    <JstfScriptRecord index="0">
      <JstfScriptTag value="arab"/>
      <JstfScript>
        <ExtenderGlyph>
          <!-- GlyphCount=2 -->
          <ExtenderGlyph index="0" value="uni0640"/>
          <ExtenderGlyph index="1" value="absAutoKashida"/>
        </ExtenderGlyph>
        <!-- JstfLangSysCount=0 -->
      </JstfScript>
    </JstfScriptRecord>
  </JSTF>
</ttFont>

but the glyph named absAutoKashida is included in the test output:

❯ fontbakery check-universal -c unreachable_glyphs *.ttf -F | grep Kashida
          - absAutoKashida
          - absAutoKashida
          - absAutoKashida
          - absAutoKashida

There are other aspects of the JSTF table, including lists of GSUB lookups that can be used to improve text justification, that could make more glyphs "reachable", though I do not know whether the current test already evaluates these lookups or not.

felipesanches commented 4 days ago

With the fix on PR #4774, the glyphs referenced by ExtenderGlyph table withing the JSFT table (such as kashidas) are not reported anymore by the check.

There are other glyphs in Lateef being reported by the check, though. It is not clear to me if those are still false-WARNs. If that's the case, then please open another issue.