From 7094675d5e9eeb4643199094b66e861f0c561aa3 Mon Sep 17 00:00:00 2001 From: Yeechan Lu Date: Tue, 25 Mar 2014 17:00:40 +0800 Subject: [PATCH] Fix a bug with family typefaces --- Wox/Helper/FontHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wox/Helper/FontHelper.cs b/Wox/Helper/FontHelper.cs index 9064a2bf34..6ecba4f48f 100644 --- a/Wox/Helper/FontHelper.cs +++ b/Wox/Helper/FontHelper.cs @@ -55,7 +55,7 @@ namespace Wox.Helper return Math.Abs(o.Stretch.ToOpenTypeStretch() - FontStretches.Normal.ToOpenTypeStretch()) * 100 + Math.Abs(o.Weight.ToOpenTypeWeight() - FontWeights.Normal.ToOpenTypeWeight()) + (o.Style == FontStyles.Normal ? 0 : o.Style == FontStyles.Oblique ? 1 : 2) * 1000; - }).FirstOrDefault(); + }).FirstOrDefault() ?? family.FamilyTypefaces.FirstOrDefault(); } public static FamilyTypeface ConvertFromInvariantStringsOrNormal(this FontFamily family, string style, string weight, string stretch)