Copy link to clipboard
Copied
Spurred into action by an ongoing discussion at Typophile: Technical Q: Monoline fonts, I decided to have a go at writing a Javascript. I'm pretty pleased with the result; perhaps it's of interest for the technical illustration drawers among you!
Enjoy.
Here is a link to the script I wrote for Illustrator CS4 (it might or might not work for any other version): monolinetext.v1.0.zip. It's a Javascript for Illustrator, and you can put it into the regular Illustrator Scripts folder to see it appear in the "Scripts" menu, or somewhere else (and you'd have to browse for it each time).
It shows a little tiny dialog (on which I spend most of the time) where you can enter a size in "points" (relative to the 29 units high Hershey characters) and enter some text. Use Shift+Enter to insert a 'Hard Return', or enter as much text as you want. The text is then drawn out in monoline characters in the center of the screen.
The script is intelligent, in that you can change a previously drawn text by simply selecting it and running the script. Note, however, that stuff like manual scaling and changed attributes (stroke width, color) will be lost. If that's important to you, I might look into it ...
It only supports a small subset of the Hershey Simplex set -- just ASCII, space up to tilde. (And it draws traditional K shapes.)
Copy link to clipboard
Copied
Hi Maria Teresa,
The line thickness is explicitly set to 0.5pt in the script in two places: line 290 and line 306. Both read now
p.strokeWidth = 0.5;
but you can change that 0.5 to any other value. The spacing between the characters is independent from this -- it's been a while but reading the script, I think the design units are times 29, and so each line segment coordinates need dividing by that number. To change the horizontal spacing only, change the "/29" in line 309 to a lower number, such as "25".
Changing that and the stroke width to 1pt makes the text display thicker and spaced further apart:
Copy link to clipboard
Copied
Hello Jongware,
Thank you for the helpful script.
I need to convert non-Latin languages into monolines. Is it possible to use or modify your script to accommodate Greek, Hebrew, or CJK languages?
Thanks.
Copy link to clipboard
Copied
Of course! It would take a lot of work, but-- sure.
The script does nothing special or "magic". It comes down to drawing x sets of lines (where x comes from the definition of each character) and then advance the cursor y units forward. The data for the characters I used come from the well-known Hershey fonts set.
For Greek, all you need to do is find suitable line definitions of characters and then add these to the script. For Hebrew, you also need to make the script recognize runs of Hebrew, so they can be set in RTL. For "CJK languages", again, you only need to find suitable line definitions. (Unless you want to add vertical text as well. But there is nothing in the script that would forbid this -- it's still very much possible.)
Copy link to clipboard
Copied
Firstly, thank you so much for this script! It's amazing!
I was wondering; was there a way to adapt this to use a different typeface? Or to apply to a set of outlines? Thank you!
Copy link to clipboard
Copied
No, this script does not use a "typeface". The current line font comes courtesy of A.V. Hershey (Hershey fonts - Wikipedia), and that is a limited set. Although there are a few different designs -- serifed, sans, blackletter --, these are constructed by repeatedly drawing in the internal area to mimic a real "fill".
Copy link to clipboard
Copied
I just tried it in Illustrator 2021 and it works fine.
THANKS !
IMO, there is a great need for this tool, and the hability to use REAL single-line type. Technical illustrators, hobbyists (scrapbooking), art coders working with plotters, etc.
Copy link to clipboard
Copied
Hello,
Is it possible to provide a step by step of how to set up and to use this script?
Copy link to clipboard
Copied
All the information you need is in the original post. Where are you getting stuck?
Copy link to clipboard
Copied
Is this still available? The link seems to be broken.
Copy link to clipboard
Copied
Darrius,
unfortunately, Jongware passed away some time ago. Obviously, his website has been closed in the meantime.
I think (or hope) that today Jongware wouldn't mind to still share the script publicly.
I've uploaded it onto another server, so you can download it there:
Jongware – Monoline Text Script
Copy link to clipboard
Copied
Thanks. Its working but don't understand which font is this script using.
Copy link to clipboard
Copied
Naeem,
in his initial post Jongware mentioned that it's based on a subset of one of the Hershey fonts.
https://en.wikipedia.org/wiki/Hershey_fonts