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

2.8.1 [makeotf] ValueError: path is on drive c:, start on drive F: #602

Closed
LIXiangChen opened this issue Sep 8, 2018 · 5 comments
Closed
Assignees
Projects

Comments

@LIXiangChen
Copy link

My Python was installed on C, and font project files are in a path on F. Execute makeotf -f "font.ps" -fi "fontinfo" -ff "../table" -ch "../../_CMap/CJK-UTF32-H" -cs 25 -cl 33 -omitMacNames -r -nS is all good in 2.7.2, but in 2.8.1 will return:

makeotf [Warning] Could not find an Adobe CMAP Mac encoding mapping file. If you want a Mac cmap subtable, please specify the Mac CMAP encoding file with the '-cm' option.
makeotf [Warning] Could not find a Unicode Variation Sequence file in the expected 'c:\python27\lib\site-packages\afdko\resources' subdirectory.
makeotf [Note] setting the USE_TYPO_METRICS OS/2 fsSelection bit 7 from fontinfo keyword.
makeotf [Note] setting the WEIGHT_WIDTH_SLOPE_ONLY OS/2 fsSelection bit 8 from fontinfo keyword.
makeotf [Note] setting the OBLIQUE OS/2 fsSelection bit 9 from fontinfo keyword.
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\makeotf.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\afdko\makeotf.py", line 2673, in main
    runMakeOTF(makeOTFParams)
  File "c:\python27\lib\site-packages\afdko\makeotf.py", line 2359, in runMakeOTF
    fontDir = makeRelativePaths(makeOTFParams)
  File "c:\python27\lib\site-packages\afdko\makeotf.py", line 2338, in makeRelativePaths
    fontDir, makeOTFParams.tempFontPath)
  File "c:\python27\lib\site-packages\afdko\makeotf.py", line 2288, in makeRelativePath
    targetPath = os.path.relpath(targetPath, curDir)
  File "c:\python27\lib\ntpath.py", line 529, in relpath
    % (path_prefix, start_prefix))
ValueError: path is on drive c:, start on drive F:
@LIXiangChen
Copy link
Author

mergeFonts is also broken. Call mergeFonts -cid "fontinfo" "font.ps" "../../_map/new/m_NOTDEF.map" "g_Latin.pfa" and return:

mergeFonts: --- ../../_map/new/m_NOTDEF.map
mergeFonts: bad font file: ../../_map/new/m_NOTDEF.map
mergeFonts: fatal error

@readroberts
Copy link
Contributor

I see two different issues in your reports. Your first comment shows a bug in makeotf, in that it should deal more gracefully with not being able to make a relative path between the temp file and the target path. I think makeotf should not attempt to do this when the files are on different drives.

The second issue shows that mergeFonts does not recognize 'm_NOTDEF.map' as a mapping file. mergeFonts works on my system, so I suspect that the expected text is not present in the mapping file, that would cause it to be recognized as such. Did you follow the rules described in the output from 'mergefonts -h'?

@miguelsousa
Copy link
Member

@LIXiangChen I'm working on a fix to the makeotf problem. As for the mergefonts problem, you need to change mergeFonts to mergefonts in the mapping files, otherwise the tool will attempt to parse those files as if they were fonts.

@miguelsousa
Copy link
Member

All the tools' names were changed to all-lowercase in #511 (v2.8.0)

@LIXiangChen
Copy link
Author

@miguelsousa Yes, that's exactly mergefonts keyword case caused it. Thx.

miguelsousa added a commit that referenced this issue Sep 11, 2018
Return the original path when it can't be made relative because the paths are in different drives/mounts

Fixes #602
miguelsousa added a commit that referenced this issue Sep 11, 2018
Return the original path when it can't be made relative because the paths are in different drives/mounts

Fixes #602
@miguelsousa miguelsousa added this to To do in 3rd Sprint via automation Sep 11, 2018
@miguelsousa miguelsousa moved this from To do to Done in 3rd Sprint Sep 11, 2018
@miguelsousa miguelsousa self-assigned this Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
3rd Sprint
  
Done
Development

No branches or pull requests

3 participants