[PR #3107] Allow FontInfo{,Base,Desired} to store a font name > 32 wch #25245

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

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

State: closed
Merged: Yes


Summary of the Pull Request

We now truncate the font name as it goes out to GDI APIs, in console API
servicing, and in the propsheet.

I attempted to defer truncating the font to as far up the stack as possible, so as to make FontInfo usable for the broadest set of cases.

PR Checklist

Detailed Description of the Pull Request / Additional comments

There are a couple things I have questions about, actually. I know that Settings gets memset (memsat?) by the registry deserializer, and perhaps that's another place for us to tackle. Right now, this pull request enables fonts whose names are >= 32 characters in Windows Terminal only, but the underpinnings are there for conhost as well. We'd need to explicitly break at the API, or perhaps return a failure or log something to telemetry.

  • Should we log truncation at the API boundary to telemetry?
  • Should the "launch face name" get the same treatment as the face name in Settings?
  • Should we fix Settings here, or later?
  • TrueTypeFontList is built out of things in winconp, the private console header. That fills me with dread that those structures are used for interop -- so I didn't bubble these fixes all the way up through the "default font" list, even though nominally the font list is also unbounded strings.
  • Is unsigned int right for codepage? For width?

I left some comments about truncating font faces around, but they could be tantamount to noise.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/3107 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request We now truncate the font name as it goes out to GDI APIs, in console API servicing, and in the propsheet. I attempted to defer truncating the font to as far up the stack as possible, so as to make FontInfo usable for the broadest set of cases. ## PR Checklist * [x] Closes #602 * [x] CLA signed * [x] Tests added/passed * [ ] Requires documentation to be updated * [x] I'm of the corefolk ## Detailed Description of the Pull Request / Additional comments There are a couple things I have questions about, actually. I know that `Settings` gets memset (memsat?) by the registry deserializer, and perhaps that's another place for us to tackle. Right now, this pull request enables fonts whose names are >= 32 characters _in Windows Terminal only_, but the underpinnings are there for conhost as well. We'd need to explicitly break at the API, or perhaps return a failure or log something to telemetry. * Should we log truncation at the API boundary to telemetry? * Should the "launch face name" get the same treatment as the face name in Settings? * Should we fix Settings here, or later? * `TrueTypeFontList` is built out of things in winconp, the private console header. That fills me with dread that those structures are used for interop -- so I didn't bubble these fixes all the way up through the "default font" list, even though nominally the font list is _also_ unbounded strings. * Is `unsigned int` right for codepage? For width? I left some comments about truncating font faces around, but they could be tantamount to noise.
claunia added the pull-request label 2026-01-31 09:08:15 +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#25245