Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using New Computer Modern fonts #173

Open
kpeeters opened this issue May 14, 2024 · 7 comments
Open

Using New Computer Modern fonts #173

kpeeters opened this issue May 14, 2024 · 7 comments

Comments

@kpeeters
Copy link

I am trying to use the New Computer Modern fonts (https://www.ctan.org/pkg/newcomputermodern) with the openmath branch, as I would like to have a set of fonts that includes AMS symbols (among others). Unfortunately, after converting with otf2clm, microtex does not recognise any of these to be a math font. Is there something I should do with otf2clm in order to make it flag its output as math font?

Alternatively, is there some ready-to-run clm font set somewhere that includes all of Computer Modern and the AMS fonts?

@sp1ritCS
Copy link
Contributor

Is there something I should do with otf2clm in order to make it flag its output as math font?

No, the otf2clm script uses the python api from fontforge that provides whether a font is a math font or not.

is there some ready-to-run clm font set somewhere that includes all of Computer Modern and the AMS fonts?

What is missing in Latin Modern?

@kpeeters
Copy link
Author

Hmm, this may be a different issue. I tried typesetting (with the microtex-qt-example) \square, and that produces a red question mark along with a complaint that There's no glyph was found with (unicode = 9723, id = -1), use '?' instead.. However, if I typeset \square\square I get two squares. So the character is there indeed, probably a bug in microtex.

@sp1ritCS
Copy link
Contributor

sp1ritCS commented May 15, 2024

Hmm, I can reproduce this with Latin Modern (and the two other math fonts) but not with XITS...

https://nanomichael.github.io/MicroTeX/?tex=\square\square\\\square

@kpeeters
Copy link
Author

Interesting. A workaround that will do the job for me for the time being is to use \square~ or if necessary \square~\!. But someone with more knowledge about how this works internally might want to have a look at it. Various other symbols have the same problem.

@sp1ritCS
Copy link
Contributor

I did some digging and it appears that the symbol inserted by \square is U+25FB (WHITE MEDIUM SQUARE), which is available in XITS but not in the other fonts.
image

if you check the the svg code generated by the demo, you'll see that the \square\square from XITS is produced as a PATH, where as it is a

<text [...]>◻◻</text>

element when using Latin Modern. I think this means it'll use the system font provider (for cairo [and prob. qt too] that'll be fontconfig, which will fall back to whatever font that has that glyph available), but I'll assume that fallback mechanism doesn't work correctly if there is just a single glyph in the line.

@kpeeters
Copy link
Author

Ok. In that case my original question still stands: is there anyone with a microtex-compatible OTF font that includes all of the Computer Modern Math and AMS Math fonts? Or a way to obtain those from the New Computer Modern set using otf2clm?

@sp1ritCS
Copy link
Contributor

No. You could either investigate why fontforge is not detecting your font as math font or maybe look into merging the missing symbols into Latin Modern Math and generate the clm file for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants