<snip>
When "open -a FontForge" your script calls what I assume is the latest packaged release, at /Applications/FontForge.app, which is the same as double clicking that app icon in Finder.
https://github.com/fontforge/fontforge/blob/master/osx/FontForge.app/Contents/MacOS/FontForge <https://github.com/fontforge/fontforge/blob/master/osx/FontForge.app/Contents/MacOS/FontForge>
You would need to edit that shell script, and yours, to pass the arguments supplied to the actual fontforge executable.
Whoa! Thatâs more than I anticipated. With respect, I think that this script is broken. Hereâs what Iâve found:
1. Iâve just taken a look at the script you cite (following the exact link above). Iâm not an shell-script expert by any means, and some of it makes my
eyes cross, but it ends with the following if-statement, which looks reasonable:
if [ $# -eq 0 ] ; then
( exec $WRAPPER $bundle_bin/fontforge -new & )
else
( exec $WRAPPER $bundle_bin/fontforge "$@" & )
fi
That means that if the script is called with no command-line arguments (i.e. the count of arguments, stored in $#, is zero [ $# -eq 0 ]) then
execute the $WRAPPER with
fontforge -new
which will bring up FontForge with a default empty new ISO-8859-1 font. That makes sense.
Else (if there is at least one command line argument) then execute the $WRAPPER with
fontforge â$@â
As usual, $@ represents (is expanded to) all the original command-line arguments. That also makes perfect sense. It looks to me like the _intent_ of the script is to pass along the command-line arguments typed by the user. So the _intent_ was to allow me to invoke
$ fontforge myfont.otf
and have myfont.otf opened rather than a new empty font. Again, I think that was the _intent_ of the script, and it probably worked in some previous version.
*** The plot thickens ...
2. But now I look at the FontForge.app/Contents/MacOS/FontForge script in the version that I just downloaded and installed (the downloaded disc image file is FontForge-2015-04-30-Mac.app.dmg, which I opened to find FontForge.app, which I dragged into /Applications/), and the final if-statement, shown above, has been changed, with the two call formulas conflated to the following single line:
$WRAPPER $bundle_bin/fontforge -new "$@â &
That is, it looks like the current script is always calling fontforge with the -new argument followed by any user-supplied command-line arguments (which might be ignored in such a case).
**** Is there a shell-script expert in the house?
3. I tried commenting out this one final line and substituting a copy of the if-statement shown above from a previous release, and that didnât seem to help. I suspect that the problem lies in the definition of WRAPPER, which I havenât figured out yet. It looks suspicious to me (see especially, in the same file, the definition and re-definition of WRAPPER before it is actually invoked inside the definition itselfâ-thereâs also a suspicious call to WRAPPER that is commented out). The change to the final invocation(s) of fontforge looks suspicious. In short, I suspect that this script is broken, and I suggest that the problem lies in the definition of WRAPPER. Perhaps one of you is better than I am at reading and fixing such scripts.
Best,
Ken
********************************
Kenneth R. Beesley, D.Phil.
PO Box 540475
North Salt Lake UT 84054
USA