Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying a font with name longer than 32 characters causes the app to crash #602

Closed
luk1337 opened this issue May 8, 2019 · 3 comments · Fixed by #3107
Closed

Specifying a font with name longer than 32 characters causes the app to crash #602

luk1337 opened this issue May 8, 2019 · 3 comments · Fixed by #3107
Labels
Area-Fonts Related to the font Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Milestone

Comments

@luk1337
Copy link

luk1337 commented May 8, 2019

The font handling code uses LF_FACESIZE define from wingdi.h which is set to 32, however some fonts like "Droid Sans Mono Dotted for Powerline" use name longer than that which makes the Terminal app crash when trying to load font.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented May 9, 2019 via email

@DHowett-MSFT DHowett-MSFT added Area-Fonts Related to the font Issue-Bug It either shouldn't be doing this or needs an investigation. labels May 9, 2019
@DHowett-MSFT
Copy link
Contributor

This will require us to tease apart the FontInfoBase parts that pertain to GDI alone and the parts that can be generic for DX.

@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 9, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added the Severity-Crash Crashes are real bad news. label May 17, 2019
DHowett-MSFT pushed a commit that referenced this issue Oct 7, 2019
We now truncate the font name as it goes out to GDI APIs, in console API
servicing, and in the propsheet.

Fixes #602.
@ghost ghost added the In-PR This issue has a related PR label Oct 7, 2019
DHowett-MSFT pushed a commit that referenced this issue Oct 15, 2019
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.

There were a couple questions that came up: 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?
-> Later; followup filed (#3123)

* Should we fix Settings here, or later?
-> Later; followup filed (#3123)

* `TrueTypeFontList` is built out of things in winconp, the private
console header. Concern about interop structures.
-> Not used for interop, followup filed to clean it up (#3123)

* Is `unsigned int` right for codepage? For width?
-> Yes: codepage became UINT (from WORD) when we moved from Win16 to
Win32

This commit also includes a workaround for #3170. Growing
CONSOLE_INFORMATION made us lose the struct layout lottery during
release builds, and this was an expedient fix.

Closes #602.
Related to #3123.
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Oct 15, 2019
@ghost
Copy link

ghost commented Oct 23, 2019

🎉This issue was addressed in #3107, which has now been successfully released as Windows Terminal Preview v0.6.2951.0.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Fonts Related to the font Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants