NanoMichael / MicroTeX

A dynamic, cross-platform, and embeddable LaTeX rendering library
MIT License
418 stars 69 forks source link

convert otf file to clm file fail #97

Open PikachuHy opened 2 years ago

PikachuHy commented 2 years ago

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

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.

NanoMichael commented 2 years ago

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.