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

Font quirk: Broken “ます” ligature with BIZ UDGothic when discretionary ligatures are enabled #5372

Open
pluiedev opened this issue Jan 25, 2025 · 4 comments
Labels
font Issue within the font stack (typically src/font)

Comments

@pluiedev
Copy link
Contributor

Discussed in #5203

Originally posted by masisz January 18, 2025
Hello,

When I input the Japanese “ます” in ghostty, it is displayed as the symbol “〼”. Is there a way to fix this by changing the settings?

The issue occurred in an environment using the JetBrains Mono1 font on macOS.

This is my first time submitting to an issue tracker, so if there’s any missing information or anything unclear in my description, please let me know, and I’ll provide additional details.

I’m looking forward to seeing this become an excellent terminal application.

Sincerely,

Footnotes

  1. Editor's note: it is not actually using JetBrains Mono as it does not have any CJK characters. BIZ UDGothic is used instead.

@pluiedev
Copy link
Contributor Author

pluiedev commented Jan 25, 2025

See googlefonts/morisawa-biz-ud-gothic#43 for more details.

Normally I don't think a broken ligature on one specific font warrants creating an issue, but it seems to have hit multiple people for reasons I've speculated here:

  • Our default font, JetBrains Mono, does not contain any CJK characters. Therefore, users who have not set a custom font would have to use a fallback font, which could be any CJK font on their system;
  • BIZ UDGothic appears to be bundled with Adobe Fonts and available globally for any user who has Adobe software installed. It also appears fairly early in the font list, if sorted by lexicographic order, and it is certainly one of the first CJK fonts to be selected as a fallback;
  • The specific characters it affects are particularly bad. (For non-Japanese speakers, ます is used in the polite form of verbs and is present in nearly all formal text in Japanese. If left unfixed, formal text would largely be left illegible.)

I propose that we should add a specific entry to our font quirks file and disable default font features for this font in particular. (Font designers from traditional type foundries aren't exactly known for responding to GitHub issues.) @qwerasd205 mentioned that perhaps we could also selectively disable ligatures based on if they are "monospace-friendly" or not, but I'm not well-acquainted enough with that side of the codebase to know how to approach that.

Maybe we should just disable ligatures for CJK fonts in general? As a Chinese speaker I'm not sure when they're ever useful or even seen in fonts. Love to hear more feedback about that.

@mitchellh mitchellh added the font Issue within the font stack (typically src/font) label Jan 25, 2025
@sohsatoh
Copy link
Contributor

Is there a way to fix this by changing the settings?

Yes, you can disable font ligature.

font-feature = -calt
font-feature = -dlig

https://ghostty.org/docs/config/reference#font-feature

The specific characters it affects are particularly bad. (For non-Japanese speakers, ます is used in the polite form of verbs and is present in nearly all formal text in Japanese. If left unfixed, formal text would largely be left illegible.)

I am a native Japanese speaker, and I share a similar opinion.
While replacing "ます" (verb polite form) with "〼" was done during the Edo period and other historical times, it is almost never used in modern Japanese. (it is still understandable though)
Additionally, the ligature "㌧" is commonly used to represent "ton" (=1,000 kg) but is not applied in other contexts.

The problem here is that in Japanese, unlike in English, there are no clear boundaries between words. Therefore, it cannot always be assumed that "ます" or "トン" in the text corresponds to "〼" or "㌧."

For example:

In the sentence 「山に登ります。」, the "ます" here is part of the polite form of "登る" (to climb), so replacing it with "〼" would be relatively straightforward.

However, in the sentence 「人をだます」, the "ます" is part of the word "だます" (to deceive) and not a polite suffix. Replacing it with "〼" would result in confusion, as it changes the word's meaning or makes it unintelligible.

This ambiguity highlights why such replacements are context-sensitive and cannot be applied uniformly in Japanese.

@andrewrk
Copy link
Collaborator

While replacing "ます" (verb polite form) with "〼" was done during the Edo period and other historical times, it is almost never used in modern Japanese. (it is still understandable though)

面白いですね!今まで知りません。

@masisz
Copy link

masisz commented Jan 30, 2025

Thank you for your interest. I'm not yet able to understand the code for Zig and Ghostty, and am unable to point out or fix the code for this issue. But I believe I can contribute through investigation and research. Please let me know if you have any additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
font Issue within the font stack (typically src/font)
Projects
None yet
Development

No branches or pull requests

5 participants