tonsky / tonsky/FiraCode

Slow rendering on high DPI under Windows 10 Creators Update with GDI and Clear Type

Open
#420 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
82k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Noticed a problem in Windows 10 Creators Update (version 1703) that was not present in the previous version dubbed Anniversary Update (version 1607). Might have to do with the DPI scaling changes they introduced in 1703.

The font rendering performance takes a huge hit making the window of any app that uses it very slow to redraw when ALL of the following conditions are met:

  1. Using Fira Code (1.204 in my case).
  2. Using high DPI screen.
  3. Using GDI rendering.
  4. Enabled Clear Type anti-aliasing.

Regarding condition 1, I did not run into this issue with native Windows fonts, like Consolas, nor with other fonts with ligature support, like losevka or Hasklig. Of course, all other conditions remained met.

As for number 2, for me it happens on QHD+, 3200 x 1800, scaled at 250%. It does not happen on WQHD, 2560 x 1440.

Now as for conditions 3 and 4 there's some more information.

As I tested, Visual Studio Code does not have this problem. This is most likely because it's using DirectX font rendering. For me this problem persists with ConEmu and Vim. These two use GDI although in Vim's case there's a DirectX option.

Workaround for ConEmu is simple: disable Clear Type anti-aliasing and performance is back to normal.

First workaround for Vim is also to disable Clear Type anti-aliasing by configuring the font in vimrc like so:

set guifont=Fira\ Code:h14:qANTIALIASED

When no q is provided Vim uses Clear Type. Same when given qCLEARTYPE.

Another workaround for Vim is to enable DirectX font rendering by configuring the font in vimrc along these lines:

set guifont=Fira\ Code:h14
set renderoptions=type:directx,gamma:1.8,contrast:0.5,level:0.5,geom:1,renmode:5,taamode:1

Since this was observed in the newest Windows version and only with Fira Code I suspect we could look into upgrading the lovely font to support the OS changes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files or tests are named. Start by reproducing the slowdown under Windows 10 version 1703 with Fira Code, high DPI, GDI rendering, and ClearType enabled, then compare the listed ConEmu and Vim workarounds. Done means identifying whether the font can address the regression and documenting or implementing a verified resolution.

Written by the indexing model from the issue text.

Assessment

Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.