MicroTeX icon indicating copy to clipboard operation
MicroTeX copied to clipboard

convert otf file to clm file fail

Open PikachuHy opened this issue 4 years ago • 1 comments

error info

fontforge -lang=py -script otf2clm.py --sinle ../res/xits/XITSMath-Regular.otf true ../res/xits/XITSMath-Regular.clm2
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20190801
 Based on sources from 03:10 UTC  6-Mar-2020-ML-D-GDK3.
parsing font ../res/xits/XITSMath-Regular.otf, please wait...
Traceback (most recent call last):
  File "otf2clm.py", line 719, in <module>
    main()
  File "otf2clm.py", line 710, in main
    parse_otf(
  File "otf2clm.py", line 625, in parse_otf
    glyphs.append(read_glyph(
  File "otf2clm.py", line 312, in read_glyph
    None if not parse_path else read_glyph_path(glyph),
  File "otf2clm.py", line 252, in read_glyph_path
    glyph.export(tf.name, usetransform=True)
TypeError: export() takes no keyword arguments

https://github.com/NanoMichael/cLaTeXMath/blob/a0493830bffccc30c4567b474319684ec9747166/prebuilt/otf2clm.py#L252

my env

  • WSL. Ubuntu 20.04.2 LTS (GNU/Linux 5.4.72-microsoft-standard-WSL2 x86_64)
  • fontforge
fontforge --version
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20190801
 Based on sources from 03:10 UTC  6-Mar-2020-ML-D-GDK3.
fontforge 20190801
build date: 03:10 UTC  6-Mar-2020
  • python
python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

tmp solution change glyph.export(tf.name, usetransform=True) to glyph.export(tf.name)

note: I don't have a deep understanding of the cause of this problem, and I'm not aware of the side effects of the tmp solution.

PikachuHy avatar Jan 28 '22 14:01 PikachuHy

That's because the version of fontforge is too low, thus the function glyph.export has no second argument. And my fontforge has the version 20200314. We need a version check before using it, will fix it later.

NanoMichael avatar Feb 14 '22 15:02 NanoMichael