mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
Fix performance issues while loading fonts
This commit is contained in:
@@ -60,7 +60,10 @@ namespace Wox.Helper
|
|||||||
|
|
||||||
public static FamilyTypeface ConvertFromInvariantStringsOrNormal(this FontFamily family, string style, string weight, string stretch)
|
public static FamilyTypeface ConvertFromInvariantStringsOrNormal(this FontFamily family, string style, string weight, string stretch)
|
||||||
{
|
{
|
||||||
return family.FamilyTypefaces.FirstOrDefault(o => o.Style == GetFontStyleFromInvariantStringOrNormal(style) && o.Weight == GetFontWeightFromInvariantStringOrNormal(weight) && o.Stretch == GetFontStretchFromInvariantStringOrNormal(stretch))
|
var styleObj = GetFontStyleFromInvariantStringOrNormal(style);
|
||||||
|
var weightObj = GetFontWeightFromInvariantStringOrNormal(weight);
|
||||||
|
var stretchObj = GetFontStretchFromInvariantStringOrNormal(stretch);
|
||||||
|
return family.FamilyTypefaces.FirstOrDefault(o => o.Style == styleObj && o.Weight == weightObj && o.Stretch == stretchObj)
|
||||||
?? family.ChooseRegularFamilyTypeface();
|
?? family.ChooseRegularFamilyTypeface();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user