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

Default "modern" font on macOS doesn't include italics #521

Closed
achabotl opened this issue Jun 10, 2020 · 2 comments
Closed

Default "modern" font on macOS doesn't include italics #521

achabotl opened this issue Jun 10, 2020 · 2 comments

Comments

@achabotl
Copy link
Contributor

Problem Description

The default font "modern" on macOS is Lucida Grande, which does not include italics. It makes it feels like there's a bug in Chaco. (In fact there's a bug in Kiva (enthought/enable#404), but that's a separate issue).

xref: enthought/enable#406
Reproduction Steps:

from numpy import linspace, pi, sin, cos
from traits.api import HasTraits, Instance
from traitsui.api import View, UItem
from chaco.api import Plot, ArrayPlotData
from enable.api import ComponentEditor
from kiva.api import ITALIC


class PlotWithModifiedLegend(HasTraits):
    plot = Instance(Plot)

    def _plot_default(self):
        x_array = linspace(0.0, 2*pi)
        data = ArrayPlotData(x=x_array, sin=sin(x_array), cos=cos(x_array))
        plot = Plot(data)
        plot.plot(('x', 'sin'), color='blue', name='sine')
        plot.legend.font.style = ITALIC
        plot.legend.visible = True
        return plot

    traits_view = View(
        UItem('plot', editor=ComponentEditor()),
    )

plot_with_legend = PlotWithModifiedLegend()
plot_with_legend.configure_traits()

Expected behavior:

The default "modern" font should have at least regular, italic, bold, and bold italic styles.

The legend should be in italic.

OS, Python version:

  • Python 3.6.9 -- Enthought, Inc. (x86_64)
  • macOS 10.15.5
@achabotl achabotl changed the title Default "modern" on macOS doesn't include italics Default "modern" font on macOS doesn't include italics Jun 10, 2020
@corranwebster
Copy link
Contributor

corranwebster commented Jun 11, 2020

Getting Lucida Grande as the default "modern" font feels like a double failure: on wxPython (where the name would have come from) "modern" is supposed to give a monospaced sans-serif font like Andale Mono, Consolas or Monaco (as opposed to "typewriter" which gives a monospaced serif font like Courier). That's implying that whatever default for "modern" is is not commonly available on OS X.

Lucida Grande was the system font on OS X <= 10.9, which was probably why it chosen. The default system font on OS X is now Helvetica Neue, which does have bold and italic options.

@jwiggins
Copy link
Member

Fixed in Enable via enthought/enable#698

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

3 participants