<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Make fontconfig scanning faster"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=64766#c47">Comment # 47</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Make fontconfig scanning faster"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=64766">bug 64766</a>
              from <span class="vcard"><a class="email" href="mailto:freedesktop@behdad.org" title="Behdad Esfahbod <freedesktop@behdad.org>"> <span class="fn">Behdad Esfahbod</span></a>
</span></b>
        <pre>Motivated by <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - fontconfig cache creation takes a long time during GIMP startup"
   href="show_bug.cgi?id=101820">bug 101820</a>, I like to revive this work.

There are two options:

  - Do not bother detecting glyphs with no outline.  This will cause some
broken fonts to result in inferior rendering.  I'm not sure how bad that is in
practice.

  - Try to detect glyphs with no outline, but implement it ourselves instead of
loading using FreeType.  Let's discuss CFF/TrueType separately.  Read
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Make fontconfig scanning faster"
   href="show_bug.cgi?id=64766#c30">https://bugs.freedesktop.org/show_bug.cgi?id=64766#c30</a> first to refresh.

    * TrueType: tryng to detect empty composites would mean loading glyf table
and reading every glyph.  This will disable any I/O gains, but will still
provide a speedup.  Alternatively, we can do what my previous patch did: detect
and ignore empty single glyphs, but don't worry about empty composite glyphs. 
That way we just read loca table and not glyf,

  * CFF: Implementing full loading is not feasible.  However, maybe we can
detect glyphs mapping to cid1 and only check that glyph.  For everything else
assume it's non-empty.  Another approach would be to load CharString INDEX and
use that to detect empty glyphs (1-byte charstring).  That's similar to using
loca table only.  Not sure if this detects any cases in the wild.

Then again, as Khaled has pointed out to me, this empty-glyph check is a
liability for fonts that want to decompose glyphs into components, as the
nominal glyph cannot be empty or fontconfig won't detect language coverage
correctly.

So, maybe it is time to let this test go...  I like to hear what others think
before going ahead and implementing this.  If we completely remove the check,
that should make fontconfig scanning, like, over 10 times faster easily...</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>