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

[Question] Is there a way to align FontChoice font ? #341

Closed
fengyichui opened this issue Sep 9, 2023 · 14 comments
Closed

[Question] Is there a way to align FontChoice font ? #341

fengyichui opened this issue Sep 9, 2023 · 14 comments

Comments

@fengyichui
Copy link

Hi,

Some characters (I used font is Iosevka) are much higher than my CJK (font is Microsoft YaHei UI) characters, look like follow:
font

My font config:

Font=Iosevka Term
FontHeight=12
FontChoice=CJK:5
Font5=Microsoft YaHei UI

Is there a way (or options) to pan up CJK font a bit or align those different font?

@mintty
Copy link
Owner

mintty commented Sep 17, 2023

Please provide a download link to the Iosevka Term font. How does it look with other fonts?

@mintty
Copy link
Owner

mintty commented Sep 17, 2023

Asking because it looks fine for me with most fonts, including Iosevka. It may be a font problem of Iosevka Term.

@fengyichui
Copy link
Author

The download link is here. The Iosevka Term and Iosevka looks very similar and they are all more taller than my CJK font. The very old version of this font looks well.

@fengyichui
Copy link
Author

I try Windows Font fallback:

 REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fontlink\SystemLink" /v Iosevka /t REG_MULTI_SZ /d "MSYH.TTC,Microsoft YaHei UI,128,96"\0"MSYH.TTC,Microsoft YaHei UI"\0"SEGOEUI.TTF,Segoe UI,120,80"\0"SEGOEUI.TTF,Segoe UI"\0"SIMSUN.TTC,SimSun"\0"MSJH.TTC,Microsoft Jhenghei UI"\0"MEIRYO.TTC,Meiryo UI"\0"MALGUN.TTF,Malgun Gothic,128,96"\0"MALGUN.TTF,Malgun Gothic"\0"YUGOTHM.TTC,Yu Gothic UI,128,96"\0"YUGOTHM.TTC,Yu Gothic UI"\0"SEGUISYM.TTF,Segoe UI Symbol"

And remove wsltty config:

FontChoice=CJK:5
Font5=Microsoft YaHei UI

Those English and CJK font looks good (aligned):
1

@mintty
Copy link
Owner

mintty commented Sep 17, 2023

I installed Iosevka Term from your link (ttf archive in case that matters) and used your config which looks good here:
grafik
Microsoft Yahei UI version is 6.30.

@fengyichui
Copy link
Author

Did you uninstall all older versions of Iosevka before installing it?
My Microsoft Yahei UI version is 6.24, where do you download the version 6.30?

@mintty
Copy link
Owner

mintty commented Sep 18, 2023

Iosevka Term was not installed before. Yahei UI came with Windows, maybe you should run an update.

@fengyichui
Copy link
Author

I found this problem related to FontHeight, if it is equal to 12 it look bad, equal to 14 is no problem.
What is your configuration FontHeight?

@mintty
Copy link
Owner

mintty commented Sep 18, 2023

I can reproduce the issue, kind of. But it depends on the actual characters used, how this looks:
grafik
With this example, it seems that CJK characters also have some descender, like Latin. In this picture there is even more descender in the Latin g than in the CJK characters. Checking the baseline, there is 1 pixel offset. I guess 1 pixel is nothing that can be completely excluded in rendering, given rounding errors.
The CJK in this picture could be scaled a bit larger, though, but that's done by Windows.

@fengyichui
Copy link
Author

Thanks! Using Windows Font Fallback is also a good choice.

@mintty
Copy link
Owner

mintty commented Sep 18, 2023

For the records, DPI (display "scaling") also has an effect; my first screenshot (good) was at 125%, my second (confirming the issue) at 100% with 12pt font size.

@fengyichui
Copy link
Author

This may be a problem with Windows font rendering, and Windows Font Fallback may have done some special processing internally.

@mintty
Copy link
Owner

mintty commented Sep 30, 2023

The CJK font could be created a pinch bigger, like 1 pixel for 12pt font size, to compensate the problem.
However, it seems impossible to find heuristic criteria when to apply this tuning.
The same modification that helps for YaHei makes things worse for Yu Gothic and they have the same font metrics.

I'm considering a mechanism instead by which a specific font can be tuned a bit bigger by configuration.

@mintty
Copy link
Owner

mintty commented Nov 14, 2023

Released 3.7.0.

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

No branches or pull requests

2 participants