[PR #9734] [MERGED] Reduce instances of font fallback dialog #27720

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9734
Author: @miniksa
Created: 4/6/2021
Status: ✅ Merged
Merged: 4/8/2021
Merged by: @undefined

Base: main ← Head: dev/miniksa/font_popup


📝 Commits (9)

  • 78c675f initial proposal of font fallback flag and word trimming fallback
  • d38b649 Proposal for checking inside our package for valid TTF files.
  • e557fc7 fix bug
  • 9132d01 code format pass.
  • 802f11d Rephrase to prevent invention of word not in dictionary.
  • 755d29f only lookup the paths once and hold in magic static. update naming of variables to be nearby and not package related. add some doc comments.
  • 06b9726 Handful of Dustin comments on PR.
  • 89e9870 Add check for Windows 10 and just skip local directory fallback lookup if we can't use the quick-convenience methods to create the font set from the files on disk.
  • 3cab910 Update src/renderer/dx/DxFontRenderData.cpp

📊 Changes

5 files changed (+177 additions, -17 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+2 -2)
📝 src/renderer/base/fontinfo.cpp (+12 -1)
📝 src/renderer/dx/DxFontRenderData.cpp (+152 -13)
📝 src/renderer/dx/DxFontRenderData.h (+7 -1)
📝 src/renderer/inc/FontInfo.hpp (+4 -0)

📄 Description

Reduce instances of font fallback dialog through package font loading,
basic name trimming, and revised fallback test

  • Adjusts the font dialog to only show when we attempt last-chance
    resolution from our hardcoded list of font names with a flag instead
    of with a string comparison by name

  • Adds a resolution step to trim the font name by word from the end and
    retry to attempt to resolve a proper font that just has a weight
    suffix

  • Adds a second font collection to font loading that will attempt to
    locate all TTF files sitting next to our binary, like in our package

  • Wrote my font preference in the JSON as Cascadia Code Heavy and
    watched it quietly resolve to just Cascadia Code without the dialog.

  • Put a font that isn't registered with the system into the layout
    directory for the package, set it as my desired font in Terminal, and
    watched it load just fine.

  • Try a font name with different casing and see if dialog doesn't
    pop anymore

  • Try a font with different (localized) names like MS ゴシック and
    see if dialog doesn't pop anymore

  • Check Win7 with WPF target

Closes #9375


🔄 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/9734 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 4/6/2021 **Status:** ✅ Merged **Merged:** 4/8/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/miniksa/font_popup` --- ### 📝 Commits (9) - [`78c675f`](https://github.com/microsoft/terminal/commit/78c675f3060a5dd2f76354f138f6b14a818a22bb) initial proposal of font fallback flag and word trimming fallback - [`d38b649`](https://github.com/microsoft/terminal/commit/d38b64976266177e8ebff6676f84791ce3ad290d) Proposal for checking inside our package for valid TTF files. - [`e557fc7`](https://github.com/microsoft/terminal/commit/e557fc7df93741ed82bad20aaa901390d460cc4d) fix bug - [`9132d01`](https://github.com/microsoft/terminal/commit/9132d0190b6fa2c4f6001fbaa3cecf3afa0ee99d) code format pass. - [`802f11d`](https://github.com/microsoft/terminal/commit/802f11da509231485af1920004c2d50829299c34) Rephrase to prevent invention of word not in dictionary. - [`755d29f`](https://github.com/microsoft/terminal/commit/755d29f2beb74edd3fdc01e18261d173c694a424) only lookup the paths once and hold in magic static. update naming of variables to be nearby and not package related. add some doc comments. - [`06b9726`](https://github.com/microsoft/terminal/commit/06b97263ee4478667a661e965d509d79cf845388) Handful of Dustin comments on PR. - [`89e9870`](https://github.com/microsoft/terminal/commit/89e9870125efaacfdc18f7f41e0226414785e4b3) Add check for Windows 10 and just skip local directory fallback lookup if we can't use the quick-convenience methods to create the font set from the files on disk. - [`3cab910`](https://github.com/microsoft/terminal/commit/3cab9108b9be35a904471d4edc5d093b8c03c374) Update src/renderer/dx/DxFontRenderData.cpp ### 📊 Changes **5 files changed** (+177 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+2 -2) 📝 `src/renderer/base/fontinfo.cpp` (+12 -1) 📝 `src/renderer/dx/DxFontRenderData.cpp` (+152 -13) 📝 `src/renderer/dx/DxFontRenderData.h` (+7 -1) 📝 `src/renderer/inc/FontInfo.hpp` (+4 -0) </details> ### 📄 Description Reduce instances of font fallback dialog through package font loading, basic name trimming, and revised fallback test - Adjusts the font dialog to only show when we attempt last-chance resolution from our hardcoded list of font names with a flag instead of with a string comparison by name - Adds a resolution step to trim the font name by word from the end and retry to attempt to resolve a proper font that just has a weight suffix - Adds a second font collection to font loading that will attempt to locate all TTF files sitting next to our binary, like in our package - [x] Wrote my font preference in the JSON as `Cascadia Code Heavy` and watched it quietly resolve to just `Cascadia Code` without the dialog. - [x] Put a font that isn't registered with the system into the layout directory for the package, set it as my desired font in Terminal, and watched it load just fine. - [x] Try a font name with different casing and see if dialog doesn't pop anymore - [x] Try a font with different (localized) names like MS ゴシック and see if dialog doesn't pop anymore - [x] Check Win7 with WPF target Closes #9375 --- <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:23: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#27720