[PR #10525] [MERGED] Allow users to set font features and font axes #28085

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10525
Author: @PankajBhojwani
Created: 6/28/2021
Status: ✅ Merged
Merged: 7/23/2021
Merged by: @undefined

Base: main ← Head: dev/pabhoj/font_feature


📝 Commits (10+)

📊 Changes

17 files changed (+531 additions, -60 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+8 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+41 -16)
📝 src/cascadia/TerminalControl/IControlSettings.idl (+2 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp (+2 -0)
📝 src/cascadia/TerminalSettingsModel/FontConfig.cpp (+8 -0)
📝 src/cascadia/TerminalSettingsModel/FontConfig.h (+5 -0)
📝 src/cascadia/TerminalSettingsModel/FontConfig.idl (+5 -0)
📝 src/cascadia/TerminalSettingsModel/JsonUtils.h (+104 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.cpp (+2 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.h (+5 -0)
📝 src/cascadia/UnitTests_Control/MockControlSettings.h (+6 -0)
📝 src/renderer/dx/CustomTextLayout.cpp (+85 -40)
📝 src/renderer/dx/CustomTextLayout.h (+1 -1)
📝 src/renderer/dx/DxFontRenderData.cpp (+208 -1)
📝 src/renderer/dx/DxFontRenderData.h (+32 -1)
📝 src/renderer/dx/DxRenderer.cpp (+16 -1)
📝 src/renderer/dx/DxRenderer.hpp (+1 -0)

📄 Description

Adds support for users to be able to set font features and axes (see the spec for more details!)

Detailed Description

CustomTextLayout

  • Asks the DxFontRenderData for the font features when getting glyphs
  • If any features have been set/updated, we always skip the "isTextSimple" shortcut
  • Asks the _formatInUse for any font axes when mapping characters in _AnalyzeFontFallback

DxFontRenderData

  • Stores a map of font features (initialized to the standard feature list)
  • Stores a map of font axes
  • Has methods to add font features/axes to the map or update existing ones
  • Has methods to retrieve the font features/axes
  • Sets the font axes in the IDWriteTextFormat when creating it

Validation Steps Performed

It works!

Specified in #10457
Related to #1790
Closes #759
Closes #5828


🔄 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/10525 **Author:** [@PankajBhojwani](https://github.com/PankajBhojwani) **Created:** 6/28/2021 **Status:** ✅ Merged **Merged:** 7/23/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/pabhoj/font_feature` --- ### 📝 Commits (10+) - [`d0c37fd`](https://github.com/microsoft/terminal/commit/d0c37fd3f193917ef02723cef2eef9690ab07edb) hm - [`e3bba2b`](https://github.com/microsoft/terminal/commit/e3bba2b8ab907ed6ea2acf6be90f639e36c3455c) hmm - [`575a2d6`](https://github.com/microsoft/terminal/commit/575a2d61a5cc3966958ca76d6bad32bbb0c93eb5) did user set features - [`7a40553`](https://github.com/microsoft/terminal/commit/7a4055304f72be6643d6dc2633c38fdb33ffa483) remove this - [`ae9e1b5`](https://github.com/microsoft/terminal/commit/ae9e1b550ea2c0b7105431ad397f9f33f3375e7c) spell - [`afd89ed`](https://github.com/microsoft/terminal/commit/afd89edbe110dc2c030c22fe7bf9b0ee64fb185f) format - [`acc03bb`](https://github.com/microsoft/terminal/commit/acc03bba022c38f7518d5fc9ef89df3bae7b9c09) don't involve dxfontinfo - [`797bae5`](https://github.com/microsoft/terminal/commit/797bae570ed7125d5f97f6d120df0ee9f8f9cba8) pipe axes through - [`a23254c`](https://github.com/microsoft/terminal/commit/a23254cbaf72bbd5c284e9d5f6d269c97136692f) works, needs cleaning up - [`64e42bf`](https://github.com/microsoft/terminal/commit/64e42bfdba09576a97dbc00322e7512557d13592) fix some failings ### 📊 Changes **17 files changed** (+531 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+8 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+41 -16) 📝 `src/cascadia/TerminalControl/IControlSettings.idl` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/FontConfig.cpp` (+8 -0) 📝 `src/cascadia/TerminalSettingsModel/FontConfig.h` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/FontConfig.idl` (+5 -0) 📝 `src/cascadia/TerminalSettingsModel/JsonUtils.h` (+104 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.cpp` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.h` (+5 -0) 📝 `src/cascadia/UnitTests_Control/MockControlSettings.h` (+6 -0) 📝 `src/renderer/dx/CustomTextLayout.cpp` (+85 -40) 📝 `src/renderer/dx/CustomTextLayout.h` (+1 -1) 📝 `src/renderer/dx/DxFontRenderData.cpp` (+208 -1) 📝 `src/renderer/dx/DxFontRenderData.h` (+32 -1) 📝 `src/renderer/dx/DxRenderer.cpp` (+16 -1) 📝 `src/renderer/dx/DxRenderer.hpp` (+1 -0) </details> ### 📄 Description Adds support for users to be able to set font features and axes (see the spec for more details!) ## Detailed Description **CustomTextLayout** - Asks the `DxFontRenderData` for the font features when getting glyphs - _If any features have been set/updated, we always skip the "isTextSimple" shortcut_ - Asks the `_formatInUse` for any font axes when mapping characters in `_AnalyzeFontFallback` **DxFontRenderData** - Stores a map of font features (initialized to the [standard feature list]) - Stores a map of font axes - Has methods to add font features/axes to the map or update existing ones - Has methods to retrieve the font features/axes - Sets the font axes in the `IDWriteTextFormat` when creating it ## Validation Steps Performed It works! [standard feature list]: https://github.com/fdwr/TextLayoutSampler/blob/ac5aef67d1cc0cb67c5e3be29b30bda5a90c3e2b/DrawableObject.ixx#L802 Specified in #10457 Related to #1790 Closes #759 Closes #5828 --- <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:26:13 +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#28085