[PR #12554] [MERGED] Fix Windows 10 support for nearby font loading #29102

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12554
Author: @lhecker
Created: 2/23/2022
Status: Merged
Merged: 3/10/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/12420-nearby-fonts


📝 Commits (1)

  • fe55404 Fix Windows 10 support for nearby font loading

📊 Changes

13 files changed (+196 additions, -234 deletions)

View changed files

📝 src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp (+3 -57)
📝 src/features.xml (+9 -0)
📝 src/renderer/atlas/AtlasEngine.api.cpp (+58 -29)
📝 src/renderer/atlas/AtlasEngine.cpp (+2 -1)
📝 src/renderer/atlas/AtlasEngine.h (+3 -1)
src/renderer/base/FontCache.h (+96 -0)
📝 src/renderer/base/lib/base.vcxproj (+1 -0)
📝 src/renderer/base/lib/base.vcxproj.filters (+3 -0)
📝 src/renderer/dx/DxFontInfo.cpp (+8 -124)
📝 src/renderer/dx/DxFontInfo.h (+2 -13)
📝 src/renderer/dx/DxFontRenderData.cpp (+7 -8)
📝 src/renderer/dx/DxFontRenderData.h (+2 -1)
📝 src/renderer/dx/DxRenderer.cpp (+2 -0)

📄 Description

By replacing IDWriteFontSetBuilder2::AddFontFile with
IDWriteFactory5::CreateFontFileReference and
IDWriteFontSetBuilder1::AddFontFile we add nearby
font loading support for Windows 10, build 15021.

This commit also fixes font fallback for AtlasEngine,
which was crashing during testing.

Finally it fixes a bug in DxEngine, where we only created a "nearby" font
collection if we couldn't find the font in the system collection. This doesn't
fix the bug, if the font is locked or broken in the system collection.

This is related to #11648.

PR Checklist

Validation Steps Performed

  • Build a Debug version of Windows Terminal
  • Put Jetbrains Mono into the writeable AppX directory
  • Jetbrains Mono is present in the settings UI
  • DxEngine works with Jetbrains Mono
  • AtlasEngine works with Jetbrains Mono

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12554 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 2/23/2022 **Status:** ✅ Merged **Merged:** 3/10/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/12420-nearby-fonts` --- ### 📝 Commits (1) - [`fe55404`](https://github.com/microsoft/terminal/commit/fe55404d40692fbfef016eb1ad4217e33ba6f1bd) Fix Windows 10 support for nearby font loading ### 📊 Changes **13 files changed** (+196 additions, -234 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp` (+3 -57) 📝 `src/features.xml` (+9 -0) 📝 `src/renderer/atlas/AtlasEngine.api.cpp` (+58 -29) 📝 `src/renderer/atlas/AtlasEngine.cpp` (+2 -1) 📝 `src/renderer/atlas/AtlasEngine.h` (+3 -1) ➕ `src/renderer/base/FontCache.h` (+96 -0) 📝 `src/renderer/base/lib/base.vcxproj` (+1 -0) 📝 `src/renderer/base/lib/base.vcxproj.filters` (+3 -0) 📝 `src/renderer/dx/DxFontInfo.cpp` (+8 -124) 📝 `src/renderer/dx/DxFontInfo.h` (+2 -13) 📝 `src/renderer/dx/DxFontRenderData.cpp` (+7 -8) 📝 `src/renderer/dx/DxFontRenderData.h` (+2 -1) 📝 `src/renderer/dx/DxRenderer.cpp` (+2 -0) </details> ### 📄 Description By replacing `IDWriteFontSetBuilder2::AddFontFile` with `IDWriteFactory5::CreateFontFileReference` and `IDWriteFontSetBuilder1::AddFontFile` we add nearby font loading support for Windows 10, build 15021. This commit also fixes font fallback for AtlasEngine, which was crashing during testing. Finally it fixes a bug in DxEngine, where we only created a "nearby" font collection if we couldn't find the font in the system collection. This doesn't fix the bug, if the font is locked or broken in the system collection. This is related to #11648. ## PR Checklist * [x] Closes #12420 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Build a Debug version of Windows Terminal * Put Jetbrains Mono into the writeable AppX directory * Jetbrains Mono is present in the settings UI ✅ * DxEngine works with Jetbrains Mono ✅ * AtlasEngine works with Jetbrains Mono ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:32:49 +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#29102