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

Try to use the default font from mpl #4025

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

vallsv
Copy link
Contributor

@vallsv vallsv commented Dec 20, 2023

Closes #4018

The DejaVu font is packaged together with matplotlib. Better to take advantage of that font than expecting the user environment to provides font with every expected characters.

The opengl backend use a qfont and then try to get back a matplotlib font for the axes. This was not properly working.
So i have more or less forced a sans-serif font. That anyway the default for us, for readability.

Changelog:

  • Use matplotlib font for OpenGL backend

@vallsv
Copy link
Contributor Author

vallsv commented Dec 20, 2023

Notice that the axes labels use the rasterMathText which is already a mpl backend, which is maybe way there is still a problem.

@vallsv
Copy link
Contributor Author

vallsv commented Dec 20, 2023

Also the code import rasterMathText as optional, but this API is now mandatory

@vallsv vallsv force-pushed the use-mpl-font-for-opengl branch from 00e276e to 3d76062 Compare December 20, 2023 10:35
@vallsv
Copy link
Contributor Author

vallsv commented Dec 20, 2023

The real fix the prepend of the sans-serif in the QFont->mpl font

@vallsv vallsv requested a review from t20100 December 20, 2023 10:44
@vallsv vallsv changed the title Draft: Try to use the default font from mpl Try to use the default font from mpl Dec 20, 2023
@vallsv vallsv added this to the 2.0.0 milestone Dec 20, 2023
Copy link
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In the mid-term we should think of how to make both backends more compatible: It's probably worth upgrading this and handle all those kind of defaults once for both backends.

@t20100 t20100 merged commit 7b850f4 into silx-kit:main Dec 21, 2023
6 of 7 checks passed
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

Successfully merging this pull request may close these issues.

opengl: No minus sign in the axes
2 participants