[PR #13362] [MERGED] Add support for soft fonts in the DX renderer #29510

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13362
Author: @j4james
Created: 6/23/2022
Status: Merged
Merged: 7/14/2022
Merged by: @undefined

Base: mainHead: dx-soft-fonts


📝 Commits (4)

  • 6f3a049 Add support for soft fonts in the DX renderer.
  • a66a2ce Add to spelling-bot dictionary.
  • 30b59be Don't die on reset.
  • 20ab8c2 Switch bitmap format to R8_UNORM.

📊 Changes

10 files changed (+384 additions, -14 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+2 -0)
📝 src/renderer/dx/CustomTextRenderer.cpp (+7 -7)
📝 src/renderer/dx/CustomTextRenderer.h (+5 -0)
📝 src/renderer/dx/DxRenderer.cpp (+47 -7)
📝 src/renderer/dx/DxRenderer.hpp (+7 -0)
src/renderer/dx/DxSoftFont.cpp (+256 -0)
src/renderer/dx/DxSoftFont.h (+55 -0)
📝 src/renderer/dx/lib/dx.vcxproj (+2 -0)
📝 src/renderer/dx/lib/dx.vcxproj.filters (+2 -0)
📝 src/renderer/dx/sources.inc (+1 -0)

📄 Description

Summary of the Pull Request

This PR adds support for downloadable soft fonts in the DirectX
renderer, potentially enabling them to be used in Windows Terminal.

References

Soft fonts were first implemented in conhost (with the GDI renderer) in
PR #10011.

PR Checklist

  • Closes #xxx
  • CLA signed.
  • Tests added/passed
  • Documentation updated.
  • Schema updated.
  • I've discussed this with core contributors already. If not
    checked, I'm ready to accept this work might be rejected in favor of a
    different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

The way the DirectX implementation works is by building up a bitmap
containing all of the glyphs, and then drawing an appropriate subsection
of that bitmap for each character that needs to be rendered. The current
text color is applied with a color matrix effect, and the glyphs are
automatically scaled up to the current font size with a scaling effect.

By default the scaling uses a high quality cubic interpolation, which
gives it a smoother antialiased effect. But if the Text antialiasing
option is configured as Aliased, we use a simpler nearest-neighbor
interpolation, which more closely matches the rendering of the original
GDI implementation.

Validation Steps Performed

I've manually tested the renderer in conhost with the UseDx registry
entry. I've also tested in Windows Terminal using the experimental
passthrough mode.


🔄 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/13362 **Author:** [@j4james](https://github.com/j4james) **Created:** 6/23/2022 **Status:** ✅ Merged **Merged:** 7/14/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dx-soft-fonts` --- ### 📝 Commits (4) - [`6f3a049`](https://github.com/microsoft/terminal/commit/6f3a049c183d78b046dec0f752b74d3f5aa7bdbf) Add support for soft fonts in the DX renderer. - [`a66a2ce`](https://github.com/microsoft/terminal/commit/a66a2cee7b7ff12e4844c6d43734f9709c9213f1) Add to spelling-bot dictionary. - [`30b59be`](https://github.com/microsoft/terminal/commit/30b59be0c26f29d656eee2662c5fa62de1c5b573) Don't die on reset. - [`20ab8c2`](https://github.com/microsoft/terminal/commit/20ab8c2b9c09ab4daa20bd7241facd0ceb1590e0) Switch bitmap format to R8_UNORM. ### 📊 Changes **10 files changed** (+384 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+2 -0) 📝 `src/renderer/dx/CustomTextRenderer.cpp` (+7 -7) 📝 `src/renderer/dx/CustomTextRenderer.h` (+5 -0) 📝 `src/renderer/dx/DxRenderer.cpp` (+47 -7) 📝 `src/renderer/dx/DxRenderer.hpp` (+7 -0) ➕ `src/renderer/dx/DxSoftFont.cpp` (+256 -0) ➕ `src/renderer/dx/DxSoftFont.h` (+55 -0) 📝 `src/renderer/dx/lib/dx.vcxproj` (+2 -0) 📝 `src/renderer/dx/lib/dx.vcxproj.filters` (+2 -0) 📝 `src/renderer/dx/sources.inc` (+1 -0) </details> ### 📄 Description ## Summary of the Pull Request This PR adds support for downloadable soft fonts in the DirectX renderer, potentially enabling them to be used in Windows Terminal. ## References Soft fonts were first implemented in conhost (with the GDI renderer) in PR #10011. ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments The way the DirectX implementation works is by building up a bitmap containing all of the glyphs, and then drawing an appropriate subsection of that bitmap for each character that needs to be rendered. The current text color is applied with a color matrix effect, and the glyphs are automatically scaled up to the current font size with a scaling effect. By default the scaling uses a high quality cubic interpolation, which gives it a smoother antialiased effect. But if the *Text antialiasing* option is configured as *Aliased*, we use a simpler nearest-neighbor interpolation, which more closely matches the rendering of the original GDI implementation. ## Validation Steps Performed I've manually tested the renderer in conhost with the `UseDx` registry entry. I've also tested in Windows Terminal using the experimental passthrough mode. --- <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:35:21 +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#29510