Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[makeotf] Broken '-ga' option #497

Closed
astype opened this issue Jul 19, 2018 · 12 comments
Closed

[makeotf] Broken '-ga' option #497

astype opened this issue Jul 19, 2018 · 12 comments
Assignees
Labels

Comments

@astype
Copy link

astype commented Jul 19, 2018

System: Windows 7 Pro

Hello Miguel,

I have done all the steps to install the latest Adobe FDK like it's described on the afdko entry page.
(pip, virtualenv, afdko_env\Scripts\activate.bat - all works fine)

In the "old" fdk installation an path was set, so I could access "makeotf" (or makeotf.cmd) without typing the full install path from anywhere on the system.

e.g. "makeotf -h"

The new FDK is installed at

%USERPROFILE%afdko_env\Lib\site-packages\afdko\Tools\win

in my case

c:\Users\Andreas\afdko_env\Lib\site-packages\afdko\Tools\win

Typing "makeotf" has no effect. "Path not found" - ok, maybe I have to set the path by myself to the new install directory? So I set a new path:

c:\Users\Andreas\afdko_env\Lib\site-packages\afdko\Tools\win

But no success. Only if I call the makeotfexe.exe file with full path I can work with it.

e.g. c:\Users\Andreas\afdko_env\Lib\site-packages\afdko\Tools\win\makeotfexe.exe -h

... and this is sucks.

Maybe it's not much I have to fix or change. Did you have a clue for me?

Thank you.
Andreas

@anthrotype
Copy link
Member

you don't need to extend the %PATH% environment variable yourself, just do pip install afdko from within the activated virtual environment, or install globally outside the venv with python -m pip install afdko.

Calling the activate.bat script will ensure the venv's Scripts folder is at the beginning of the PATH, so typing makeotf will just work.
When you install to the global python environment, the Scripts folder of the latter must be in your %PATH%, if it isn't you won't be able to call makeotf or any other scripts.

If you pip install with --user flag (globally but not for all users, only for you), the scripts will be installed somewhere else (check pip docs, I forgot where).

@anthrotype
Copy link
Member

if you installed the afdko inside a virtual environment then you need to call the activate script before you can start using it, every time you launch a new cmd.exe (or powershell) window.
check this guide for more info
https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

@astype
Copy link
Author

astype commented Jul 19, 2018

Thank you Cosimo,

Yes, I set it up in virtualenv like recommended.

Now I understand I have to start the activate script every time before I use makeotf.

makeotf -h works now -

but if I try to compile my projects working nicely for years and with the older fdks, I get this tree of errors:

(afdko_env) d:__Font_Dev_fontbench__astype_Wood_H>makeotf -f 01\New\hein
z_new.pfb -o ready\WoodH_New.otf -ff 01\New_features.txt -mf _FontMenuNameD
B.txt -gf GOA_GTF.txt -S -ga -osbOn 7 -osbOff 8 -osbOff 9 -d

Traceback (most recent call last):
File "d:__font_dev_fontbench__astype_wood_heinz\afdko_env\lib\site-packages\afdko\Tools\SharedData\FDKScripts\MakeOTF.py", line 3053, in main
getOptions(makeOTFParams)
File "d:__font_dev_fontbench__astype_wood_heinz\afdko_env\lib\site-packages\afdko\Tools\SharedData\FDKScripts\MakeOTF.py", line 1167, in getOptions
is None)):
TypeError: eval() arg 1 must be a string or code object

Have I done something wrong?

@anthrotype
Copy link
Member

are you using python 3?
I think only python2.7 is currently supported by afdko, but @miguelsousa can chime in.
I'm not a regular user, to be honest. Sorry I can't help

@astype
Copy link
Author

astype commented Jul 19, 2018

I use phyton 2.7 - the version installed by FontLab Studio 6.

@readroberts
Copy link
Contributor

@astype @msousa Hi Andreas, You are entering the command line correctly, but have found an old bug in MakeOTF.py. I can reproduce this with the current code base, by using the '-gf' option before the -'ga' option. You can work around this by reversing the order of these options in your command line. I suggest that prior use of the '-gf' option should allow the '-ga' option to be used later, but should make it unnecessary to do so. Currently you do need to specify -ga' in order to turn on use of the GOADB file.

@frankrolf
Copy link
Member

I never understood what the purpose of the -ga option is, especially if a GlyphOrderAndAliasDB file is explicitly listed in the argument chain.

@readroberts
Copy link
Contributor

@frankrolf It was so that you didn't have to enter the '-gf' option and the GOADB path. If you enter only '-ga', MakeOTF will look in series of default locations for the GOADB file. This almost the only way I invoke use of the GOADB file. I agree that it '-gf' is used, you should not also have to enter '-ga'.

@miguelsousa
Copy link
Member

@astype thanks for the report. I'll look into this next week.

@astype
Copy link
Author

astype commented Jul 23, 2018

It does not matter if the -ga command is written in first place. If I don't use the switch -r (release mode) makeotf will crash. -r have do be placed before -ga -gf and the other stuff - strange.

sample: not working

makeotf -f 04\New\fontn.pfa -o ready\WoodBonnet-G-No4-New.otf -ff 04\New_features.txt -mf _FontMenuNameDB.txt -gf GOA_GTF.txt -S -ga -osbOn 7 -osbOff 8 -osbOff 9 -r

sample: working

makeotf -f 04\New\fontn.pfa -o ready\WoodBonnet-G-No4-New.otf -ff 04\New_features.txt -mf _FontMenuNameDB.txt -gf GOA_GTF.txt -r -S -ga -osbOn 7 -osbOff 8 -osbOff 9

@miguelsousa
Copy link
Member

@astype the fix is in the pipeline (see #514). We should be able to issue a pre-release version in the next few days.

@miguelsousa miguelsousa changed the title makeotf handling issues on windows [makeotf] Broken '-ga' option Jul 26, 2018
@miguelsousa miguelsousa self-assigned this Jul 26, 2018
cjchapman pushed a commit that referenced this issue Jul 26, 2018
@miguelsousa
Copy link
Member

I never understood what the purpose of the -ga option is, especially if a GlyphOrderAndAliasDB file is explicitly listed in the argument chain.

@frankrolf if you use -gf only, the glyphs will not be reordered nor renamed, but the Unicode overrides (from GOADB's 3rd column) will be applied. So, the purpose of -ga —by itself, or in combination with -gf if the GOADB file does not use the default name— seems to be only for requesting that the glyphs be ordered and named according to the contents of the GOADB file.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants