[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
  1. jonasschnelli commented at 11:44 AM on March 14, 2015: contributor

    should fix #5897

  2. jonasschnelli commented at 11:45 AM on March 14, 2015: contributor

    Font is no slightly bigger on my mac. But totally okay.

    After: bildschirmfoto 2015-03-14 um 12 39 03

    Before: bildschirmfoto 2015-03-14 um 12 41 55

  3. microcai commented at 11:51 AM on March 14, 2015: none

    works for me.

  4. microcai commented at 12:10 PM on March 14, 2015: none

    Linux/X11 KDE environment: DPI = 192

    screenshot before this patch applied

    screenshot_bitcoin

    screenshot with this patch applied screenshot_bitcoin2

  5. 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.

  6. microcai commented at 12:44 PM on March 14, 2015: none

    @jonasschnelli I tried to use standard zoom method Ctrl+Key_PLUS

  7. luke-jr commented at 2:22 PM on March 14, 2015: member

    What does font-size:1em do differently than omitting the attribute?

  8. 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?

  9. 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.

  10. 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.

  11. luke-jr commented at 1:52 AM on March 15, 2015: member

    I would expect Qt to default to the user font size preference.

  12. jonasschnelli force-pushed on Mar 15, 2015
  13. jonasschnelli commented at 12:43 PM on March 15, 2015: contributor

    as @luke-jr proposed i just removed the font-size: 1em setting. This should result in the same behavior maybe it also detects some way of using the standard os font-sizes. @microcai could you test again?

  14. microcai commented at 3:09 PM on March 15, 2015: none

    @jonasschnelli I alread did.

  15. jonasschnelli commented at 3:14 PM on March 15, 2015: contributor

    @microcai hows the result? without 1em same as with? thanks.

  16. 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"

  17. 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.

  18. sipa added the label GUI on Mar 16, 2015
  19. 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.

  20. fanquake commented at 12:36 AM on March 17, 2015: member

    @laanwj Looks like it was introduced here c6aa86afc2fe8995bcb1036c9879f85ef335e295, nearly 3 years ago.

  21. 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.

  22. 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: untitled

    The default monospace font size on Ubuntu is huge.

  23. 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?

  24. 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 tried 10pt. 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 px values) but will not solve the whole HiDPI issue.

  25. microcai commented at 3:23 AM on March 19, 2015: none

    @jonasschnelli what about using 12pt ?

  26. 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.

  27. laanwj commented at 11:00 AM on March 19, 2015: member

    I really don't like the default font size on Linux. @luke-jr If you compare it with the normal, non-monospace font as used for the time and the tab titles it IS huge.

    Thinking of that, maybe we should remove the monospace? Looks good here.

  28. 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.

  29. 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.

  30. 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.

    bildschirmfoto 2015-03-19 um 21 40 09

  31. 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.

  32. [Qt] fix rpc console font size to flexible metrics
    should fix #5897
    c8168331a2
  33. jonasschnelli force-pushed on Mar 27, 2015
  34. jonasschnelli commented at 8:21 AM on March 30, 2015: contributor

    Removed the "monospace" font style. IMO safest solution.

  35. laanwj merged this on Mar 30, 2015
  36. laanwj closed this on Mar 30, 2015

  37. laanwj referenced this in commit bb56781d61 on Mar 30, 2015
  38. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me