should fix #5897
[Qt] fix rpc console font size to flexible metrics #5898
pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2015/03/qt_fix_font_size changing 1 files +0 −1-
jonasschnelli commented at 11:44 AM on March 14, 2015: contributor
-
jonasschnelli commented at 11:45 AM on March 14, 2015: contributor
Font is no slightly bigger on my mac. But totally okay.
After:

Before:

-
microcai commented at 11:51 AM on March 14, 2015: none
works for me.
-
microcai commented at 12:10 PM on March 14, 2015: none
Linux/X11 KDE environment: DPI = 192
screenshot before this patch applied

screenshot with this patch applied

-
jonasschnelli commented at 12:14 PM on March 14, 2015: contributor
@microcai hmm... looks good but i don't have a idea why your font size of the time-cell has also changed.
-
microcai commented at 12:44 PM on March 14, 2015: none
@jonasschnelli I tried to use standard zoom method Ctrl+Key_PLUS
-
luke-jr commented at 2:22 PM on March 14, 2015: member
What does font-size:1em do differently than omitting the attribute?
-
Diapolo commented at 4:38 PM on March 14, 2015: none
Can you check if we use hard-coded px sizes in other places? Perhaps it's time to replace them?
-
jonasschnelli commented at 7:01 PM on March 14, 2015: contributor
@luke-jr: Good question. 1em as font-size should be the default if there is no style-changing elsewhere. Will check this soon. @Diapolo: The question is how Qt deals with HiDPI. On OSX 12px font size will result in 24px on screen in HiDPI (as expected). On linux we just saw that it will stay on 12px. There (fonts) em metrics makes sense. For other hard-coded px values (widgets size, offsets) it could end up value-doubles on HiDPI depending of Qt's handling. So yes for changing all font-sizes to em, no for px widget sizes and offsets.
-
microcai commented at 1:22 AM on March 15, 2015: none
to make things clear, zoom in pixel level is only supported in osx platform. both Linux and windows version of Qt just uses DPI. so 12px font stay in 12px font even under windows.
-
luke-jr commented at 1:52 AM on March 15, 2015: member
I would expect Qt to default to the user font size preference.
- jonasschnelli force-pushed on Mar 15, 2015
-
jonasschnelli commented at 12:43 PM on March 15, 2015: contributor
-
microcai commented at 3:09 PM on March 15, 2015: none
@jonasschnelli I alread did.
-
jonasschnelli commented at 3:14 PM on March 15, 2015: contributor
@microcai hows the result? without
1emsame as with? thanks. -
microcai commented at 3:26 PM on March 15, 2015: none
@jonasschnelli just see the screenshot. there is barely visible difference with "1em" or without "1em"
-
microcai commented at 3:45 PM on March 15, 2015: none
@jonasschnelli 1em seems to be the default font size. so I can't really tell the difference either 1em or omit it altogether.
- sipa added the label GUI on Mar 16, 2015
-
laanwj commented at 4:07 PM on March 16, 2015: member
Looks good to me, although I wonder why we ever added a fixed font size (in pixels!), that must have been a workaround for something.
-
laanwj commented at 7:08 AM on March 18, 2015: member
OK, so I added it myself when I introduced this code. I don't remember why.
-
laanwj commented at 7:19 AM on March 18, 2015: member
Trying it out jogged my memory. Without font-size, and with font-size:1em it looks like:

The default monospace font size on Ubuntu is huge.
-
luke-jr commented at 1:12 PM on March 18, 2015: member
Meh, that's not too huge. If the terminal looks the same, I'd say it's expected. Surely Ubuntu lets users configure their defaults?
-
jonasschnelli commented at 2:39 PM on March 18, 2015: contributor
@laanwj It seems like that
font-size: <n>em;does not have any effect. Or at least with values <1em. I tried 0.8 and 0.1em. Looks exact the same as with 1em. I also tried10pt. Looks also good but generate font-size difference between ubuntu/linux and osx.I created a HiDPI ubuntu VM and did take a closer look at bitcoin-qt HiDPI unter linux. There are many issues (icon sizes, splash-screen, overview screen, etc., etc,)
This PR goes into the right direction (removing fix
pxvalues) but will not solve the whole HiDPI issue. -
microcai commented at 3:23 AM on March 19, 2015: none
@jonasschnelli what about using 12pt ?
-
jonasschnelli commented at 7:39 AM on March 19, 2015: contributor
@microcai using 12pt would enlarge the font-size on linux as well as on osx. 10pt would make sense but even there the font-size is about ~10-20% larger. IMO we should just remove the font-size as it is in this PR.
-
luke-jr commented at 3:13 PM on March 19, 2015: member
I want to compare it with the terminal program. Whenever possible, we should use an OS/user-defined look and feel, not try to second-guess it.
-
laanwj commented at 8:30 PM on March 19, 2015: member
The terminal, at least on Ubuntu, uses a less ugly font and also more reasonably sized than whatever Qt chooses with 'monospace'. It's not realistic to expect it to pick the same font as the OS's terminal.
We have to make our own font decision here. There, picking using the default (non-monospace) font seems safest.
-
jonasschnelli commented at 8:43 PM on March 19, 2015: contributor
non-monospace would look like this (see below). I don't have a strong position here. There is not much of a difference between monospace and standard font in terms of usability of the rpc console.

-
laanwj commented at 4:46 PM on March 24, 2015: member
Looks good to me. We don't (as far as I see) use the fixed width property anywhere for formatting, so a proportional font does just as well and may even be more readable.
-
c8168331a2
[Qt] fix rpc console font size to flexible metrics
should fix #5897
- jonasschnelli force-pushed on Mar 27, 2015
-
jonasschnelli commented at 8:21 AM on March 30, 2015: contributor
Removed the "monospace" font style. IMO safest solution.
- laanwj merged this on Mar 30, 2015
- laanwj closed this on Mar 30, 2015
- laanwj referenced this in commit bb56781d61 on Mar 30, 2015
- MarcoFalke locked this on Sep 8, 2021