-
Notifications
You must be signed in to change notification settings - Fork 105
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
New check: intersecting and/or duplicate contours #4854
Comments
Quoting the relevant FontValidator help file below: glyf: Intersecting contours The glyph indicated in the validation log contains contours that intersect with themselves (overlap) or other contours of the glyph shape. These intersections may cause the rasterizer to unpredictably fill the glyph shape. The different type of intersections are discussed below. Self-intersecting contours Multi-contour intersection For more information, see the glyf table specification. |
I just noticed that "intersecting contours" and "duplicated contours" are two distinct checks in FontValidator. Somehow this slipped my mind previously. Here's the contents of the help file for "Duplicated contours" (E1120): glyf: Duplicated contours The glyph indicated in the validation log contains duplicate contours. A portion of the glyph outline has a duplicated and overlapping contour. In the diagram on the left, two outlines are pasted on top of each other (note the overlapped point numbers); in the enlarged diagram on the right, the two outlines are separated. Depending on the outline editing tool used, the duplicate contour may be difficult to see. The unnecessary outline may have appeared as the result of an inadvertant cut-an-paste action while editing the glyph outline. Remove the duplicate contour carefully. Since redundant points will be removed, remaining points will be renumbered. If the font is already hinted and controlled points are removed or renumbered, hinting information may become invalid. In addition, glyph components of composite glyphs may end up attached to an incorrect location on the glyph outline. For more information, see the glyf table specification. |
FWIW, I believe there is some sort of fontforge-based intersecting/duplicate contour check, tioo. And I have written more than a few times, both publicly and specifically to @davelab6 and google folks since 2015, the glyf/contour related checks in FontVal consists of more than 10% of its code base, and is perhaps the most valuable part of it. BTW, development or FontVal has moved to |
What needs to be checked?
Intersecting and/or duplicate contours or contour parts in font glyphs.
Detailed description of the problem
One of MS Font Validator's checks that I think I'm missing in FontBakery is that of intersecting contours (error code E1111). While sometimes intersections are okay and intended, that check also helps find cases of mistakenly duplicated contours in fonts.
For example, here I have a glyph where the second contour (original letter z) is a subset of the first contour (letter z with the retroflex hook). The smaller contour was likely pasted from another glyph before the designer drew the new glyph on top, but was then simply forgotten. All it does there is occupies extra bytes at the very minimum.
It would be nice if FontBakery could warn about such cases.
Again, while Font Validator reported even things like lines that barely touched, I find that less useful than if it reported matching vectors/parts of contours/contours.
Resources and steps needed to reproduce the problem
Could the glyph file above serve as a test?
Suggested profile
Universal (broadly accepted best practices on the type design community)
Suggested result
Severity assessment
2
The text was updated successfully, but these errors were encountered: