Halp! INDEX bounds error upon OTF export

I’m in the process of wrapping up the final release of Cormorant for Dave Crossland to ingest into Google Fonts, and of course just now some of my fonts fail to export. :frowning: The TTFs worked just fine.

Here’s the error dialog:

And the generateFont.command console output:

[public-docking-hg-5476: GitHub] $ /Users/thalmann/Library/Application\ Support/Glyphs/Temp/CormorantInfant-Light/generateFont.command 
makeotfGlyphs [WARNING] The total size of the glyph names is greater than the safe limit for Mac OSX 10.4.x and earlier by 1451 bytes, and will cause crashes. [font.pfa]
makeotfGlyphs [WARNING] --- Source font: font.pfa
makeotfGlyphs [WARNING] subr stack depth exceeded (reduced)
makeotfGlyphs [FATAL] INDEX bounds

I feel like I’ve had that problem before, but I can’t fix it just by refreshing features or rerunning my custom parameter scripts. Halp?

As usual: https://github.com/CatharsisFonts/Cormorant

You can try disabling subroutines, but that will make your files significantly larger.

Google won’t like that. :stuck_out_tongue: How?

Strange that it worked for my last version. I only changed some metadata and instance names in the meantime…

Do the custom parameters have anything to do with it?

I think I solved it. Details coming up.

Details: I had a few glyphs of the type /U.ss03.ss04 and /U.ss04.ss03. The reason for that was, predictably, my utter ignorance at Python programming. Originally, I had used the .endsWith(’.ss03’) method to identify the glyphs to be promoted to default for the Infant style. I couldn’t find a .contains(’.ss03’) method, so for that script to work with /U.ss03.ss04, I simply made a second glyph called /U.ss04.ss03 which would normally never be used by OTF programming but which would be promoted to /U.ss04 by my export script.

On a hunch, I deleted the /U.ss04.ss03 glyph and similar ones. Suddenly, things worked again. No idea why it had worked previously and suddenly stopped…!

All you need is in:

x = "U.ss03.ss04"
print "ss03" in x # ---> True

I thought in only worked with lists… I did figure out that I could use .find(‘ss03’) > 0, though; that’s what I’m using for a newer typeface. :grin: I’ve never rewritten the code for Cormorant since I figured you’d only use the spin-off fonts in an environment with poor OpenType support anyway…