I use my own macOS declare classes for extended features of a macOS only desktop project. To make listboxes containing currency values look a bit nicer, I use the CellTextPaint event with
g.FontName = app.PropDigitFont.FontName
returning false. PropDigitFontName is an NSFont that I created with NSFont.monospacedDigitSystemFontOfSize:weight:(0.0, 0.0)
.
Sadly, numbers are not unproportional. The normal system font is used, which aligns with the NSFont reporting as “.SFNS-Regular 13.00 pt. P [] (0x7fd03086a230) fobj=0x7fd03086a230, spc=3.58” in its debug property, while its monospaced property is True(!)
Much unlike a NSFont created with
NSFont.monospacedSystemFontOfSize:weight:(0.0, 0.0)
which makes the text look less readable and is therefore not my weapon of choice.
Sure, I could branch in CellTextPaint event and only use the latter font where necessary. I’d still prefer to use the first font.
Anyone else having more success? System is Monterey 12.5 on an Intel iMac.
Edit: @Christian_Schmitz : NSFontMBS is missing the mentioned constructor currently, right? UserFixedPitchFontOfSize(0.0) looks exactly like my mentioned second attempt.