[PR #15239] Avoid loading nearby fonts unless necessary #30535

Open
opened 2026-01-31 09:41:25 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15239

State: closed
Merged: Yes


IDWriteFontSetBuilder is super expensive (~40ms of CPU for building a
single font set on a high-end CPU from ~2021). Let's avoid the cost,
by only constructing it if Cascadia Code is actually missing.
To not overcomplicate the code and to support any additional fonts we
might ship in the future, I'm not checking for the font name, and
instead I just construct the font set whenever any font is missing.

Part of #5907

Validation Steps Performed

  • Breakpoints in FontCache aren't hit ✅
  • App doesn't crash ✅
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15239 **State:** closed **Merged:** Yes --- `IDWriteFontSetBuilder` is super expensive (~40ms of CPU for building a single font set on a high-end CPU from ~2021). Let's avoid the cost, by only constructing it if Cascadia Code is actually missing. To not overcomplicate the code and to support any additional fonts we might ship in the future, I'm not checking for the font name, and instead I just construct the font set whenever any font is missing. Part of #5907 ## Validation Steps Performed * Breakpoints in FontCache aren't hit ✅ * App doesn't crash ✅
claunia added the pull-request label 2026-01-31 09:41:25 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30535