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

[pull] main from microsoft:main #97

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cascadia/CascadiaPackage/Package-Can.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<Dependencies>
<!-- rescap:appLicensing only works on 22000+. Until that's fixed, MinVersion will not let people install it on Windows 10... -->
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.22000.0" MaxVersionTested="10.0.22621.0" />
<TargetDeviceFamily Name="Windows.DesktopServer" MinVersion="10.0.22000.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
Expand Down Expand Up @@ -93,7 +94,7 @@
Description="Console host built from microsoft/terminal open source repository"
PublicFolder="Public">
<uap3:Properties>
<Clsid>{1F9F2BF5-5BC3-4F17-B0E6-912413F1F451}</Clsid>
<Clsid>{A854D02A-F2FE-44A5-BB24-D03F4CF830D4}</Clsid>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
Expand All @@ -104,7 +105,7 @@
Description="Terminal host built from microsoft/terminal open source repository"
PublicFolder="Public">
<uap3:Properties>
<Clsid>{051F34EE-C1FD-4B19-AF75-9BA54648434C}</Clsid>
<Clsid>{1706609C-A4CE-4C0D-B7D2-C19BF66398A5}</Clsid>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/CascadiaPackage/Package-Dev.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
<TargetDeviceFamily Name="Windows.DesktopServer" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/CascadiaPackage/Package-Pre.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
<TargetDeviceFamily Name="Windows.DesktopServer" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/CascadiaPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
<TargetDeviceFamily Name="Windows.DesktopServer" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
Expand Down
6 changes: 5 additions & 1 deletion src/common.build.pre.props
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@
C26456: Operator 'A' hides a non-virtual operator 'B' (c.128)
I think these rules are for when you fully bought into OOP?
We didn't and it breaks WRL and large parts of conhost code.
C26478: Don't use std::move on constant variables. (es.56).
This diagnostic is broken in VS 17.7 which our CI currently uses. It's fixed in 17.8.
C26494: Variable 'index' is uninitialized. Always initialize an object (type. 5).
This diagnostic is broken in VS 17.7 which our CI currently uses. It's fixed in 17.8.
-->
<DisableSpecificWarnings>4201;4312;4467;5105;26434;26445;26456;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>4201;4312;4467;5105;26434;26445;26456;26478;26494;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINDOWS;EXTERNAL_BUILD;_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
Expand Down
71 changes: 42 additions & 29 deletions src/renderer/dx/DxFontInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,44 +126,52 @@ void DxFontInfo::SetFromEngine(const std::wstring_view familyName,
try
{
face = _FindFontFace(localeName);
}
CATCH_LOG();

if (!face)
if constexpr (Feature_NearbyFontLoading::IsEnabled())
{
try
{
// If we missed, try looking a little more by trimming the last word off the requested family name a few times.
// Quite often, folks are specifying weights or something in the familyName and it causes failed resolution and
// an unexpected error dialog. We theoretically could detect the weight words and convert them, but this
// is the quick fix for the majority scenario.
// The long/full fix is backlogged to GH#9744
// Also this doesn't count as a fallback because we don't want to annoy folks with the warning dialog over
// this resolution.
while (!face && !_familyName.empty())
if (!face)
{
const auto lastSpace = _familyName.find_last_of(UNICODE_SPACE);

// value is unsigned and npos will be greater than size.
// if we didn't find anything to trim, leave.
if (lastSpace >= _familyName.size())
{
break;
}

// trim string down to just before the found space
// (space found at 6... trim from 0 for 6 length will give us 0-5 as the new string)
_familyName = _familyName.substr(0, lastSpace);

// Try to find it with the shortened family name
_fontCollection = FontCache::GetCached();
face = _FindFontFace(localeName);
}
}
CATCH_LOG();
}
CATCH_LOG();

if constexpr (Feature_NearbyFontLoading::IsEnabled())
if (!face)
{
if (!face)
// If we missed, try looking a little more by trimming the last word off the requested family name a few times.
// Quite often, folks are specifying weights or something in the familyName and it causes failed resolution and
// an unexpected error dialog. We theoretically could detect the weight words and convert them, but this
// is the quick fix for the majority scenario.
// The long/full fix is backlogged to GH#9744
// Also this doesn't count as a fallback because we don't want to annoy folks with the warning dialog over
// this resolution.
while (!face && !_familyName.empty())
{
_fontCollection = FontCache::GetCached();
face = _FindFontFace(localeName);
const auto lastSpace = _familyName.find_last_of(UNICODE_SPACE);

// value is unsigned and npos will be greater than size.
// if we didn't find anything to trim, leave.
if (lastSpace >= _familyName.size())
{
break;
}

// trim string down to just before the found space
// (space found at 6... trim from 0 for 6 length will give us 0-5 as the new string)
_familyName = _familyName.substr(0, lastSpace);

try
{
// Try to find it with the shortened family name
face = _FindFontFace(localeName);
}
CATCH_LOG();
}
}

Expand All @@ -176,7 +184,12 @@ void DxFontInfo::SetFromEngine(const std::wstring_view familyName,
{
_familyName = fallbackFace;

face = _FindFontFace(localeName);
try
{
face = _FindFontFace(localeName);
}
CATCH_LOG();

if (face)
{
_didFallback = true;
Expand Down
Loading