iosMath icon indicating copy to clipboard operation
iosMath copied to clipboard

Error using fonts

Open adilsal33m opened this issue 6 years ago • 2 comments

I am not able to use any other font apart from the three fonts supplied with the library. I have added the font correctly along with the plist. Are we suppose to put the font in a specific bundle because the error is due to not being able to locate font in the bundle in MTFont's initFontWithName method.

Any help will be appreciated. Thanks.

adilsal33m avatar Jul 10 '18 12:07 adilsal33m

@adilsal33m Hey, I'm tying to add a font myself. How did you generate the plist? I keep getting errors.

I tried to generate the plist first with the included font file (just for testing purposes) latinmodern-math.otf. I did the following steps:

  • First convert to ttx using ttx latinmodern-math.otf in the terminal from the Python fonttools library.
  • I then run the script included in the repo to try and generate a plist python math_table_to_plist.py latinmodern-math.ttx latinmodern-math.plist

However when I run the script I get the following error:

Traceback (most recent call last):
  File "math_table_to_plist.py", line 203, in <module>
    main()
  File "math_table_to_plist.py", line 200, in main
    process_font(font_file, plist_file)
  File "math_table_to_plist.py", line 11, in process_font
    font = TTFont(font_file)
  File "/Users/kekearif/Desktop/font/lib/python2.7/site-packages/fontTools/ttLib/ttFont.py", line 140, in __init__
    self.reader = SFNTReader(file, checkChecksums, fontNumber=fontNumber)
  File "/Users/kekearif/Desktop/font/lib/python2.7/site-packages/fontTools/ttLib/sfnt.py", line 81, in __init__
    raise TTLibError("Not a TrueType or OpenType font (bad sfntVersion)")
fontTools.ttLib.TTLibError: Not a TrueType or OpenType font (bad sfntVersion)

Any idea what I am doing wrong where and why I am getting this error?

kekearif avatar Jan 14 '19 08:01 kekearif

@adilsal33m I got a custom font to work, but not how the readme says. I had to go into the font manager and add it there as the default. Also in the Typesetter they are hardcode referencing latin modern. Had to change it there to use the default instead.

cupojoe avatar Aug 19 '19 22:08 cupojoe