How to export complete Glyph table as text


#1

Hello,
I would like to export (or find) the complete Glyph table from within the main view (picture attached). The aim is to change ordering and to process it further for documentation purposes. At first I thought the table might be stored in the personal or default GlyphData.xml file, but in neither of the two files I could find my private use glyphs.

Therefore I would like to know how to export the complete Glyph table (or where to find my private use glyphs).

Many thanks


#2

I don’t think you can export that list. Anyway, the order of the glyphs in your file is controlled by the glyphData.xml file. If you have a custom one, entries in it will take precedence over the default one.

Information about this file is found in the manual beginning on page 194. There is also a tutorial about how to work with your custom file, here:
https://www.glyphsapp.com/tutorials/roll-your-own-glyph-data


#3

Where? In the exported font file? Or for displaying inside Glyphs?


#4

You like to have a list of glyph names? Then select all, right click and choose the appropriate option from the context menu Copy Glyph Names.


#5

In both. Changing the display inside Glyphs is not changing automatically the ordre in the exported font file? In most important: having a logical, personal order in Indesign (Glyphs).


#6

But this only copies the Glpyhs Name. I need: ID, Unicode, script, category and subcategory etc. To change the order per exemple in TexMate and to change category for each (Private Use) Glyph. As I started doing manually (see image) line by line.


#7

That is how I started. But I do have more then 200 new glyphs. Enter all the info manually will take me weeks. I can’t find the glyphsData.xml file with all the entries allready in there. My glyphsData.xml file seems empty.


#8

To set a specific glyph order in the exported font file, take a look at the custom parameter glyphOrder. In section 6.5.7 Custom Parameter `glyphOrder` of the Glyphs 2.2 Handbook:
https://www.glyphsapp.com/get-started
and the tutorials:
https://www.glyphsapp.com/tutorials/alter-the-glyph-order-in-font-view
https://www.glyphsapp.com/tutorials/custom-parameters


#9

Thanks for helping. We get closer. That is what I tried to do!
I created a new GlyphData.xml file. And when I want to copy the Information of the original GlyphData.xml, the file contains NOT my glyphs.
Means: I can not find the original GlyphData.xml.
There is one here (/Applications/Glyphs.app/Contents/Frameworks/GlyphsCore.framework/Versions/A/Resources/GlyphData.xml) but this contains not my glyph-informations.


#10

You are on the right track. Generate your own glyphData file and supply sortName. You can write a simple script that gives you a good starting point:

for layer in Font.selectedLayers:
	glyph = layer.parent
	production = glyph.production()
	if production == None and len(glyph.unicode) > 0:
		production = "uni"+glyph.unicode
	print '	<glyph unicode="%s" name="%s" category="%s" subCategory="%s" sortName="" production="%s" >' % (glyph.unicode, glyph.name, glyph.category, glyph.subCategory, production)

Then you put that in a GlyphsData.xml file, reorder the entries as you like and add a incrementing number to the sortName attribute.


#11

Hi,

Here is what you can do ( and what I did in case somebody else struggles )

Open Glyphs. Select all glyphs you want to export. Open Window >> Macro Panel

Enter: ( with Python indentation )

for myGlyph in Glyphs.font.glyphs:
	print '	<glyph unicode="%s" name="%s" category="%s" subCategory="%s" script="%s" />' % (myGlyph.unicode, myGlyph.name, myGlyph.category, myGlyph.subCategory, myGlyph.script)

Hit “Run” and copy the result.

I hope this helps somebody


#12

The script gives you all glyphs in a font, regardless of the selection. I think you meant:

for myGlyph in [l.parent for l in Glyphs.font.selectedLayers]:
	print '	<glyph unicode="%s" name="%s" category="%s" subCategory="%s" script="%s" />' % (
		myGlyph.unicode,
		myGlyph.name,
		myGlyph.category,
		myGlyph.subCategory,
		myGlyph.script
		)