diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-08-06 10:17:09 +0300 |
---|---|---|
committer | Mike Krüger <mikkrg@microsoft.com> | 2019-08-06 15:16:26 +0300 |
commit | 25e59ed2e9e5d19efb9811aa9d17cff9f616b34c (patch) | |
tree | d76d7b2d8b6826654d6ed6634a1323ed4c501cb5 /Xwt.WPF | |
parent | 56e6cc5a213f92ff54d1fa6578f6afddff210633 (diff) |
Added support for mac font weights that range from 0-15.
Diffstat (limited to 'Xwt.WPF')
-rw-r--r-- | Xwt.WPF/Xwt.WPFBackend/DataConverter.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Xwt.WPF/Xwt.WPFBackend/DataConverter.cs b/Xwt.WPF/Xwt.WPFBackend/DataConverter.cs index e65597a8..73e91f2c 100644 --- a/Xwt.WPF/Xwt.WPFBackend/DataConverter.cs +++ b/Xwt.WPF/Xwt.WPFBackend/DataConverter.cs @@ -211,18 +211,24 @@ namespace Xwt.WPFBackend public static SW.FontWeight ToWpfFontWeight (this FontWeight value)
{
+ if (value == FontWeight.Ultrathin) return SW.FontWeights.Thin;
if (value == FontWeight.Thin) return SW.FontWeights.Thin;
if (value == FontWeight.Ultralight) return SW.FontWeights.UltraLight;
if (value == FontWeight.Light) return SW.FontWeights.Light;
if (value == FontWeight.Semilight) return SW.FontWeights.Light;
if (value == FontWeight.Book) return SW.FontWeights.Normal;
+ if (value == FontWeight.Normal) return SW.FontWeights.Normal;
if (value == FontWeight.Medium) return SW.FontWeights.Medium;
+ if (value == FontWeight.Mediumbold) return SW.FontWeights.Medium;
if (value == FontWeight.Semibold) return SW.FontWeights.SemiBold;
if (value == FontWeight.Bold) return SW.FontWeights.Bold;
if (value == FontWeight.Ultrabold) return SW.FontWeights.UltraBold;
if (value == FontWeight.Heavy) return SW.FontWeights.Black;
- if (value == FontWeight.Ultraheavy) return SW.FontWeights.UltraBlack;
-
+ if (value == FontWeight.Ultraheavy) return SW.FontWeights.UltraBlack; + if (value == FontWeight.Semiblack) return SW.FontWeights.UltraBlack;
+ if (value == FontWeight.Black) return SW.FontWeights.UltraBlack;
+ if (value == FontWeight.Ultrablack) return SW.FontWeights.UltraBlack;
+
return SW.FontWeights.Normal;
}
|