fontforge / fontforge

Free (libre) font editor for Windows, Mac OS X and GNU+Linux
http://fontforge.github.io/
Other
6.52k stars 703 forks source link

Element fails validation as self intersecting but I cannot see any intersecting lines #4409

Open Shelagh-Lewins opened 4 years ago

Shelagh-Lewins commented 4 years ago

FontForge Version 03:03 UTC May 2019 Running on Linux Mint Cinnamon 18.1

I am attempting to fix an element which is failing validation with the message "The paths that make up this glyph intersect one another".

I've tried the following automatic fixes:

element > round > to int element > simplify > cleanup glyph element > simplify > canonical startpoint element > overlap > remove overlap

I have tried right-clicking in the Validation dialog and selecting "try to fix glyphs with" > "self intersections".

I have tried ticking the "Check self intersection" option in the "element" menu; the option below it "element self intersects" is then also ticked.

However I cannot see anything on the glyph itself to show where the problem is, and I can't find any tutorial or help files that explain how to identify invisible self intersections. I've tried zooming in on all the points and can't see any obvious problems.

Here's a screenshot of the offending glyph.

fontforge

I've looked in the font forge mailing list archives but can't find anything relevant; also the forum seems to be inactive, and although I have registered, I can't start a topic. My apologies if this is the wrong place to ask the question.

Can you suggest any steps I can take to find and identify the problem? Thank you!

KamilLanda commented 4 years ago

Maybe some points are doubled. Edit/ Select/ Select All and then Element/ Overlap/ Remove Overlap

Shelagh-Lewins commented 4 years ago

Thanks @KamilLanda but as I wrote in my post, I already tried Element > Overlap > Remove Overlap and it didn't fix the problem.

What I need to know is how to identify overlaps in the visual editor?

skef commented 4 years ago

This isn't very a very sophisticated idea but try opening the Point Info dialog and stepping through "Next Point On Contour" with it. If there are overlapping/hidden points it should be easier to tell that way.

Alternatively you can just open the file and drag the points around to see if there are overlapping or redundant points.

KamilLanda commented 4 years ago

Please upload here your SFD file (pack it to the ZIP) with the character from screenshot. I will try to find a problem.

KamilLanda commented 4 years ago

Next way (and also not so intelligent) how to see overlapping point is select one point and press Arrow (for example Left Arrow) several times. Point will move, so you will see place under it. Then Edit/ Undo for move point back.

KamilLanda commented 4 years ago

Next idea: zoom glyph to big size and look if some curve hasn't intersecting with next curve alike in screenshot. self-intersect

Shelagh-Lewins commented 4 years ago

Thanks @KamilLanda . I selected a point and then used element > get info to open the info dialog, and step through each contour point. They all look OK as far as I can see.

I have zoomed in and looked at all the points and I cannot see any overlap.

I attach a zip of my sfd file. The character with the problem is Uruz at 5794. PfefferMediaeval.sfd.zip

Thank you for your help!

skef commented 4 years ago

There's no self-intersection -- this is some problem with FontForge's detection algorithm. I wouldn't worry about it -- just ignore the notice.

KamilLanda commented 4 years ago

During validation and message "The paths that make up this glyph intersect one another", FontForge highlighted some affected point to yellow color. yellow-highlighting

So I only tried to move end of one point to next position and back -> and then validation is OK. It is in video. Apparently some overlapping algorithm in FontForge is sometimes confused :-).

validation-overlapping.zip

Shelagh-Lewins commented 4 years ago

Thank you so much! That worked! I would never have thought to move the spline end and replace it. That removed the validation issue with intersecting points and now I can generate my font.

Oddly, the fixed version now shows a warning that there are non-integral points. If I apply element > round, then the intersection error reappears. As this is an otf font, it seems that non-integral points are OK, and my generated font appears correctly in Libre Office, but it is weird!

KamilLanda commented 4 years ago

Next strange behavior :-). I add one point above "bottom point" and Validation is also OK. one-moreover-point

But if point is added more above, then validation is also with intersection message. no-functional-point