Add support for stroke-based ("engraving") fonts

Bug #716676 reported by Windell Oskay
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Windell Oskay

Bug Description

Wishlist item.

Inkscape does not presently support single-stroke or other stroke-based fonts, also known as engraving fonts. Engraving fonts are ones where the visible portion of any given character is the *stroke*, not the *fill*.

Engraving fonts are commonly used when producing text-containing files that will eventually be fed to fabrication tools, when either of the following two conditions is true:
1. The fabrication time depends on the total path length (e.g., pen plotter, vinyl cutter, milling machine)
2. The fabrication tool resolution is non-negligible, so that the stroke width is an important part of the character shape

Here are some examples cases (and, just ones that I have personally come across!) where lack of engraving fonts support is an inconvenience in Inkscape:
1. Preparing a file to be printed on a vector-mode laser engraver
2. Preparing a file to be fed to an embroidery machine
3. Preparing a file to be fed to a paper or vinyl cutter
4. Preparing a file to be milled by a CNC router
5. Preparing a file to be engraved by a rotary engraving tool
6. Preparing a file to be drawn by a pen plotter
7. Preparing graphics a printed circuit board with minimum trace width requirements
8. Preparing toolpaths for creating text with an extrusion-based 2D or 3D fabricator

To solve this issue, I have written an Inkscape extension (Attached, a 70 kB ZIP file) that allows the user to render simple text strings, using one of several Hershey-designed (public domain) engraving fonts. I humbly suggest that it should be considered for possible future inclusion with Inkscape.

Additional discussion and documentation about the extension has been posted here: http://www.evilmadscientist.com/go/hershey

Related branches

Revision history for this message
Windell Oskay (windell) wrote :
su_v (suv-lp)
tags: added: extensions-plugins fonts
removed: cnc cutter engraving plotter
Changed in inkscape:
importance: Undecided → Wishlist
su_v (suv-lp)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Pablo Trabajos (pajarico) wrote :

I didn't know about this kind of fonts until now, so after reading that blog post I tried the "gothic" font from here: http://featurecam.com/general/support/engrave_fonts.asp

And the font doesn't show up in Inkscape, it does in Indesign, Word and Notepad++. I can't test it in GIMP because it crahes when trying to use the text tool (probably unrelated). Is that the same behaviour you're getting?

Revision history for this message
su_v (suv-lp) wrote :

The extension works fine and as described in the article "Hershey Text: An Inkscape extension for engraving fonts" (tested with Inkscape 0.48+devel r10039 on OS X 10.5.8). From my point of view, I'm for bundling it with Inkscape (Windell - thanks a lot for sharing this and all the interesting work you do for and with Inkscape!).

I'm not sure about the menu structure (placing the 'Hershey Text' in 'Render'): there is an increasing number of tools available, adding support for cnc, cutter, plotter, engraving, etc. (Gcodetools, EggBot, EggBot Contributed, inkscape-unicorn, ...). Maybe Inkscape needs to provide a new menu where developers could hook the related tools (including sub-menus) into?

Pablo Trabajos wrote:
> I tried the "gothic" font from here:
> http://featurecam.com/general/support/engrave_fonts.asp
> (…) And the font doesn't show up in Inkscape.

The extension does include the Hershey fonts (as SVG paths) - there is no need to install any special engraving fonts.

However - at least on OS X - most of the engraving fonts from the featurecam.com site do work in Inkscape (with the known limitations and with the help of the previous "Machine Tool Fixup" extension which was contributed for the EggBot extensions). AFAIU the main point of this new extension for Hershey text is to overcome the misrendering of centerline fonts by the normal font libs used in Inkscape for font layout and rendering (Inkscape closes all font paths which makes engraving fonts hard to use, as described in e.g. in recent threads on the eggbot mailing list [1], [2]).

[1] <http://groups.google.com/group/eggbotuser/browse_thread/thread/fee69938b2efcb49#>
[2] <http://groups.google.com/group/eggbotuser/browse_thread/thread/985555ef8fb3fac4#>

Revision history for this message
su_v (suv-lp) wrote :

@Windell, in the article you write:
> Depending on your operating system, this file is usually located in one
> of the following directories:
>
> Windows: C:Program Files>Inkscape>share>extensions
> Linux: "/usr/share/inkscape/extensions"
> OS X: "/Applications/Inkscape.app/Contents/Resources/extensions"

You can install user extensions on OS X into '~/.config/inkscape/extensions' as well (open the folder in the Finder using 'Go > Go To Folder…') - this has the advantage that none of the user-installed extensions are lost when a new version is installed. It might also make the installer you provide for the EggBot extensions easier, since 'Inkscape.app' can be placed in and run from any folder on the hard-drive but the Inkscape user profile folder is always the same.

Revision history for this message
su_v (suv-lp) wrote :

…and the same goes for the other platforms:

Windows: %APPDATA%\Inkscape\extensions
Linux: ~/.config/inkscape/extensions

(on Windows, the '%APPDATA%' variable can be entered as string in the address bar of the explorer (its values differs depending on the OS version)).

Revision history for this message
Windell Oskay (windell) wrote :

@Pablo Trabajos @~suv:

We have been using those "featurecam" fonts for some time, and hand-editing them. Some things to note about that.

1.) Licensing for the featurecam "Machine Tool" fonts is not clear. They are available for free-as-in-beer download, but we have been hesitant to recommend their use because that availability could be retracted at any time. This is not necessarily an issue, as there may be other sources that could be freely licensed, and we could (in principle) always compose new TTF fonts using the Hershey glyphs.

2.) Inkscape does automatically close the path of poorly formed TTF fonts. This is the feature of Inkscape that prevents true compatibility with TTF-based engraving fonts. I believe that this is a feature, not a bug, of Inkscape. In other words, I believe that this is the correct behavior in the vast majority of cases. However, if there were a way to add core support for engraving fonts that did not cause other conflicts, that *would* be a better solution.

3.) One of our Eggbot team members (Dan Newman) wrote the "Machine Tool Fixup" extension as a very specific fix to the path-closing. It works in most cases. In light of the new extension and (1) above, we had been planning to withdraw "Machine Tool Fixup" and no longer recommend the use of those specific fonts.

Revision history for this message
Windell Oskay (windell) wrote :

>(Windell - thanks a lot for sharing this and all the interesting work you do for and with Inkscape!).

Thank you ~suv, truly appreciated!

>I'm not sure about the menu structure (placing the 'Hershey Text' in 'Render')

As this extension does render a text object, it seemed like the correct location. It is not specific to any particular fabrication tool, or nor even to fabrication tools in general. We're certainly willing to locate it elsewhere if you can recommend a better menu location.

Revision history for this message
jpka (jopka) wrote :

I also need support for true vector font in Inkscape. I need this at least for engraving purposes. I can't use "Hershey" plugin because it contains only ASCII symbols in useable single-vector form, but i need to engrave in non-U.S. language.
I found one local engraving font, but it not opens in Inkscape, due to it is no support for vector fonts. Part of symbols of this font, Inkscape opens in converted to shape-based form; other part of symbols not opens at all. I search for different solutions for a years, but found nothing. I also can't use Qcad/Librecad for converting fonts, because it does not support italic font at all.
So i draw my own "font" (glyph set) according to local GOST standard (contains Cyrillic and ASCII set). Hope it will be useful by others. Please see attachment. Thank you!
Keywords: Inkscape, engraving, vector, stroke, single, thin, shape, Hershey, text, font, render, CNC, laser, vinyl, cutting, cyrillic, russian, GOST, гравировка, русский, шрифт, векторный, ГОСТ

Revision history for this message
Windell Oskay (windell) wrote :

@jpka:
>I can't use "Hershey" plugin because it contains only ASCII symbols in useable single-vector form,
>but i need to engrave in non-U.S. language.

I'm afraid that I do not understand what the fundamental issue is. Can you please clarify what it is about (for example) the cyrillic font included with the Hershey Text extension that makes it unsuitable for your use?

It is possible to (for example) reorder the characters within the set, or to create new fonts within the Hershey framework.
Would doing so (reordering the cyrillic characters, or adding new fonts) solve the issue, or are there separate reasons that this plugin cannot work beyond not having the fonts that you need?

Revision history for this message
jpka (jopka) wrote :

Hi Windell! Thank you so much for your reply and for your work. I can't use the Hershey Text plugin only for cyrillic, not due to order of chars in set, but due to the shape of glyphs itself is not so suitable for engraving. I can get Cyrillic letters only in 3-stroke form, i.e., i mean, the cyrillic text looks like "3-stroke" string in http://www.flickr.com/photos/oskay/5432527781/ . While ASCII text looks like "1-stroke" and then it's well suitable for engraving. I do not think that it is bug, but maybe i just misuse the tool.
BTW, looking at tool, it is possible to integrate my font in your tool? My "font" contains arcs, as you can see. While Hershey glyphs are only linear. My font is nothing more than attachment in comment #8, i.e. no other source codes - it just drawn from scratch on Inkscape sheet.
Thank you! :-)

Revision history for this message
Windell Oskay (windell) wrote :

@jpka:
What you originally wrote was "I can't use 'Hershey' plugin because it contains only ASCII symbols in useable single-vector form, but i need to engrave in non-U.S. language."

But what you actually meant was "I wish that the 'Hershey' plugin had additional font weights for cyrillic available."

These are VERY different things, and I don't think that it is necessary for you to outright dismiss the Hershey Text approach just because it didn't have the font weight that you want.

The original Hershey font sets included a selection of different character sets in different weights. *All* of the fonts, both the 1-stroke, 2-stroke, and 3-stroke fonts *are* suitable for engraving; there are *many* engraving cases where it is nice to have different weights available.

The cyrillic font included with the Hershey Text extension is a 2-stroke font, not a 3-stroke. It *is* a good choice for engraving. I do not know whether or not Hershey designed a single-stroke ("simplex") cyrillic font, but it would be relatively straightforward to add a new one. It would need to be designed in the same way as the Hershey fonts, on the same grid. An example editor is available here: http://www.batbox.org/editor/editfont.html

Revision history for this message
Windell Oskay (windell) wrote :

Here is another Hershey Font editor: http://www.efg2.com/Lab/OtherProjects/Hershey.htm

Revision history for this message
Windell Oskay (windell) wrote :

And a third Hershey font editor:

http://www.codeproject.com/Articles/444/Hershey-Font-wrapper-class

(My apologies for splitting this across several comments.)

Revision history for this message
jpka (jopka) wrote :

Hi Windell!
I am very sorry for initially unclean describe my problem. (Not only my problem; some people who knows about your plugin, still search ways/fonts for engraving in non-ASCII). The problem is: engrave non-ASCII text without extra time overhead. (This is exactly conforms with your point "1. The fabrication time..."). When one use ttf font, it's at least twice time overhead, because engraving tool will trace contours. So we must use vector fonts. Thinking about vector fonts, i mean exactly "single-stroke" fonts, and additionally, their shape must be hardly optimized for tool path gaps and path length; else we get unnecessary time overhead while engraving. The GOST fonts are excellent example for such optimized shape. There are also special "GOST engraving" font defined, even more optimized. When vector font is not exactly one-stroke, then it is, IMHO, bad choice for engrave, because it not only does not have even little advantage compare to (automatically) traced contours of TTF font, but also ttf fonts looks smoother, tons of ttf fonts available, and they are directly supported in Inkscape, include live text editing. (Well, if one really love the shape of particular multistroke font, it's good reason to use it.) If one need to fill area inside glyphs with cylinder engaving tool, one may use Gcodetools Area plugin: it is harder optimised than multi-stroke vector font. I can't find one-stroke cyrillic font anywhere, so i create it myself... Thank you for providing me some editors: i try to use it, of course, to create some fonts, because using your plugin is much better than just copypasting each glyph in my case.

su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
su_v (suv-lp)
summary: - No support for stroke-based ("engraving") fonts
+ Add support for stroke-based ("engraving") fonts
Martin Owens (doctormo)
Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Windell Oskay (windell)
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.