[PR #17258] AtlasEngine: Improve robustness against weird font sizes #31170

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

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

State: closed
Merged: Yes


This clamps the font sizes between 1 and 100. Additionally, it fixes
a warning that I randomly noticed when reproducing the issue: D2D
complained that EndDraw must be called before releasing resources.
Finally, this fixes a crash when the terminal size is exactly (1,1)
cells, which happened because the initial (invalid) size was (1,1) too.

This doesn't fully fix all font-size related issues, but that's
currently difficult to achieve, as for instance the swap chain size
isn't actually based on the window size, nay, it's based on the cell
size multiplied by the cell count. So if the cell size is egregiously
large then we get a swap chain size that's larger than the display and
potentially larger than what the GPU supports which results in errors.

Closes #17227

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17258 **State:** closed **Merged:** Yes --- This clamps the font sizes between 1 and 100. Additionally, it fixes a warning that I randomly noticed when reproducing the issue: D2D complained that `EndDraw` must be called before releasing resources. Finally, this fixes a crash when the terminal size is exactly (1,1) cells, which happened because the initial (invalid) size was (1,1) too. This doesn't fully fix all font-size related issues, but that's currently difficult to achieve, as for instance the swap chain size isn't actually based on the window size, nay, it's based on the cell size multiplied by the cell count. So if the cell size is egregiously large then we get a swap chain size that's larger than the display and potentially larger than what the GPU supports which results in errors. Closes #17227
claunia added the pull-request label 2026-01-31 09:45:32 +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#31170