iosMath
iosMath copied to clipboard
Error using fonts
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 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
usingttx latinmodern-math.otf
in the terminal from thePython
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?
@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.