Fix a bug with family typefaces

This commit is contained in:
Yeechan Lu 2014-03-25 17:00:40 +08:00
parent cf7ae90097
commit 7094675d5e

View File

@ -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)