Skip to content

Add Latin Modern support for mathtext #26240

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

devRD
Copy link
Contributor

@devRD devRD commented Jul 3, 2023

PR summary

Adds Latin modern fontset for mathtext

PR checklist

@devRD devRD changed the title [WIP] Add Latin Modern support for mathtext Add Latin Modern support for mathtext Jul 24, 2023
@devRD
Copy link
Contributor Author

devRD commented Jul 24, 2023

So far, the PR supports the rm, bf, it, bfit, tt, sf font classes. From what I have found so far, we also have a Latin Modern Math that covers all the glyphs for the math font. However, LM Math does not contain bold, or italics, so we end up with something like this, where the lowercase Greek mappings are fetched from the latinmodermath font because the regular lm fonts do not contain those glyphs.:
lmfont

In LaTeX, I believe that there is a small set of bold glyphs supported so Fake Bold is being utilized(?). https://tex.stackexchange.com/questions/639337/latin-modern-math-doesnt-have-a-bold-font-but-does-have-glyphs-for-unicode-blo

https://ctan.math.washington.edu/tex-archive/fonts/ps-type1/lm/doc/fonts/lm/lm-info.pdf

Also, the Latin Modern Math doc metions something about cal and frak font names to be excerpted by other packages. https://www.gust.org.pl/projects/e-foundry/lm-math/download/readme-latin-modern-math.txt/view

Not sure how to proceed further, so opening the PR up for discussion.

@devRD devRD marked this pull request as ready for review July 24, 2023 11:38
@oscargus
Copy link
Member

Sorry, I have missed this completely. I cannot really provide any relevant feedback though, except that it is probably better to support what can be supported and possibly extend it later. (Just state any current limitations in the what's new note.)

Wouldn't it make sense to add an otf-directory rather than putting the otf-files in the ttf-directory? Not sure it anything else must be adjusted though. I'll enable the wheel-building tests as well so one can download one of those wheels and see that everything is indeed included as expected.

@oscargus oscargus added the CI: Run cibuildwheel Run wheel building tests on a PR label Aug 31, 2023
@oscargus
Copy link
Member

Any idea why some of the tests are failing?

@devRD
Copy link
Contributor Author

devRD commented Aug 31, 2023

The last change was updated quite some time ago. Not sure if there was a CI issue at the time. I'll just close and reopen to check.

@devRD devRD closed this Aug 31, 2023
@devRD devRD reopened this Aug 31, 2023
@devRD
Copy link
Contributor Author

devRD commented Aug 31, 2023

Looks like it is fetching Latin Modern font from a different directory than the font directory in matplotlib...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Run cibuildwheel Run wheel building tests on a PR topic: text/mathtext
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants