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

QTextEdit not rendering $nbsp correctly with Windows' default font face #105

Closed
davidlatwe opened this issue Aug 18, 2020 · 0 comments · Fixed by #111
Closed

QTextEdit not rendering $nbsp correctly with Windows' default font face #105

davidlatwe opened this issue Aug 18, 2020 · 0 comments · Fixed by #111

Comments

@davidlatwe
Copy link
Collaborator

davidlatwe commented Aug 18, 2020

Problem

In PR #102, commit 2b94ae6, I have added this code to resolve indention missing (white space at the start of line)

line = line.replace(" ", " ")

At the time I was working on Mac, but I shift to Windows just now and found out that all the spaces was gone !

I had a good search and I found that it seems to be related to the default font face on Windows.

Here's the link, and I quote :

Update: Turns out I missed something important:   in Qt/Windows renders incorrectly only with the particular monotype font that I was using called 'Terminal'. When I switched to 'Lucida Console' (or any other font for that matter)   renders correctly!

So I have a quick test, changing the font face of info level log message to JetBrains Mono, and indeed it render correctly now.

I changed this line :

}.get(level, "<font color=\"#222\">")

into

        }.get(level, "<font color=\"#222\" face=\"JetBrains Mono\">")

And in the result image below, you may see the messages that was not info has no space at all.

image

So, looks like we need to pick a font face for Windows, maybe vendoring one ?

Noted that in the above stack overflow link, the correct answer have a good explain about why it happens.

@davidlatwe davidlatwe mentioned this issue Oct 19, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant