Change the Font in Windows SubSystem Linux

Asked 2 months ago, Updated 2 months ago, 6 views

What should I do if I want to change the font in Windows SubSystem for Linux?
Source Han Code JP
I would like to use the font.
The windows console does not support otf, and it seems that only ttf can be used, so I converted it from fontforge to ttf and installed it, but I cannot select the font on the wsl configuration screen.

Also, in my environment, the system default encoding is utf-8.

Operating System: Windows 10 1803

windows windows-10 font wsl

2022-09-30 14:28

1 Answers

An alternative Windows terminal (software that can replace a console such as a command prompt) that allows you to select fonts other than equal width and TTF fonts is ConEmu (can be used for WSL as well as command prompts).ConEmu (or its wrapper cmder) allows you to select and use Source Han Code JP in your settings.

However, this method has a problem specific to Source Han Code JP, which is much wider than the characters (glyphs) with kanji and kana characters displayed.In the normal monospace font, the alphanumeric character/kana width ratio is 1:2, but the Source Han Code JP is 2:3, which is special.When processing iso-wide fonts with ConEmu, it is assumed to be 1:2, so perhaps because kanji and kana characters are twice as wide as alphanumeric characters, the ratio becomes strange, the width of the glyph becomes larger, and the appearance becomes worse.There is no point in using Source Han Code JP. (ConEmu can combine two or more fonts, but I couldn't adjust the width.)

Verify with cmder

Another well-known alternative terminal is mintty.It seems that you can only select the same width and TTF font as the console, but you can force the font to be set in the configuration file (.minttyrc).In that case, alphanumeric characters will be equal in width to vertical, and then kanji and kana will be twice as wide as alphanumeric characters, and overall, the width will always be larger with respect to the glyph.

Verify with mintty on MSYS2

Therefore, if you want to use Source Han Code JP properly, you will have to look for another alternative terminal, but you will have to rewrite the open source of ConEmu and mintty.If you don't have that much fear, I think it would be better to use a font with Source Han Sans in TTF with equal width such as Genjin Gothic and Sarasa Gothic.

2022-09-30 14:28

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.