Wrong font variation for Chinese (Simplified) #6344

Closed
opened 2026-01-31 00:36:14 +00:00 by claunia · 10 comments
Owner

Originally created by @skyanchor on GitHub (Feb 8, 2020).

Environment

Windows build number: 19041.21
Windows Terminal version (if applicable): 0.8.10261.0

Any other software? No.

Steps to reproduce

When I open the app, the Chinese characters on the screen (or what I type) is in the wrong variation in zh-cn.

Expected behavior

The Chinese characters (in zh-cn) should be like this. Please notice the highlighted strokes.
image

Actual behavior

The default descriptions are shown like this. Please notice the highlighted strokes.
image

Please notice that it is definitely not an issue for the use of a specific font, but a font-variation issue. Contents shown like that are in a font variation optimized for zh-hk or zh-tw, not optimized for zh-cn.

This issue was not present in the first test build of Terminal. It was present in the second of third public beta till now.

Originally created by @skyanchor on GitHub (Feb 8, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 19041.21 Windows Terminal version (if applicable): 0.8.10261.0 Any other software? No. ``` # Steps to reproduce When I open the app, the Chinese characters on the screen (or what I type) is in the wrong variation in zh-cn. # Expected behavior The Chinese characters (in zh-cn) should be like this. Please notice the highlighted strokes. ![image](https://user-images.githubusercontent.com/52092252/74076391-b0128980-4a52-11ea-8f82-7325489f6d71.png) # Actual behavior The default descriptions are shown like this. Please notice the highlighted strokes. ![image](https://user-images.githubusercontent.com/52092252/74076412-e05a2800-4a52-11ea-8add-6cc085c2a1e6.png) <!-- What's actually happening? --> Please notice that it is definitely not an issue for the use of a specific font, but a font-variation issue. Contents shown like that are in a font variation optimized for zh-hk or zh-tw, not optimized for zh-cn. This issue was not present in the first test build of Terminal. It was present in the second of third public beta till now.
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 13, 2020):

Team, I've tagged v1.0 as this is a globalization concern.

@skyanchor, Thanks for the report and the info.

@DHowett-MSFT commented on GitHub (Feb 13, 2020): Team, I've tagged v1.0 as this is a globalization concern. @skyanchor, Thanks for the report and the info.
Author
Owner

@skyline75489 commented on GitHub (Feb 14, 2020):

I noticed this a long time ago but didn’t realize it’s a font variant issue. Recently I came across a similar issue on Firefox which uses a Japanese variant of CJK font in zh-CN locale. Since there are several font variation in CJK environment, users from other regions may also be affected by this.

@skyline75489 commented on GitHub (Feb 14, 2020): I noticed this a long time ago but didn’t realize it’s a font variant issue. Recently I came across a similar issue on Firefox which uses a Japanese variant of CJK font in zh-CN locale. Since there are several font variation in CJK environment, users from other regions may also be affected by this.
Author
Owner

@Bwin4L commented on GitHub (Feb 17, 2020):

Hello!
That's Han Unification at its best (worst)!

Developers usually tend to just go for setting the traditional Chinese fonts as default CJK font variant fallback nowadays when there's no language information in the content — see e.g. Chrome, or even Visual Studio Code which are both affected by this issue (maybe I should open an issue on the VSCode repo). EDIT: there's already one open! :) https://github.com/microsoft/vscode/issues/66361

This causes display issues for the rest of the world because, hey, maybe what I'm showing in my terminal as e.g. an English or French user is Japanese, maybe it's simplified Chinese, maybe it's traditional Chinese (slightly different use case here as EN/FR aren't CJK languages), and believe me it's really annoying because some of the ideogram variants are wildly different between languages (as you can see on the Wikipedia page linked above).

I hope the chosen solution lets us at least select what fallback language variation we want to use as a setting in the preferences (and maybe default to one of the CJK variants when the system locale matches one of them, e.g. simplified Chinese for zh-CN, Japanese for ja-JP).

@Bwin4L commented on GitHub (Feb 17, 2020): Hello! That's [Han Unification](https://en.wikipedia.org/wiki/Han_unification) at its best (worst)! Developers usually tend to just go for setting the traditional Chinese fonts as default CJK font variant fallback nowadays when there's no language information in the content — see e.g. Chrome, or even Visual Studio Code which are both affected by this issue (maybe I should open an issue on the VSCode repo). EDIT: there's already one open! :) https://github.com/microsoft/vscode/issues/66361 This causes display issues for the rest of the world because, hey, maybe what I'm showing in my terminal as e.g. an English or French user is Japanese, maybe it's simplified Chinese, maybe it's traditional Chinese (slightly different use case here as EN/FR aren't CJK languages), and believe me it's really annoying because some of the ideogram variants are wildly different between languages (as you can see on the Wikipedia page linked above). I hope the chosen solution lets us at least select what fallback language variation we want to use as a setting in the preferences (and maybe default to one of the CJK variants when the system locale matches one of them, e.g. simplified Chinese for zh-CN, Japanese for ja-JP).
Author
Owner

@reli-msft commented on GitHub (Mar 5, 2020):

IDWriteFontFallback::MapCharacters will take the locale information from the text source, so maybe it is incorrect here? Allowing user to configure the fallback sequence is always a workaround to this though.

@reli-msft commented on GitHub (Mar 5, 2020): `IDWriteFontFallback::MapCharacters` will take the locale information from the text source, so maybe it is incorrect here? Allowing user to configure the fallback sequence is always a workaround to this though.
Author
Owner

@reli-msft commented on GitHub (Mar 5, 2020):

A test case for this is character “遍”.

Note: some fonts, Adobe's Source Han Sans, have locl features that transforms glyphs when peforming IDWriteTextAnalyzer::GetGlyphs and IDWriteTextAnalyzer::GetGlyphPlacements. These API take locale information too.

(image from https://blogs.adobe.com/CCJKType/2018/10/revisiting-locl-test.html)

@reli-msft commented on GitHub (Mar 5, 2020): A test case for this is character “遍”. ![](https://blogsimages.adobe.com/CCJKType/files/2018/10/locl-example.jpg) Note: some fonts, Adobe's Source Han Sans, have `locl` features that transforms glyphs when peforming `IDWriteTextAnalyzer::GetGlyphs` and `IDWriteTextAnalyzer::GetGlyphPlacements`. These API take locale information too. (image from https://blogs.adobe.com/CCJKType/2018/10/revisiting-locl-test.html)
Author
Owner

@cairijun commented on GitHub (Mar 13, 2020):

f919a46caf/src/renderer/dx/DxRenderer.cpp (L1984-L1986)

_GetLocaleName() retrieves the system's locale name, but _ResolveFontFaceWithFallback() would override localeName with the font's locale name. As we normally configure a font with latin alphabet only, and let the system fallback to a CJK font, the locale from the latin font would be used, which is normally en-us.

-        const auto face = _ResolveFontFaceWithFallback(fontName, weight, stretch, style, localeName);
+        std::wstring fontLocaleName = localeName;
+        const auto face = _ResolveFontFaceWithFallback(fontName, weight, stretch, style, fontLocaleName);

The patch above seems to resolve this issue:

image

@cairijun commented on GitHub (Mar 13, 2020): https://github.com/microsoft/terminal/blob/f919a46caf4d492c5d8e5cb3aa58b68a52d77eb0/src/renderer/dx/DxRenderer.cpp#L1984-L1986 `_GetLocaleName()` retrieves the system's locale name, but `_ResolveFontFaceWithFallback()` would override `localeName` with the font's locale name. As we normally configure a font with latin alphabet only, and let the system fallback to a CJK font, the locale from the latin font would be used, which is normally en-us. ```diff - const auto face = _ResolveFontFaceWithFallback(fontName, weight, stretch, style, localeName); + std::wstring fontLocaleName = localeName; + const auto face = _ResolveFontFaceWithFallback(fontName, weight, stretch, style, fontLocaleName); ``` The patch above seems to resolve this issue: ![image](https://user-images.githubusercontent.com/1297550/76591589-c9b06080-652b-11ea-904a-f7dd6d178372.png)
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 13, 2020):

Wow! Good catch. Mind submitting a pull request so we can review it? :)

@DHowett-MSFT commented on GitHub (Mar 13, 2020): Wow! Good catch. Mind submitting a pull request so we can review it? :)
Author
Owner

@lonble commented on GitHub (Jul 24, 2025):

I use the English version of Windows and set Chinese as my second language, as shown below.

Image

The fonts are normal in Windows File Explorer, input method, Notepad, VS Code, and even chrome, but not in Windows Terminal.

File Explorer:

Image

input method:

Image

Notepad:

Image

VS Code:

Image

chrome:

Image

Windows Terminal, with wrong font:

Image
@lonble commented on GitHub (Jul 24, 2025): I use the English version of Windows and set Chinese as my second language, as shown below. <img width="1168" height="1264" alt="Image" src="https://github.com/user-attachments/assets/aba8f826-07de-41d3-9ef7-aed66d6bb5df" /> The fonts are normal in Windows File Explorer, input method, Notepad, VS Code, and even chrome, but not in Windows Terminal. File Explorer: <img width="568" height="337" alt="Image" src="https://github.com/user-attachments/assets/fda834c3-966a-45b3-97b6-8539572d5540" /> input method: <img width="1254" height="147" alt="Image" src="https://github.com/user-attachments/assets/71951623-5436-42d1-abd2-b8d16032f65b" /> Notepad: <img width="688" height="299" alt="Image" src="https://github.com/user-attachments/assets/86472fc5-6af9-458d-add2-2a055e57979b" /> VS Code: <img width="796" height="271" alt="Image" src="https://github.com/user-attachments/assets/ebf7347d-0508-4005-b877-7f0c4fe87990" /> chrome: <img width="2058" height="278" alt="Image" src="https://github.com/user-attachments/assets/604bd0c8-bd23-4321-8816-024fc2af025e" /> **Windows Terminal, with wrong font:** <img width="654" height="219" alt="Image" src="https://github.com/user-attachments/assets/9c16d283-64cd-4af4-808c-1a845092f4c4" />
Author
Owner

@lhecker commented on GitHub (Jul 28, 2025):

Can you please create a new issue for that?

@lhecker commented on GitHub (Jul 28, 2025): Can you please create a new issue for that?
Author
Owner

@lonble commented on GitHub (Jul 30, 2025):

Can you please create a new issue for that?

New issue here https://github.com/microsoft/terminal/issues/19194

@lonble commented on GitHub (Jul 30, 2025): > Can you please create a new issue for that? New issue here <https://github.com/microsoft/terminal/issues/19194>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6344