xaml-math icon indicating copy to clipboard operation
xaml-math copied to clipboard

Regenerate `DefaultTexFont.xml`, update fonts

Open ForNeVeR opened this issue 7 years ago • 7 comments
trafficstars

While working on #70, I found that our TTF files seem to not correspond to our font metrics. I think that we should get both TTF and TFM files from some consistent source and regenerate the DefaultTexFont.xml data.

Don't forget to publish all the scripts and clarify the documentation.

ForNeVeR avatar Jan 27 '18 10:01 ForNeVeR

Yep, or just extract the data on the fly. It would probably be just (almost) as quick. I remember considering doing this years ago...

alexreg avatar Jan 27 '18 15:01 alexreg

Yes, I'm thinking about on-the-fly extraction. Although I'm not sure if all the data we need is available in the TTF files (as far as I can see, it isn't). Need to experiment more.

ForNeVeR avatar Jan 27 '18 15:01 ForNeVeR

Hmm. Could do on-the-fly extraction as much as possible, and then fill in the remaining data from a (much smaller) XML/JSON file? But yeah, have a closer look first. Maybe it's all there.

alexreg avatar Jan 27 '18 15:01 alexreg

I think it's possible that our TTF files aren't the right one. Need to compare them with the latest officially published versions: maybe those include the kerning information.

ForNeVeR avatar Jan 28 '18 05:01 ForNeVeR

Yep. I would normally expect them to include kerning information, so worth a check...

alexreg avatar Jan 28 '18 16:01 alexreg

They certainly aren't, because the font tables were manipulated. All alphabets seem to be in the same start range even though mathcal is not in Unicode. All alphabets should have a symbol mapping just like "sqrt" does then the convert character applies the text style prefix to the character(eg: 4 in mathrm is mupfour and Gamma in mathit is mitGamma). The kerning data is a lot harder to get through don't forget but they are only a few, and we could study it and get it. Currently I'm working on Asana Math font and the glyphs look so thick you might think you are in boldmath. Thus the blurry fonts are as a result of the fonts not the program. As at now the codebase is so glued to the default fonts, same as the other data and I've been working on opening it.

B3zaleel avatar Sep 01 '18 07:09 B3zaleel

We should take a look at the https://github.com/himamis/ReTeX project. It looks like its auhors have replaced the original format with something less complicated. The metrics inside <FontDescriptions> look autogenerated.

ForNeVeR avatar Dec 29 '19 11:12 ForNeVeR