Single Stroke font ( like font for CNC / engraving )

line by line sounds very annoying to me :frowning:

But I just discovered something… apparently .ttf fonts does support “open paths”, although illustrator renders them quite horribly.

Here’s the result of a quick test I did with the single stroke font “Machine Tool” (machtgth.ttf) : http://www.flickr.com/photos/worldreceiver/8519316684/in/photostream

Does Glyphs export .ttf?

I think AutoCAD uses stroke fonts and has its own font format for it. AutoCAD was made to drive machines like yours.

So, instead of writing your own solution you need to find a CAD app that supports the SHX font format and then write a SHX export plugin for Glyphs (I can help with that).

But Rainers suggestion to draw and layout everything in Glyphs should work quite well. Just print to PDF and you can use the hole composition in Illustrator.

1 Like

Indeed, there are some OpenType hacks called OPF (open path font) or ‘Thin Font’. They claim they only work with a software called ‘Make The Cut’:
http://www.letteringdelights.com/searchsite_detail.php?id=2406
http://underacherrytree.blogspot.co.at/2012/04/new-lettering-delights-thin-fonts.html

The OPFs contain no closepath, here is an A, output by TTX/FontTools:








I wonder whether this works with PS based OTFs as well, for this would make things much easier on the font development side. If I send a test file to the e-mail address on your website, can you try and put it through that ‘home-made drawing machine software’ of yours?

ok, just a little update.
Thanks to your super fast help it seems like I am actually getting somewhere!

Mekkablue sent me an email with a single stroke font he quickly made. I ran it through my software and… the result is perfect!

my little victory image: http://www.flickr.com/photos/worldreceiver/8519592936/in/photostream

:slight_smile:

Err… here is something I did not know myself so far.
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. Here’s the charstring of the A from the screenshot (via ttx):

600 26 14 rmoveto 210 63 140 392 57 hhcurveto 57 133 -408 -204 52 hvcurveto 205 -81 -140 45 -253 hhcurveto endchar

Most rendering engines will interpret a closepath statement into the code (that’s why the AI screenshot looks like it does), but Tim’s CNC software chooses not to. And that’s all we need for this purpose.

1 Like

amazing! I tested exactly this immediately after downloading the Glyphs trial.
It exported the font as “Newfont.otf” just fine, but when I loaded it into Font Book and installed the font to my system it wouldn’t show up in Illustrator.

After the amazing help of mekkablue, I gave the font a name and tried it again. now it shows up fine in Illustrator.

thanks a lot guys!!

“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. Here’s the charstring of the A from the screenshot (via ttx)…”

That’s a pity… I was hoping I could use that method to export the Blumenkind paths into FontForge for stroking, but the paths all end up closed when I open the exported OTF. I guess I could reopen them all by hand, but that’s a lot of work…

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.