Fractional font sizes can't be input using the "Preferences" dialog

• Dec 1, 2020 - 19:47
Reported version
Ergonomical (UX)
S5 - Suggestion

I opened the "Preferences" dialog, focused on the "Font Size" spinner in the "General" tab, and attempted to type in "9.5". The spinner transformed the input into "95" instead.

Because font size influences the size and readability of the entire UI, giving the user fine control over the font size would be beneficial. The layout difference between, say, a 9pt and 10pt font is significant.


In which other application can you have fractional dots? I just checked Microsoft Office: only integral values allowed there for font sizes

Points aren't pixels. A point is 1.333... pixels.

Points seem to be multiplied by the UI scale before being rendered by Qt, so a supposed font size of 9pt, with a 1.5x UI scale, might be transformed into an actual font size of 13.5pt.

Most text renderers will draw a 13.5pt font differently to a 13.0pt one. The glyphs might be rasterized differently, and they will almost always be spaced differently. Qt advertises platform-dependent support for this feature (see QFont::setPointSizeF).

MuseScore also appears to layout some of its UI with dimensions proportional to the current font size. For example, I suspect that the "Font Size" spinner in the "Preferences" dialog would have different dimensions for a 9pt, 9.5pt and 10pt system font, at least on a high-dpi display.

Fractional font sizes are supported by many programs, but not all. A few examples on my PC: LibreOffice, MS Paint, the Web, the Adobe software suite.

Severity S4 - Minor S5 - Suggestion

A point (on a printer) can't split, a pixel, via anti-aliasing, can though...

Anyway, not a bug, rather a feature request (AKA Sugestion)

and I cite from that: In typography, the point is the smallest unit of measure so indeed there is no half-point
And typography is about printers

Jojo: It would take thirty seconds to demonstrate this to yourself using MS Paint and the Segoe UI font.

If somebody comes across this thread who's more familiar with digital typography, I'd be happy to chat about this. I think the main open question is how QFont::setPointSizeF works on different platforms in practice. Not sure whether it's important enough to need thorough testing, but I can volunteer my Windows 10 system to test any patches, if necessary. Looking at Theme::initFont and UiConfiguration::fontSize, I suspect this would be an easy fix.

I'm not saying that supporting this would be impossible (it certainly is not) or difficult (no idea). Just unusual.

Your Pull Request for this is welcome ;-)

In reply to by hiddenhare

@Jojo, your conclusion that "there is no half point" does not follow from the point being the smallest unit of measure. In the imperial length measurement system the smallest unit of measure is the inch, but we certainly have half-inches.

Try typing "9.5" into the font size box in word and see if you don't get what I do.


"9.5" doesn't work for me. Not at all.
But indeed "9,5" does ;-), so I stand corrected: MS Office (and Paint) indeed seem to support that

Fix version