<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">n Wed, Aug 9, 2017 at 7:51 PM, Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Behdad Esfahbod <<a href="mailto:behdad@behdad.org">behdad@behdad.org</a>> writes:<br>
<br>
> I understand why it was added, but hoping that many many years later, we<br>
> can actually remove it and call font bugs what they are: bugs.<br>
<br>
</span>Yeah, I can definitely agree on that -- the majority of the fonts I<br>
found with trouble were clearly subsetted and sold for cheap. The<br>
problem is that these fonts over-represent the languages they support,<br>
and you end up with blanks where characters should be. Of course,<br>
picking fonts by language support is not something we usually want to do<br>
with display fonts anyways, so maybe the bugs won't have that much<br>
negative impact.</blockquote><div><br></div><div>I thought about this more.  I don't think in reality this will be a problem.  For language-driven selection, we typically have good aliases set up.  My gut feeling is that the problem is more with extended Latin fonts, not other scripts.  I came up with ideas for keeping the old behavior while benefiting from the speedup.  That said, we have to decide whether the previous behavior is desired or not.  As Khaled pointed out, many advanced fonts can benefit from mapping to an empty glyph and transforming it in GSUB/GPOS...  I like allowing that.<br><br></div><div>Anyway, here's some ideas for how to keep things fast while allowing for blank checks:<br><br></div><div>  - Previous code was super slow on color-emoji fonts since it was loading all PNGs.  Well, the outline check only applies to outline fonts.  So, for bitmap, no loading is good,<br><br></div><div>  - If font is not CFF or TrueType, fallback to loading.  This should handle Type1, etc, which I personally don't care about.  Alternatively, if those are not usually problematic, skip.<br><br></div><div>  - If Latin1 characters are particularly concerning (eg. the cheap subset category), we can always check for Latin1 chars only.  That still keeps the huge performance boost on larger fonts.<br><br></div><div>  - Assume CFF fonts are sane.  For TrueType, we can keep my 'loca' table check.  That detects all empty simple glyphs (but not composites) and was practically free in terms of measurable timing.  If and only if the loca check found an erratic glyph (ie. non FcBlank char having empty simple-glyph) then we do a full FT_Load_Glyph() check.  This should keep good fonts performant while taking care of bad fonts.<br><br></div><div>  - If CFF is so important to check, we can implement the same check as 'loca', using the CharString INDEX of the CFF, but that one is much harder to get hold of, so I'm willing to wait and see if CFF is a problem at all.<br><br></div><div>Anyway, we need to reach a rough consensus on which direction to go with this.  While the checks above sound smart, I have a hunch that keeping it simple results in less headache in the long term.<br><br></div><div>b<br></div><div> </div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">behdad<br><a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div>
</div></div>