Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

`wx.Font` font weights are ignored on OS X 10.10 and 10.11

Open Jazzzny opened this issue 2 years ago • 1 comments

Operating system: OS X 10.11, OS X 10.10 wxPython version & source: 4.2.1 (PyPi) Python version & source: 3.10.11 Official

Description of the problem: On OS X 10.10 and 10.11, all fonts are rendered with the regular font weight no matter what they are set to. However, calling .GetNumericWeight() returns the correct value. This does not affect 10.12 and newer.

Code Example (click to expand)
import wx

class Frame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, size=(400, 200))
        panel = wx.Panel(self)
        title = wx.StaticText(panel, label="Title", pos=(50, 50))
        title.SetFont(wx.Font(40, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))

        subtitle = wx.StaticText(panel, label="Subtitle", pos=(50, 90))
        subtitle.SetFont(wx.Font(40, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))

        self.Show()

if __name__ == '__main__':
    app = wx.App()
    frame = Frame(None)
    app.MainLoop()

10.10 Yosemite : Screen_Shot_2023-09-09_at_7 50 15_PM

10.11 El Capitan: Screen_Shot_2023-09-09_at_7 39 02_PM

10.12 Sierra: Screen_Shot_2023-09-09_at_7 59 42_PM

13 Ventura: Screenshot 2023-09-09 at 7 39 19 PM

Jazzzny avatar Sep 10 '23 00:09 Jazzzny

Hi, this is probably not something that's wxPython specific (unless it is somehow compile option related). If it is important to you, you may want to try reproducing it in wxWidgets (C++) and filing an issue upstream.

swt2c avatar Sep 12 '23 19:09 swt2c