Skip to content

On Windows Chrome, font-family: monospace; won't show as monospace font #17966

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

Open
CNOCTAVE opened this issue Apr 10, 2025 · 11 comments
Open

On Windows Chrome, font-family: monospace; won't show as monospace font #17966

CNOCTAVE opened this issue Apr 10, 2025 · 11 comments
Labels

Comments

@CNOCTAVE
Copy link

What happened?

On Windows Chrome, font-family: monospace; won't show as monospace font.

Image

What did you expect to happen?

Change to font-family: courier, monospace; will be a good workaround.

Image

Reproduction URL

http://cnoctave.cn/1/2.html

How to reproduce?

Visit http://cnoctave.cn/1/2.html

Flavour

UMD

Areas

Style & Identity (quasar)

Platforms/Browsers

Chrome

Quasar info output

Relevant log output

Additional context

No response

Copy link

Hi @CNOCTAVE! 👋

It looks like you provided an invalid or unsupported reproduction URL.
Do not use any service other than Codepen, jsFiddle, StackBlitz, CodeSandbox, and GitHub.
Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc.
Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

@FragsterAt
Copy link

FragsterAt commented Apr 21, 2025

On Windows Chrome, font-family: monospace; won't show as monospace font.

Looks like broken settings in chrome.
Go to chrome://settings/fonts and check your monospace font value.

In any case Courier is bad choice for hidpi screens.

On my system with default settings (Consolas) everything is ok:

Image

@FragsterAt
Copy link

FragsterAt commented Apr 21, 2025

@CNOCTAVE you can check actual rendered font in inspector in "computed" tab:

Image

@CNOCTAVE
Copy link
Author

CNOCTAVE commented Apr 22, 2025

@FragsterAt

Image

The actual rendered font is NSimSun.

@CNOCTAVE
Copy link
Author

@FragsterAt

Image My Chrome monospace font value is "Default".

@CNOCTAVE
Copy link
Author

BTW Consolas font is avaliable on Windows too. Maybe Quasar can use Consolas, monospace instead of monospace.

@FragsterAt
Copy link

The actual rendered font is NSimSun.

My Chrome monospace font value is "Default".

Default is "default system font". In all my chrome installations in windows default value for monospace font is Consolas, may be in chinese version it has another value.

IMHO quasar behavior is correct, just change your settings to real monospace font (i.e. Consolas). NSimSun is not monospace font, so you may have same issue on other sites with unstyled pre or code tags.

@CNOCTAVE
Copy link
Author

Your workaround sounds perfect, but web developer cannot force users changing their Chrome settings.
I will add new bug to Chrome.

@FragsterAt
Copy link

FragsterAt commented Apr 22, 2025

web developer cannot force users changing their Chrome settings.
I will add new bug to Chrome.

If you sure, that your setting is real default setting and wasn't set by user, with group policies/script, etc.

as workaround - you can add style for code tag in app.css (quasar doesn't style it)

@CNOCTAVE
Copy link
Author

web developer cannot force users changing their Chrome settings.
I will add new bug to Chrome.

If you sure, that your setting is real default setting.

as workaround - you can add style for code tag in app.css (quasar doesn't style it)

Yes, in that picture u can see the glyphs of the "Default" setting is NSimSun, which is not a monospace font.
We always meet some bugs which "works on my machine".

@CNOCTAVE
Copy link
Author

CNOCTAVE commented Apr 22, 2025

Since Chrome can explicitly specify MacOS fonts e.g. -apple-system, it definitely can explicitly specify monospace font e.g. Consolas as Windows workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants