-
Notifications
You must be signed in to change notification settings - Fork 1.2k
qt: Implement application wide font management #3555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f3c5deb to
b2eccfe
Compare
|
Needs rebase + see #3578 for some font related issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you run git diff -U0 HEAD~13.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v (that 13 will probably change after you rebase) and then take a look at those changes. Some of them you might not need / want to take
|
Tested this a bit. It looks like I think it might probably make sense to postpone this and/or maybe group all font related PRs (i.e. this one, #3567 + defining |
8821df3 to
a832540
Compare
|
@PastaPastaPasta thanks 👍 good to know that we have a script for that 😄 i applied some of the changes. @UdjinM6 Rebased on develop + rebased/merged all the related commits into this PR and added @UdjinM6 @strophy I used Montserrat because its defined in Dash Style Guide (page 14) to be used as main typeface for most web and print. I assumed we are not too far away from that with the core wallet ;)
Anyway, i get your points of some people rather want the native thing as default. Though, i have another point here because i prefer the non-native/dash-specific default approach rather. I just prefer the cleaner/modern look of the Montserrat which stands out over the system fonts and i also can't confirm from my side that "its hard to read" it. Maybe thats some windows thing or so, idk. So i would really want to have Montserrat as default haha... But at the end thats just personal preference and thats why i propose to add a "Setup your preferred settings" dialog. The idea is just to have a simple dialog which looks similar to the Appearance tab and it will pop up after starting the application if there are no font related settings yet. Means this would pop up in the following cases:
This way you can choose your own defaults for all of the font/theme related settings. Just like you can if you for example start with macOS (maybe Windows too? idk) configuration or so. Would either add this to the Appearance tab PR or just have a separate one for it not sure yet. |
|
Suba's interpretation of the style guide here (under "Visual") indicates Montserrat should only be used for headings, Open Sans should be used for body text. This is what I have followed when laying out e.g. our PDF legal briefs. Fonts are such a subjective issue, and I totally support giving users a choice. The experience depends so much on user's platform as well. But the change from system default as default to Montserrat as default feels like it presumes to know what the users wants - for me personally the characters are far too wide for it to be a good choice for body text or data in tables. The kerning issue is probably also turning me off. So I think it's a good compromise to offer the user a choice during first install, maybe hidden behind an "Advanced Options" button or something (since the user should really be focusing on where to store the blockchain data and wallet during first install). |
Well as you can see in my cite of the pdf guide, it says Montserrat is good for body texts, this is what i have followed. Seems like we have some inconsistency issue then with our style guides. Also i presented Suba the UI changes and even asked him what he thinks about the font choice, size and weight. He didn't complain about it at that point ;) So yeah, some people seem to like it, some not and thats totally fine.
Check my last comment, it's not longer default now with the latest changes to this PR. So, should be good?
Just for me to understand this, doesn't it just come up if you change the font from Montserrat to SystemDefault?
No worries, it will not distract the user from choosing where to store the data since that will be done already then. Could be an "Advanced Options" button or what i had in mind actually is just a second page for the initial setup. |
|
Yup, we have definitely found a discrepancy in the style guide ;) I'm fine with the changes as you describe them and I think we can go ahead with this PR. Regarding the kerning, I'm not sure this is a new problem, it occurs with both fonts and I think it occurs with older versions as well. So we can probably continue discussion on these Windows-with-mixed-normal/HiDPI-panel-only problems in #3578 |
UdjinM6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly tested ACK
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some things
|
Generally looks good, can you squash some of these commits? 25 commits is quite a bit to merge, but this PR seems too big to merge as one commit |
Includes the following methods - GUIUtil::loadFonts to load the fonts into the application's font database - GUIUtil::setApplicationFont to set the application font depending on the active theme - GUIUtil::setFont to set a specific font variation for a vector of widgets (Montserrat for dash themes, system default for traditional theme). - GUIUtil::getFont to get a specific montserrat variation as QFont (Montserrat for dash themes, system default for traditional theme). - GUIUtil::getFontWeightNormal to get the font weight to be used for normal text - GUIUtil::getFontWeightBold to get the font weight to be used for bolder text - GUIUtil::getFontNormal to get the default normal weighted QFont - GUIUtil::getFontBold to get the default bold weighted QFont There is a Qt bug on macOS (at least with macOS 10.15.4 and Qt 5.7.1) which leads to not mapping the font weights correctly to the different font types so that they can be selected by the appropriate methods to set the font weight. As result there is now way to properly select the different font styles from stylesheet or with QFont::setWeight() for the font Montserrat. There are only two different weights selectable over the full range of possible weight values. One very bold one and the "ExtraLight" version. As workaround its possible to select the fonts by using the font style string (QFont::setStyleName) as the Montserrat font becomes loaded as one family with one "font style" for each font file. The font wrapper added by this commit are taking care of this behaviour for all operating systems so there should be no other usage of QFont outside of GUIUtil and no more font changes in stylesheets.
This is because font related changes will from now on only be made either in c++ with `GUIUtil::setFont` for font weight/style changes or in css for size and color changes with `font-size` or `color`.
The two parent commits did remove all some font-weight changes from css and ui files. This commit reverts them.
-font-weight-normal allows to set the weight of normal texts in the UI -font-weight-bold allows to set the weight of bold texts in the UI -font-scale allows to scale the application font size up/down
This also keeps track of changed font-sizes and updates them depending on the settings if GUIUtil::updateFonts() gets called.
Allows to choose between the fonts: 0 - SystemDefault (default) 1 - Montserrat
9a1c07a to
172c283
Compare
|
Ok squashed all review/fix stuff into the related commits, combined some of the original ones and added one small change with 172c283. All good now? |
UdjinM6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly tested ACK
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On ubuntu right now it looks pretty bad... maybe this is due to using system font?
Generally it looks like stuff still works. light ACK, code review utACK
qt: Implement application wide font management
This PR ist part of a series of +-25 PRs related to UI redesigns. Its ancestor is #3554, its successor is #3556. I did not screenshot every single PR and its changes, instead i made "walk through all screen" videos with the result of this PR series and also with the 0.15 UI. If there are any concrete screenshots wanted, just let me know. To build with the full set of changes you can build from the branch xdustinface:pr-ui-redesign which always contains all changes.
-> Walk through 0.15
-> Walk through Redesign
I tried to give the commits enough text to make things obvious without a lot description for each PR. Also here, if you want more description for this specific PR, let me know.
About this PR
This PR adds custom font helpers in GUIUtil and makes Montserrat (a font from the "Dash Style Guide") the default font for dash themes.
All PRs are based on its ancestor. Click here to see the changes of this PR only