Tiny fonts on hi-res Mac screens

Hi,
is there a difference between Mac and Windows regarding the Font attribute usePointSize? For my GUIs I set it to true, which gives reasonable font sizes on hi-res Windows screens, but often tiny fonts on high-res Mac screens. On the Mac, some Qt control widgets get an OK font size (even a bit big); but my static texts come out very small, and usePointSize seems to have no effect. Or does the Mac have something similar to the Windows display scaling settings?
Thx

Could you post some example code and a screenshot or two? I’m not familiar with any high-dpi bugs on Mac (and in fact I would be much more suspicious of Windows, since the high-dpi support over there is an absolute nightmare).

After looking at the code, I’m a bit suspicious…

  1. On my mac, usePointSize makes no difference, which is almost surely incorrect based on the QT documentation.
  2. usePointSize:false is the default but SHOULD break everything on a high-dpi system. In fact, we should probably not even be exposing this parameter because the use-cases for this are very esoteric, and it’s probably just confusing. But basically: if this were actually doing what it sounds like it’s supposed to do, this would have been noticeable via bad bugs for years… ergo, it’s probably not working as we expect?

Really curious to see your code and screenshots though.

Thanks for your response; here is a link to three .png files:
The Mac one is made on a 2560x1440 screen, the Windows ones are on a 3000x2000 screen at 200% and 100% UI scalings. I have not changed the fonts of Button, TextField, NumberBox. The font for StaticText and grid labels is Font.new(\Arial, 8, usePointSize: true).
I’d like the fonts on Mac to size in the way they do on Windows, but I haven’t figured out how to do it. I have tried to copy a Font object from a Button and apply it to a StaticText, and that works, but it seems kind of clunky…
Best /S

What does this code render like on your system?

(
~pointFont = Font(size:12, usePointSize:true);
~pixelFont = Font(size:12, usePointSize:true);
View().layout_(VLayout(
	Button()
		.fixedSize_(200@30)
		.states_([["usePointSize:false"]])
		.font_(~pixelFont),
	Button()
		.fixedSize_(200@30)
		.states_([["usePointSize:true"]])
		.font_(~pointFont),
	StaticText()
		.fixedSize_(200@30)
		.string_("usePointSize:false")
		.font_(~pixelFont),
	StaticText()
		.fixedSize_(200@30)
		.string_("usePointSize:true")
		.font_(~pointFont),
	UserView()
		.fixedSize_(200@30)
		.drawFunc_({
			Pen.stringInRect("usePointSize:false", Rect(0, 0, 200, 30), ~pixelFont, Color.white)
		}),
	UserView()
		.fixedSize_(200@30)
		.drawFunc_({ 
			Pen.stringInRect("usePointSize:true", Rect(0, 0, 200, 30), ~pointFont, Color.white) 
		}),
)).front;
)

On mine (next to the sc ide for scaling comparison)…

Well, when I corrected the second line of your code snippet to “…false”), it looks like this:

test

Wow, so it looks like usePointSize is being used on Windows but is a no-op on Mac? It’s possible that the Win/Mac difference here is in SuperCollider itself, but I didn’t see any evidence of that. I would have expected this to be called out in the QT documentation - but in general Windows high-dpi support is an absolute labyrinth :frowning:, so it’s not totally surprising that there are exceptional cases here.

Is the screenshot you posted based on 1.5x or 1.25x scaling?

The very strange thing here is - the Windows screenshot you just posted is not high-dpi: it’s a 1.0x ratio (the buttons are 30px high). Which means, somehow either usePointSize:true is adding a scaling factor that is different than all of the rest of the UI, or everything in the UI except for fonts are not being scaled.

It was at 100% scaling. Here’s one at 200% scaling:

@sternsc which SC version are you using (particularly on macOS)?

SC 3.12.2 on macOS, 3.12.1 on Windows.

Hi again, this issue of usePointSize being a no-op on Mac but not on Windows is still a problem for me. Should I develop a workaround, e.g., by adding some method override to the Font class, or is anyone interested in fixing it in the proper place (which I am not competent enough to do)?

Just revisiting this - as far as I can tell, this is entirely QT’s behavior. There’s nothing that we can do on the SuperCollider side to change this behavior, apart from basically hacking around until we fix the cases that seem weird. As I look more, I think what QT is doing is actually correct and this is just a windows nightmare:

  • On mac, the default display DPI is 72. In font terms, 1 point = 1/72 inches, meaning at 72dpi is 1:1 with pixels. This means - on Mac - pixel and point size are equivalent on a normal display.
  • On windows, the default DPI is 96 - so, point size is not 1:1 with pixel size.

This would explain why these are basically the same on mac, but different on windows.

Your original issue was actually that, on Mac, StaticText controls had unusually small text - my suggestion would be to:

  • usePointSize=false (the default) - though it’s unlikely to make a difference either on Mac except maybe with a weird external monitor.
  • MacOS system font sizes are between 11-13 - if you’re setting font sizes in SuperCollider, anything with these sizes should roughly match standard OS-provided text. If not, this is quite weird and probably a bug.
  • SuperCollider UI should DEFINITELY not have different font sizes for different UI items if they have the same Font. If this is the case, it’s also likely some kind of bug.

If you’re still seeing issues, screenshots + code might help too?

(Ah, just a note - your original screenshots are offline. Also, you mention an 8px font size - this is almost unreadably small on my system, could this be an issue where the font size you’re providing is just too small on Mac, but weirdly LARGE on Windows because… Windows DPI stuff is totally weird in general?)