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

Fix nearby fonts for DxEngine again #16323

Merged
merged 1 commit into from Nov 16, 2023
Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Nov 16, 2023

The nearby font loading has to be outside of the try/catch of the
_FindFontFace call, because it'll throw for broken font files.
But in my previous PR I had overlooked that the font variant loop
modifies the only copy of the face name that we got and was in the
same try/catch. That's bad, because once we get to the nearby search
code, the face name will be invalid. This commit fixes the issue by
wrapping each individual _FindFontFace call in a try/catch block.

Closes #16322

Validation Steps Performed

  • Remove every single copy of Windows Terminal from your system
  • Manually clean up Cascadia .ttf files because they aren't gone
  • Destroy your registry by manually removing appx references (fun!)
  • Put the 4 Cascadia .ttf files into the Dev app AppX directory
  • Launch
  • No warning ✅

@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Nov 16, 2023
@@ -126,44 +126,52 @@ void DxFontInfo::SetFromEngine(const std::wstring_view familyName,
try
{
face = _FindFontFace(localeName);
}
CATCH_LOG();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppressing whitespace changes makes this a lot easier.
tl;dr: This PR wraps every single _FindFontFace call into its own try/catch block and moves the font-variant search code down below the nearby search.

@lhecker lhecker modified the milestone: Terminal v1.19 Nov 16, 2023
@lhecker lhecker added this to To Cherry Pick in 1.18 Servicing Pipeline via automation Nov 16, 2023
@lhecker lhecker added this to To Cherry Pick in 1.19 Servicing Pipeline via automation Nov 16, 2023
@DHowett DHowett merged commit b780b44 into main Nov 16, 2023
15 of 17 checks passed
@DHowett DHowett deleted the dev/lhecker/16322-dxengine-nearby branch November 16, 2023 21:27
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.19 Servicing Pipeline Dec 4, 2023
DHowett pushed a commit that referenced this pull request Dec 4, 2023
The nearby font loading has to be outside of the try/catch of the
`_FindFontFace` call, because it'll throw for broken font files.
But in my previous PR I had overlooked that the font variant loop
modifies the only copy of the face name that we got and was in the
same try/catch. That's bad, because once we get to the nearby search
code, the face name will be invalid. This commit fixes the issue by
wrapping each individual `_FindFontFace` call in a try/catch block.

Closes #16322

## Validation Steps Performed
* Remove every single copy of Windows Terminal from your system
* Manually clean up Cascadia .ttf files because they aren't gone
* Destroy your registry by manually removing appx references (fun!)
* Put the 4 Cascadia .ttf files into the Dev app AppX directory
* Launch
* No warning ✅

(cherry picked from commit b780b44)
Service-Card-Id: 91114951
Service-Version: 1.19
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.18 Servicing Pipeline Jan 22, 2024
DHowett pushed a commit that referenced this pull request Jan 23, 2024
The nearby font loading has to be outside of the try/catch of the
`_FindFontFace` call, because it'll throw for broken font files.
But in my previous PR I had overlooked that the font variant loop
modifies the only copy of the face name that we got and was in the
same try/catch. That's bad, because once we get to the nearby search
code, the face name will be invalid. This commit fixes the issue by
wrapping each individual `_FindFontFace` call in a try/catch block.

Closes #16322

## Validation Steps Performed
* Remove every single copy of Windows Terminal from your system
* Manually clean up Cascadia .ttf files because they aren't gone
* Destroy your registry by manually removing appx references (fun!)
* Put the 4 Cascadia .ttf files into the Dev app AppX directory
* Launch
* No warning ✅

(cherry picked from commit b780b44)
Service-Card-Id: 91114950
Service-Version: 1.18
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.19 Servicing Pipeline Feb 21, 2024
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.18 Servicing Pipeline Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Development

Successfully merging this pull request may close these issues.

warning popup "Cascadia Mono font is not found" (unpackaged version)
3 participants