Skip to content
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

scripted-diff: Use Courier New as tabular figures font in Overview page #207

Closed
wants to merge 1 commit into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Feb 1, 2021

The bitcoin/bitcoin@8d75115 (bitcoin/bitcoin#16432) introduced a monospaced font for tabulated figures.

But the Qt's font matching algorithm does not guarantee that:

This change suggests to use Courier New explicitly which is available on Windows and macOS by default.
On Linux systems the Qt substitutes the missed Courier New font (in case it is not installed) quite well. For example, the Liberation Mono is used on my system.

This is an alternative to #87. But personally I still lean to embedding font (#79).

-BEGIN VERIFY SCRIPT-
sed -i 's/Monospace/Courier New/' src/qt/forms/overviewpage.ui
-END VERIFY SCRIPT-
@luke-jr
Copy link
Member

luke-jr commented Feb 2, 2021

NACK forcing a specific font. We have GUIUtil::fixedPitchFont to workaround Qt limitations...

Furthermore, numbers shouldn't need a monospace font at all.
Replacing the spaces with U+2007 and absent decimal point with U+2008 seems like the correct approach there.

@luke-jr
Copy link
Member

luke-jr commented Feb 2, 2021

Replacing the spaces with U+2007 and absent decimal point with U+2008 seems like the correct approach there.

Problem with this approach is that we're masking with '#' which isn't the same width as digits, and there doesn't seem to be a good substitute. Best I could come up with was https://dpaste.com/2H7QFU9BZ

@laanwj
Copy link
Member

laanwj commented Feb 2, 2021

Wouldn't this just have to be chanaged all over again when we decide to embed the fonts? (#79)

@hebasto
Copy link
Member Author

hebasto commented Feb 2, 2021

Wouldn't this just have to be chanaged all over again when we decide to embed the fonts? (#79)

I really hope we'll move with #79 :)

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept 0 on this

Embedding the font as proposed in #79 is the way to go. In embedding the font we can effectively eliminate the current issues surrounding the representation of monospace characters. This change will not directly address the issue where the font is not available, we assume that linux will choose an appropriate monospace font.

My opinion is that we should focus on #79 instead of devoting review time to this

@luke-jr
Copy link
Member

luke-jr commented Feb 8, 2021

@jarolrod #79 is NACK. And even if we embed a font for backward platforms like Windows/macOS, especially NACK on forcing it by neglecting support of non-embedded builds.

@hebasto
Copy link
Member Author

hebasto commented Feb 21, 2021

@luke-jr

@jarolrod #79 is NACK. And even if we embed a font for backward platforms like Windows/macOS, especially NACK on forcing it by neglecting support of non-embedded builds.

Hopefully your comment is addressed in #79 (comment)

@hebasto
Copy link
Member Author

hebasto commented Feb 21, 2021

Closing in favor of #79.

@hebasto hebasto closed this Feb 21, 2021
@hebasto hebasto deleted the 210201-mono branch February 22, 2021 12:35
@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants