I'm trying to convert a collection of Windows Postscript files to OTF on OSX. For that, I decided to go with Fontforge because I can batch-process them with scripts in the terminal. I know little bash-scripting and no Python, but have been able to modify a script on the Fontforge site to do this: http://fontforge.sourceforge.net/scripting-tutorial.html
However, as it is, I need to modify a lot of the files by hand to get the Style to display as I like it, like "Bold Italic" instead of "BoldItalic" with no spaces. So, I've looked into the documentation and tried to use the GetTTFName() and SetTTFName() functions to do this. I can get it to set the Style (subfamily) just fine, but I get an empty string when trying to read the existing style. Opening the font in the GUI, it displays the Style under the TTF section, so it is there. What I am experimenting with:
style = GetTTFName(0x409,2)
if (style!="") #use 'case' ?
style="Bold Italic Condensed")
Generate($argv[i]:r + format)
I'm aware there would be cleaner ways of doing it, like using Case, if Bash supports it, or converting it to Python, but for now I'm keeping it simple. Ideally, the script would look for a capital letter in the Style string and add a space before it where it isn't the first letter.
In any case, the above doesn't work, as GetTTFName() always returns an empty string. The parameters for the Set and GetTTFName() function is referring to is
Does anyone here know enough Bash scripting, in particularly with Fontforge, to see the problem?