-
Notifications
You must be signed in to change notification settings - Fork 167
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
[otfautohint] points “optimized away” in flex-like scenario (print only) #1724
Comments
Can you |
I can :-) The unhinted glyph is the same for all tests, it contains no overlaps: unhinted
test1 ❌
→ printout of waterfallplot PDF contains outline error. test2 ❌
exactly the same as test1 test3 ✅
→ printed output is OK test4 ✅
exactly the same as test3 test5 ❌
same as test1, test2 test6 ✅
exactly the same as test3 All test scenarios including output PDFs attached: |
I guess the obvious solution for the glyphs in question would be to disable flex hinting, but still – shouldn’t flex only be active for small sizes anyway? And why does the problem only show in printed output (including obvious outline corruption beyond the area of the applied flex)? |
Responding to a special request from @skef “what happens when all the start points are moved”? test1 (start point moved to next on-curve point)
unhinted
hinted
|
Same tests as above, this time focusing on โ unhinted
test1makeotf only (no subroutinization, no checkoutlinesufo) hinted
test2makeotf (no subroutinization), with checkoutlinesufo hinted
test3makeotf only (no subroutinization, no checkoutlines), hinting with --no-flex hinted
test4makeotf (no subroutinization), checkoutlines, hinting with --no-flex hinted
test5makeotf release mode, checkoutlines hinted
|
The problem with the bars suggests one possible explanation (improper handling of an implicit subpath-closing line), but the problem with the full glyph can't be explained that way. If indeed the most recent test 4 lacks the problem with the lower oval, and the most recent test 5 has it, the only difference between those two are:
The slightly different hintmask for the oval is probably incidental. In any case it doesn't seem to affect the rendering of the inside of the oval, which is what it precedes. So the only difference is the presence of the flex hint in an entirely different part of the glyph, away from the mangled oval. I don't see how that can be a hinting bug, all signs would point to either a bug in the rasterizer itself or, possibly more likely, some conversion tool (e.g. a whatever-to-PDF converter). |
That makes the question of your tool-chain particularly important. We should consider the steps in creating the PDF and possibly look at alternative tools for each step to see if the problem goes away. |
Regarding the tool chain: this issue was first discovered when proofing a font (including the โ) via InDesign’s “Export PDF” feature. The PDF was printed via Apple Preview. |
I guess one thing to try would be extracting the font from the PDF (I believe there are tools that can do that) and seeing if it looks different. |
FontForge for the (rare) win. OK, so I guess the first question is whether the flex hint itself is wrong and screwing things up, or if it's the tool's interpretation of the flex hints that are causing the problem. I think the former is mostly ruled out by the bar cases -- the hints themselves look about right. (And in a UFO a flex hint is just a notation on a point.) So something can't properly interpret flex hints, or perhaps these optimized flex hints like hflex. |
Starting at the supposed flex-point (which is the one on top of the green rectangle), all on-curves have been moved upward by 38 units. 19 is the amount of flex, so it seems some tool is over-zealous here by applying it twice. default.mov |
We're pretty sure this isn't "our" bug. Seems to be something in Apple's MacOS print stack. |
@frankrolf should we convert this to a card about the MacOS problem (or just close it)? |
Probably warrants a "3rd Party Problem" label. I'll file a macOS bug and will close this after. |
This is a curious bug, and I can’t say if
otfautohint
(and precursors) is at fault, or if the problem is within PDF.It is specifically related to print output, and not reproducible on-screen. The attached project is an example for what I’m seeing.
These glyphs
reproduce in printed output like so:
The first glyph is a real-world example, other glyphs are reproductions of the same scenario.
What needs to happen to reproduce this:
otfautohint
orpsautohint
(does not make a difference)As we can see, the final on-curve point seems to have disappeared in the printed rasterization. This seems to be related to the amount of “flex”, and it has some visible consequences in my sample glyphs, but more drastic problems in โ. The software printing out the PDF is irrelevant:
However, if the glyphs are unhinted, this is the result:
Also, if the end of the 2nd segment is just moved 1 unit out of alignment, there will be no problem.
Adding the--no-flex
option during hinting does not make a difference.Test project attached, steps to reproduce:
FlexTest-Thin.zip
The text was updated successfully, but these errors were encountered: