kostub / iosMath

Beautiful math equation rendering on iOS and MacOS
MIT License
1.36k stars 234 forks source link

math_table_to_plist.py - Issue generating plist for STIX Two Math font #115

Open jsh8w opened 5 years ago

jsh8w commented 5 years ago

Hello,

I'm trying to generate the .plist file for the STIX Two Math font I am using in my app. The error I am getting is:

$ python math_table_to_plist.py STIX2Math.otf STIX2Math.plist
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 18, in process_font
    accents = get_accent_attachments(math_table)
  File "math_table_to_plist.py", line 136, in get_accent_attachments
    raise "Don't know how to process device table for accent attachment."
TypeError: exceptions must be old-style classes or derived from BaseException, not str

If I remove the get_accent_attachments(math_table) call, the plist is generated correctly. However, when using MTMathUILabel's in my app, recurring decimal dots (i.e \dot) are not correctly positioned. They are left of the number they should be directly above. I presume this is due to the accent information not being included in the plist.

Any help would be appreciated.

Many thanks, James.

cupojoe commented 5 years ago

@jsh8w I had the same issue and commented out the throw statments and added a pass there and it actually worked, built the plist just fine.