Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


[Ann] A Monoline Text Drawing Script

LEGEND ,
Sep 12, 2010 Sep 12, 2010

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.)

monolinetext.png

Views

40.1K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2019 Feb 06, 2019

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:

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2019 Feb 07, 2019

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2019 Feb 08, 2019

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.)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2019 Apr 03, 2019

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!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 04, 2019 Apr 04, 2019

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".

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
    • 1
    • 2