Fix weird character rendering on Windows with Japanese locale#20318
Draft
RobinMalfait wants to merge 4 commits into
Draft
Fix weird character rendering on Windows with Japanese locale#20318RobinMalfait wants to merge 4 commits into
RobinMalfait wants to merge 4 commits into
Conversation
Replace `ui-sans-serif` and `system-ui` with the following set of fonts: - `-apple-system` - `BlinkMacSystemFont` - 'Segoe UI' - Roboto - 'Helvetica Neue' - 'Noto Sans' - Arial For most peole this will look exactly the same, but it's for places like Windows where a different font is used for `system-ui` in case your machine is using a Japanese locale for example. Then the font used is 'Yu Gothic UI' which is the font that has bugs. You could argue that it's a bug in that font and even an OS bug for not providing a proper font for `system-ui`.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 fixes an issue where some characters are incorrectly rendered on Windows with the Japanese locale.
This is arguably a bug in the font that's loaded by Windows when it encounters
system-ui. But waiting for fixes there might ... take a while.Another option is to not change the defaults in Tailwind CSS and instead let the users that support different locales implement a fallback by overriding the
--font-sansvariable.The biggest reason for me to not change it in Tailwind CSS is that it requires us to know what the (proper) fallback fonts need to be on a per OS basis.
But the main reason why I did want to make the change is that MDN says this about the
system-uifont:There are PRs in other big projects that made this kind of change as well. E.g.:
Fixes: #19767
Fixes: #19768
Test plan
system-uiis not used anymore, so the bug doesn't happen