Single Stroke font ( like font for CNC / engraving )

That is how FontForge interprets the path. (And let me once again reiterate my advice not to use OTF as exchange format, but you know that already, I guess.)

Hi!
I’m working with open paths and it keeps closing the paths when I generate it. I tried unticking remove overlaps and autohinting when exporting but won’t respond. Is their any dummies common mistake that I might be making?
Thanks!

Martina Flor
Don’t bother in answering this last one, I just made it. It was me doing things wrong :slight_smile:

It is a tricky topic.

Technically, all paths must be (and are assumed) closed in an OTF. Thing is, practically every interpreter implies a closepath instruction at the end of a charstring. A charstring is the literal definition of the glyph. One example in TTX code:

600 139 318 rmoveto 304 -10 -100 94 -204 10 rlineto endchar

The first line defines the width of the glyph as 600 units, then moves the first point of the path to x=138, y=318. rmoveto means “relative move-to”. A “move-to” instruction indicates the start of a path. The second line draws three lines with rlineto (relative line-to): (1.) from x=138, y=318 (this is where we left of at the “move-to”) 304 units to the right, and 10 down; (2.) then 100 to the left and 94 up; (3.) then 204 to the left and 10 up. Finally, the endchar instruction says this glyph is finished.

This is what it looks like in Glyphs:

open

You see, there is no closing (fourth) line defined. The third line ends somewhere above the originating point. Now here’s the deal: Almost every rasterizer or interpreter that finds this glyph will assume an implicit closing line from the final line-to point to the originating move-to point. That means that the same charstring will look like this when displayed:

closed

The point is that Glyphs can differentiate between those two, while OpenType cannot. And Glyphs will keep the open path if the Remove Overlap option is not ticked off at Export. Thus, we can control which lines are explicitly defined. And this is all we need for the plotter. Because the plotter, by its very nature, does not implicitly assume that closing line I mentioned above.

I hope this clears up any confusion.

I’ve been trying to get this to work for me (I want to use a custom single line font in Rhino), but I haven’t been able to get open paths to work properly. I have an average of 2-3 open paths per glyph and everytime I export the font (as a TTF and with ‘remove overlap’ not ticked) some paths go missing or collapse in on themselves.

There is a way to make a single line font with closed path by simply duplicating every point (on top of one another) and creating compound paths that don’t have a thickness. But, the flaw in this method is that the CNC operation will be doubled as the tool will have to run the path twice (wherever the path/points overlap).

So, I’d really like to get these open paths working with Glyph. Does anyone have any other ideas/advice for me? Seems like Tim and Martina got it working.

I just uploaded a first version of a AutoCAD Shape Font Plugin.

2 Likes

Hi timknapen,
How did you manage to make it work on Ai? Does it also show as open path font?
Thanks!

Yeah, resurrecting this thread because I want to know too. I can’t get open-ended OTF to be visible in Ai, but TTF is visible though.

I don’t understand? OTF and TTF can’t have “open” contours. That the fonts do not show up probably has a different problem.

I mean leaving paths open in Glyphs while unchecking “autohint” and “remove overlap” options. Of course, under the hood paths are still interpreted as closed but…

If you have open paths and you choose not to remove overlaps or autohint when you export the OTF, the paths stay open in the final OTF.
-mekkablue

I tried doing this and the resulting OTF font was invisible in Ai, while TTF was visible. Left side has only stroke and right side has only fill.

Possible that open paths are automatically deleted these days. What do you need the open paths for?

The same reason as the original poster – to “write” the font using a plotter holding a pen. The regular OTF is already done, but I’m currently making an alternate version where all the glyphs are open, monoline paths.

1 Like

Simply close all paths, perhaps with a script. The software you use it with needs to be able to ignore the final closepath PostScript instruction.

Hint: Illustrator is not that software. But you can write an AI script that converts to outlines and removes the last segment in every path.

Eames, it looks like the paths in your example aren’t really open. I see a continuous loop without any endpoint. I never got a real font working in any common software (MacOS, Adobe…) because even if you leave open ends the type rendering part of the software always interprets it as a closed shape.

So if you draw the character ‘V’ as a single line going down and up again it would become something resembling a solid triangle V >> ▼

I did manage to get your example results with OTF fonts using Glyphs mini.

Simply close all paths, perhaps with a script.

I don’t follow.

Yes, but what does the plotter do? Does it draw alongside these automatically closed paths or ignores them?

For the project with the plotter I ended up not using OTF / Glyphs at all but writing my own font editor, font format and renderer. Typography was quite limited because of this. The font format I created was based on SVG and I didn’t implement kerning, ligatures and other nice typography features because I just didn’t have the time.
But I could use my open single stroke paths…

But you wrote that you had OTF showing up in Ai and even plotter working as intended. I can’t get OTF to show up for some reason.

Single Stroke font ( like font for CNC / engraving ) - #12 by timknapen

Ah yes, you need to export the OTF WITHOUT “Autohint all glyphs” or “Remove Overlap” enabled.

But I did uncheck that and it still doesn’t work.

  1. How do you test your font?
  2. What do you mean by ‘it does not work’? Does the font not show up in the font menu?