Fixing blurry fonts on WSL with X-server

Promise L Chin
1 min readMar 27, 2019

--

When launching GUI applications from WSL (Windows subsystem for Linux) through an X-server (e.g. XMing or VcXsrv), It often appears that the on-screen elements are blurred, usually most noticeable in texts. Here is a fix for one possible cause of this problem.

On a high resolution display, Windows is often set up with a scale up. Changing the scale back to 100% fixes the blurry font but makes everything on screen too small. If you want to keep the scaling, you need two modifications.

Assuming your Windows display scaling (under Windows display option) is 125%, add the option “-dpi 120” (without quotes) to the target of your X-server shortcut (usually named “XLaunch”). If you now launch an GUI application from this X-server again, it will appear at 100% scaling while the rest of the Windows keep the 125% scaling.

To get 125% scaling with the Linux applications, you need to set the parameter GDK_DPI_SCALE to 1.25. This can be done by adding a line “export GDK_DPI_SCALING=1.25” to your .bashrc (or .zshrc, depending on your choice of shell). Now an GUI application should appear at the same size on screen before making these two modifications but with blurriness removed.

If your display is set with a different scaling factor, modify the dpi option by multiplying it with 96. A scale of 125% gives 120 while 150% gives 144. The GDK_DPI_SCALING is also modified accordingly.

--

--