question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Something wrong with italic fonts?

See original GitHub issue

Description

I was trying to display mathematical texts (specifically alpha) with the matplotlib-supplied fonts but I couldn’t do it by setting pplt.rc['font.family'] = 'DejaVu Sans' and pplt.rc['mathtext.default'] = 'it'. Am I missing something here?

Aside from this behavior, personally, the default greek letters in proplot are not so pleasing. 'Fira Math' looks better but it isn’t so pleasing when the italic font is used (as shown below). Can we improve this?

Steps to reproduce

When italic font is selected, all alpha look the same. Is this the expected behavior?

import proplot as pplt
pplt.rc['mathtext.default'] = 'it'
fig, axs = pplt.show_fonts()

pplt_font_it

The above italic font in 'DejaVu Sans' looks different from the one in matplotlib.

import matplotlib.pyplot as plt
plt.rcParams['font.size'] = 18

fig, ax = plt.subplots()

ax.text(.2, .9, 'regular')
ax.text(.6, .9, 'italic')

ax.text(.3, .7, r'$\mathrm{\alpha}$')
ax.text(.7, .7, r'$\alpha$')

plt_font

Proplot version

3.4.3 0.9.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
lukelbdcommented, Jan 14, 2022

And I finally remembered what I was thinking when I implemented this behavior: The idea was that the math text and string text should always be the same font, or else it could look “ugly”. So, users would be expected to change the plot-wide font to something more suitable for math if need-be, e.g. with pplt.rc['font.name'] = 'Fira Math'.

However, as you’ve shown, this is kind of frustrating / unexpected – the “aesthetic” benefits of forcing everyone to use the same font set for math and non-math text are outweighed by the practical issue that new proplot users are getting ugly math equations out-of-the-box. So, I will indeed remove this behavior.

0reactions
lukelbdcommented, Jan 20, 2022

#323 sets rc['mathtext.default'] = 'it' and uses the currently active font for math text by default rather than the global sans-serif font (meaning rc['font.name] = 'font' will also update the math text).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Easily Fix Google Chrome Italic Font Issue - YouTube
Are you facing the Google Chrome italic font issue? Are you annoyed by the Italic font style rendering of the text in Google...
Read more >
Italic font problem - Microsoft Community
1. In search-box of Windows toolbar, type: Control Panel and open it. 2. Click in Programs > Uninstall a program, find Microsoft Office...
Read more >
[Fix] Bold and Italic Font Problem in Windows - AskVG
Right-click on Desktop and select Personalize option. · Now apply default Windows theme. · Type fonts in RUN or start menu search box...
Read more >
Why are italic fonts sometimes used in a plain text? - Quora
Most apps refrain from use of an italic font, because italic fonts sometimes render horribly on smaller displays. Unless you're using the default...
Read more >
The case against banning italics - accessible digital documents
One of the study's conclusions was that, for people with dyslexia, “italic fonts decreased reading performance”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found