TOF : Is NSFont.monospaced DigitSystemFontOfSizeweight broken on Monterey?

let x = NSFont.monospacedDigitSystemFont(ofSize: 24, weight: .regular)

is still 100% valid in Monterey

@ubogun see daves reply

Its not that the API doesn’t work, its that the typeface doesn’t work like it did back in 10.11.

In that it’s identical, except numbers are of the same width. Text now looks odd, spacing is weird, basically unprofessional, yes the numbers or monospaced, but it’s best not to use it for anything other than numbers.

Of course… .since the name is in fact

monospaced Digit System Font

otherwise use

let x = NSFont.monospacedSystemFont(ofSize: , weight: )

Or better yet… use MENLO

You appear to misunderstand the usefulness and history of this API.

You could set tables or other UI elements to use this typeface and the numbers would line up, while text was consistent with everything else, like t’was.

But hey, it’s just another broken thing in Apple’s frameworks, maybe Apple shouldn’t have done their API 2.0 either :slight_smile:

1 Like

Well I think this looks just fine … not sure what about it you don’t like

Label1.text = "Abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Label1.theFONT = NSFont.monospacedSystemFont(ofSize: 32, weight: .regular)
Label2.text = Label1.text
Label2.theFONT = NSFont.monospacedDigitSystemFont(ofSize: 32, weight: .regular)

I am happy for you.

Perhaps it didn’t come across… but I really want to know how you justify

 Text now looks odd, spacing is weird, basically unprofessional

and why you seem to have a bug up your… lately
in the past you posting had been more polite… even when you mentioned something that wasn’t right…

What OS version are you using, Dave? And on an Intel or ARM Mac?
I’d be glad to get the second result. Sadly, no on my system (this is monoSpacedDigit…):

Which is different to what I experienced.
For me, the numbers were correctly aligned, but any text was clearly not using the same typeface as other controls.
I ended up making the table use the systemFont for cells that contained text, and use the monoSpaceDigits for the cells that contained numbers (as they still looked consistent).

You mean like this?

(1st column: system font, other columns: monoSpaced (not monoSpacedDigits).
I remember having seen that prettier on former macOS versions.

Back then I was able to still use monospacedDigits so at least the numbers used the same looking typeface, they just lined up how they used to before 10.11 or 10.12.

But as your numbers don’t line up anymore when using that API… Sigh.

Monterey 12.5 on a MacStudio…
Give me a chunk of code if you can (I assume you are using Xojo, my example was Swift, which SHOULD not make a difference)