fix: ensure fallback to default system monospace font#282747
Merged
rzhao271 merged 1 commit intomicrosoft:mainfrom Dec 12, 2025
Merged
fix: ensure fallback to default system monospace font#282747rzhao271 merged 1 commit intomicrosoft:mainfrom
rzhao271 merged 1 commit intomicrosoft:mainfrom
Conversation
This PR actually fixes an issue experienced when monaco-editor (the npm package) is used in a website loaded using Firefox on Linux. By using quotes, the `'monospace'` family causes Firefox to load "Noto Arabic" on my system. Should be noted I have a _clean_ Fedora 43 installation, with the default Gnome 49 installed fonts. `monospace` without the quotes resolves to Noto Sans Mono, as expected. I see absolutely no difference for default font rendering inside Chromium-based web views. Testing with monaco-editor in Google Chrome and VSCode inside Electron. Most Gnome-based Linux distros moved away from the Droid font-family, and are currently using the Noto font-family, but I'll leave that up to you guys. `monospace` (without quotes) properly resolves to Noto. I've tracked where this `'monospace'` value came from, and it seems to have been added in b99f414 as part of not using Courier New on Linux. Seems like an oversight from my end.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Firefox on Linux font rendering issue where the quoted 'monospace' fallback was causing Firefox to incorrectly load "Noto Arabic" instead of the expected monospace font. The fix removes the redundant quoted 'monospace' from the font family list, leaving only the unquoted monospace keyword which correctly resolves to the system's default monospace font.
Key Changes:
- Removes the redundant quoted
'monospace'fallback fromDEFAULT_LINUX_FONT_FAMILYto fix incorrect font resolution in Firefox on Linux
Contributor
Author
|
FYI @hediet since you seem to be the one maintaining the monaco-editor package. |
rzhao271
approved these changes
Dec 12, 2025
mjbvz
approved these changes
Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR actually fixes an issue experienced when monaco-editor (the npm package) is used in a website loaded using Firefox on Linux.
By using quotes, the
'monospace'family causes Firefox to load "Noto Arabic" on my system. Should be noted I have a clean Fedora 43 installation, with the default Gnome 49 installed fonts.monospacewithout the quotes resolves to "Noto Sans Mono", as expected.I see absolutely no difference for default font rendering inside Chromium-based web views. Testing with monaco-editor in Google Chrome and VSCode inside Electron.
Most Gnome-based Linux distros moved away from the Droid font-family, and are currently using the Noto font-family, but I'll leave that up to you guys.
monospace(without quotes) properly resolves to "Noto Sans Mono".I've tracked where this
'monospace'value came from, and it seems to have been added in b99f414 as part of not using "Courier New" on Linux. Seems like an oversight.