Can I use Fontforge Py Script with Glyphs with minor editing?

Hi
Can I do a minor modification to a Fontforge Python Script to work with Glyphs?
What should I change for glyphs to recognize it

I am new to scripting.

the Python script is for converting “old Arabic fonts with Microsoft specific codepages” to unicode mapping
“converting by renaming”

the most incomprehensible part to me is the start of the python where i noticed a different based on target app

those old fonts were mapped on PUA.
some fonts from 0xF100 to 0xF1FF
and some from 0xF200 to 0xF2FF

here is the python
legacy2opentype.py.zip (6.4 KB)

P.S an older version of the code is on Github: occ/legacy2opentype at master · ojuba-org/occ · GitHub

The script is uses a quite different API then what you usually use in Glyphs. It seems to work with fontTools, so you could run it on the font before you open it in Glyphs.

Another option would be to write a custom GlyphData that could do the renaming. I would need one of the old fonts the check what the best option is. Could you send me one (by email to support at this domain)?

thanks GeorgSeifert for your replay

i really did not used fontTools. need time to get used to it and terminal

I have sent an email with a legacy font

the renaming I meant is that i will use glyphs naming for the purpose of using one-click auto opentype feature of glyphs.

I re-wrote the script:
Legacy Arabic To Unicode.py.zip (3.0 KB)

Install the script as explained in this Tutorial:

Then open the font. Make sure that you have “Kept Glyph names form imported files” in Font Info > User Settings set.

Then run the script.

Thank you very much for your effort and time :slightly_smiling_face:

it worked! actually with minor correcting some lines of your python “glyphs names” you assigned as there are duplicates diacritics in the original font.

I cannot find such an option “Kept Glyph names form imported files” as you described
wondering!

It is not in “Font Info” but Preferences. Sorry for that.

1 Like