Hello,
I'm running the latest AFDKO on a Windows machine.
When I use relative paths for specifying the location of the outputFile in the current.fpr project file (e.g. "OutputFontPath ..\TestFont-Regular.ttf"), MakeOTF.py raises a WindowsError exception:
Traceback (most recent call last):
File "C:\Users\simoneless\Documents\bin\FDK\Tools\SharedData\FDKScripts\MakeOTF.py", line 2428, in <module>
main()
File "C:\Users\simoneless\Documents\bin\FDK\Tools\SharedData\FDKScripts\MakeOTF.py", line 2423, in main
runMakeOTF(makeOTFParams)
File "C:\Users\simoneless\Documents\bin\FDK\Tools\SharedData\FDKScripts\MakeOTF.py", line 2318, in runMakeOTF
copyTTFGlyphTables(inputFilePath, tempOutPath, outputPath)
File "C:\Users\simoneless\Documents\bin\FDK\Tools\SharedData\FDKScripts\MakeOTF.py", line 1789, in copyTTFGlyphTables
fixPost(glyphList, inputFilePath, outputPath) # This has the side-effect of
creating outputPath if it doesn't yet exist.
File "C:\Users\simoneless\Documents\bin\FDK\Tools\SharedData\FDKScripts\MakeOTF.py", line 1903, in fixPost
os.rename(newTTFName, outputPath)
WindowsError: [Error 2] The system cannot find the file specified
The reason is simply because the makeRelativePath() function is returning a path for outputFilePath which contains a UNIX forward slash "/", instead of the required Windows backslash "\\":
To fix this, one needs to request the OS-specific path separator from the Python os module, using os.path.sep, and use that instead of the forward slash:
So, the lines 2075 and 2086:
relDir = "../"*numDir
should be replaced with something like:
relDir = (".."+os.path.sep)*numDir
All best,
Cosimo
PS: It would be nice if the AFDKO source code were hosted on Github or SourceForge, where others could help to spot and fix similar issues.