-
Notifications
You must be signed in to change notification settings - Fork 185
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
Corruption when using WorkSans-Black #90
Comments
I have the same issue with Nunito font https://fonts.google.com/specimen/Nunito |
Same problem with Looks like we need to do a deep dive into TTF specification. As far as I know, usually shapes should only cut negative space out of themselves, not other shapes. Maybe this is some obscure data structure problem, where multiple closed loops are defined in a single shape, or something like that? |
Did some debugging using the letter Here it is after rendering both contours of the letter separately and awkwardly pasting them on top of each other in MS Paint: This demonstrates that the contours are loaded correctly. The bug seems to be with how contours are blended. Specifically, the bulge of the letter With a bit of luck, this leaves us with 100 lines of code to sift through. I'll come back to this another day. |
My guess was that it's some winding thing... so, if you set e.g. in https://github.com/golang/freetype/blob/master/truetype/face.go#L188 add Note: I'm not sure whether there's some font or glyph property that should determine whether to use it; or whether it'll correctly work with alpha values. |
I tried your solution, and you're correct. My take on
On another note, I actually failed to to get your solution to work on my first attempt. |
The fix in the Goki fork works for me. It would be great to get this fix in the main implementation. To be clear, this is a bug. Filled fonts should not be rendered with UseNonZeroWinding = false (which is the default in the Rasterizer) The Montserrat Black font on Google fonts demonstrates the issue. |
Describe the bug:
When using the WorkSans-Black font certain cross-elements are corripted.
The font shows gaps instead of a solid character, as per images below
To Reproduce:
Steps to reproduce the behaviour:
DrawMask
passing the parsed font (fromtruetype.Parse
)Notice the holes in the output:
![175044562-277cbace-4466-45d3-9b86-3b658bab9d97](https://user-images.githubusercontent.com/294436/175921201-5e184241-42b6-4f5d-93d9-b1a6a2f171fb.png)
The same does not happen when you download the font from https://www.1001fonts.com/work-sans-font.html...
The text was updated successfully, but these errors were encountered: