-
Notifications
You must be signed in to change notification settings - Fork 475
[varLib.mutator] Overlapping contours on old versions of Safari #1281
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
Comments
See #730 |
cc @Lorp |
Note that this overlap issue still affects current Safari Version 11.1.1 (13605.2.8). In fact the bug is deep inside macOS. I believe these fonts are problematic in all apps that use the system renderer. Thanks for the pointer to the "bit 6 hack", @behdad. Please remember that this causes the font to be rejected by OT sanitizer code built into Chrome and Firefox. Another hack that works is to add a dummy fvar table in the font (e.g. a single custom axis with min, max & default = 0) and no gvar table. I have not seen any side-effects. Great that Google Fonts has released a VF font :) cc @twardoch |
Ugh... @khaledhosny can you fix OTS please?
Umm. That's ugly but maybe not a big deal. I wonder what tools will consider the font a varfont by just seeing fvar.
|
Looks like this is was already recently fixed in OTS. Font with the bit flipped works on the latest Chrome/FF. However fails on FF 59 and below and Chrome 63 and below. |
I already did, last year khaledhosny/ots@353c7f8. |
our fonttools/skia-pathops can be used to remove overlaps of the mutated instances. It works on quadratic curves as well, and supports the fonttools pen protocol. |
Removing overlaps might get ugly if the font has TT instructions ... |
should we add an options to fontTools.varLib.mutator to set that flag? |
I meant the OVERLAP_SIMPLE flag for glyf contour points that @jenskutilek added with #1316 |
#1518 adds support for setting Bit 6 ( |
I was going to advise Microsoft to update the |
I believe this is fixed now. |
Note that |
Yeah, also the fontTools WOFF2 encoder in fontTools.ttLib.woff2 doesn't keep these OVERLAP glyf flags. I guess we could have an option that sets those flags on all glyphs when compressing WOFF2 fonts. |
but we can't, because the format doesn't allow it. The only workaround if one wants to preserve those flags is to not transform the glyf table when compressing the font with WOFF2. |
another way to fix this is have the fonttools instancer run skia-pathops to remove the overlaps so that the OVERALP flags are no longer necessary. |
... however, as @jenskutilek already noted above, removing the overlaps will also invalidate any TrueType hinting that may be present in the instance font. |
We TT Hint all of our fonts, and really enjoy that those hints still work when a VF is instanced, so it'd be great to keep the hints somehow. |
I’m reverting to my earlier solution of an empty |
ha! that's a good trick :) |
Btw, this issue was broader than old Safari versions as the title of this thread suggests when we looked at it in #1518 with static *.ttf fonts that were instantiated from VF's. It also affected (at least) Chrome on macOS at that time. I don't recall whether we looked into other browsers. I didn't document others in the PR, so I am guessing not. |
@chrissimpkins, yes indeed, I should not have specified Safari. It is in fact all native rendering on macOS, so you see the problem in TextEdit and even in Finder font quick view if your A exhibits the problem. Unfortunately Apple has blocked my There may be other non-empty |
I worry a bit about the empty fvar trick because that might cause other effects which may be unintuitive or not obvious. e.g. would Windows Chrome switch to render those fonts with freetype (possibly invoking ttfautohint, which I've found produces poor results on fonts with overlaps). |
I can confirm that the following tiny
Using axis tag Good point, Rob, about a specific downside to this platform-specific hack. In our environment we control how to serve the fonts, so we can deliver unmodified static TTF/WOFF2s for Windows Chrome and minimal-fvar versions for Mac. |
NameID 0xFFFF please. |
Google Fonts has just released their first VF font, MarkaziText. VarLib's mutator has been used to serve static instances to browsers which do not support variable fonts. Unfortunately, users who still use older versions of Safari are reporting the classic OS X winding problem.
@garretrieger says that half of all users of Safari are using an outdated version. We could potentially solve this issue by removing overlaps on the mutated instances.
The text was updated successfully, but these errors were encountered: