Typophile

exporting all the glyphs in a font into a text file

ebensorkin

I feel especially silly asking about this because about a month ago I figured out how to do this. It seems to me that either Fontlab or maybe Font Explorer had a feature that would export all glyphs in a font into a unicode text file. Maybe it's yet a third app. In any event if you recall & can remind me I will be most grateful. Thanks!

Nice link by gum! But that does another different cool thing. I want a txt file with the whole:

"aæbcdeffffiflghiijjklmnoœøpqrsßtuvwxyzðþAÆBCD
EFGHIIJJKLMNOŒØPQRSTUVWXYZÐÞ1234567890ªº&*
$€£¢¤#%•«†»‹‡›@§ƒ¶()[]{}\|/~:;.!¡?¿'"‘“”’
-—_¦™^ÀÁÂÃÄÅÆǺǻÇÈÉÊËÌÍÎÏÑÐÒÓÔÕÖØÙÚÛÜÝàáâã
äåæçèéêëìíîïðñòóôõöøùúûüýþÿĀāĂ㥹ĆćĈĉĊċČč
ĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĦħĥĨĩĪīĬĭĮįİıIJijĴĵĶ
ķĸĹ壳ĽľĿŀļĻŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞş
ŠšŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ√∂∫∞+–÷×=≠≈
±¼½¾°©®™µΩ∆∑∏" + plus the other glyphs.

As I say there really is a simple easy way to kick one out. And I will find the way again eventually but I hope somebody will be able to remind me instead!

Eben, why not select all glyphs, open the preview window, switch to text mode, select and copy everything and paste it into a text doc?

I will try that now. Thanks!

I have them all in, but I can't seem to find the way to "switch to text mode". Maybe that is a FL5 Mac vs PC difference...

On the mac it's next to 'metrics mode' and 'kerning mode'

Hey, that works. Pretty handy trick!

Thanks. I also use it the other way around. I first discovered this when I wanted to paste a Cyrillic text in FL.

Of course, you can only put encoded glyphs into a text file. I recently wanted to create an InDesign document that contained all the glyphs in a font, including the unencoded glyphs, and Eric Menninga at Adobe very kindly wrote me a script to do this. Eric says he plans to tidy the script up and post it to Typophile at some point.

That is really great! I am pretty sure this is a different method, but this seems like an far better one. Thanks Jos!

You're welcome Eben.

That's true John, but if you load the font first from which you're pasting, it will work.

*edit* At least on a Mac. Can't test it on Windows.

Eric says he plans to tidy the script up and post it to Typophile at some point.

That's great news.

I want this script! How can I make sure that I don't miss it's release? :)

This would save me so much time to keep my glyph lists in my Indesign test documents up to date (up to font). This is really a pain at the moment, it's time consuming and full potential errors ...

It's not too hard to accomplish using InDesign Tagged Text.

You just have to know the number of glyphs in your font, and then write an InDesign Tagged Text header to a text file, followed by a tag for each glyph ID.

Somthing along these lines in python:

import sys
print 'your tagged text header goes here'
for gid in range(425):
  sys.stdout.write('<cSpecialGlyph:'+gid+'><0xFFFD><cSpecialGlyph:>')

Insert some unencoded glyphs in InD via the glyph palette, export to tagged text and look at it in a text editor to figure out how it's done exactly.

Hm, come to think of it I should have made a program out of it and charged for it ;) Oh well, just send me your fonts that you proof with this script :)

Cheers,
Jens

Of course, you can only put encoded glyphs into a text file. I recently wanted to create an InDesign document that contained all the glyphs in a font, including the unencoded glyphs, and Eric Menninga at Adobe very kindly wrote me a script to do this. Eric says he plans to tidy the script up and post it to Typophile at some point

Now that wold be handy.

if you want encoded glyphs, in FLS5 you can do the "test font feature" and then there should be an option to show all glyphs in the font (with unicode values). Then from this dialogue box you can copy/paste the output.
i'd give more explicit instrux, but am away from my own laptop just now...


app.findGlyphPreferences = NothingEnum.nothing;
app.changeGlyphPreferences = NothingEnum.nothing;
app.findGlyphPreferences.appliedFont = app.fonts.item("Garamond Premier Pro Italic");
app.changeGlyphPreferences.appliedFont = app.fonts.item("Garamond Premier Pro Italic");

var t = app.activeDocument.textFrames.add({geometricBounds:[0,0,210, 148] });
var glyphenzahl = 2555;
var s = t.parentStory;
var c = fillStory( s, glyphenzahl );
var startGlyphID = 1;
app.findGlyphPreferences.glyphID = startGlyphID;

for ( i = 1; i <= glyphenzahl; i++ )
{
app.changeGlyphPreferences.glyphID = i;
c[i].changeGlyph();
}

function fillStory( aStory, aCounter )
{
aStory.contents = '';
for ( i = 0; i < aCounter; i++ )
aStory.insertionPoints[-1].contents = ' ';
return aStory.characters;
}

So this is a "beta"-version of the script, created with the kind help of www.hilfdirselbst.ch (swiss user-to-user support site). It inserts all glyphs of a Font to a new text frame in Indesign CS3. The glyphs do not need to be encoded with a unicode point.

What the script does: create a text frame with as much " " inserted as the font has glyphs as "search dummies". Start a search and replace script, searching for " " and replacing it with i+1 glyph number each time it finds one.
It is done per "search and replace" as it does not seem to be possible to directly access Glyphs per GID to insert them into a textframe, but it works per glyph search to replace them.

One have to adjust:
- 2 times Font-Family name und weight (separated per Tabulator: "Times New Roman[TAB]Regular")
- choose the same font as default setting in your Indesign document to be sure it works. I think as it is not specified in the script, this is necessary.
- insert the glyph count of the font in the line "var glyphenzahl = 1234;"
- "var startGlyphID=1": the GID of the "space" glyph of your font. Any other unicoded(!) glyph can be used as well, but be sure to read the next line if you do this!
- in the line "aStory.insertionPoints[-1].contents = ' '" the same glyph has to be inserted as specified in "startGlyphID" (i.E. if you have inserted the GID of the space character above, you have to enter a space here. These have to correspond, otherwise it won't work.)

This can be optimised for sure, but it works quite well for Adobes Garamond Premier Pro and for some of my fonts I was building it for.

I hope this is useful to some of you. Don't hesitate to improve it... I am a scripting noob, so there for sure is space for optimization.

This also works fine:

Tools > Quick Test As
Then choose: All characters
:)

> This also works fine:

for encoded characters...

Captured from web.archive.org on 22 Dec 2013. view this capture