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

[Bug]: \Cap and \Cup in mathtext are inconsistent #20809

Open
tfpf opened this issue Aug 8, 2021 · 1 comment · May be fixed by #20818
Open

[Bug]: \Cap and \Cup in mathtext are inconsistent #20809

tfpf opened this issue Aug 8, 2021 · 1 comment · May be fixed by #20818

Comments

@tfpf
Copy link

@tfpf tfpf commented Aug 8, 2021

Bug summary

\Cap and \Cup are rendered correctly when only when using Dejavu Sans, not the other fonts.

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt

for font in ['dejavusans', 'dejavuserif', 'cm', 'stix', 'stixsans']:
    mpl.rcParams['mathtext.fontset'] = font
    plt.axes().text(0.5, 0.5, r'$\Cap\cap\Cup\cup$' + font)
    plt.show()

Actual outcome

image
Dejavu Sans looks right.

image
image
image
image
Dejavu Serif, Computer Modern, STIX and STIX Sans have got it wrong.

Expected outcome

Dejavu Serif, Computer Modern, STIX and STIX Sans should render \Cup and \Cap the same way Dejavu Sans does.

Operating system

Windows 10

Matplotlib Version

3.2.2

Matplotlib Backend

module://ipykernel.pylab.backend_inline (Google Colaboratory)

Python version

3.7.11

Jupyter version

5.2.2

Other libraries

No response

Installation

No response

Conda channel

No response

@QuLogic QuLogic changed the title [Bug]: \Cap and \Cap in mathtext are inconsistent [Bug]: \Cap and \Cup in mathtext are inconsistent Aug 9, 2021
@QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 10, 2021

DejaVu Sans has these glyphs, but DejaVu Serif does not, and apparently none of the CM fonts do either. So it falls back to STIX, and those fonts are buggy, as they have those glyphs swapped. The fonts tables for STIX 2 appear correct, so they've probably fixed it, but upgrading that is a major endeavour.

@QuLogic QuLogic linked a pull request that will close this issue Aug 10, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants