示例#1
0
        public static FontWeight ToFontWeight(
            this global::Windows.UI.Text.FontWeight xamlFontWeight)
        {
            FontWeight fontWeight;

            if (xamlFontWeight.Weight == global::Windows.UI.Text.FontWeights.Normal.Weight)
            {
                fontWeight = FontWeight.Medium;
            }
            else if (xamlFontWeight.Weight == global::Windows.UI.Text.FontWeights.Light.Weight)
            {
                fontWeight = FontWeight.Light;
            }
            else if (xamlFontWeight.Weight == global::Windows.UI.Text.FontWeights.SemiLight.Weight)
            {
                fontWeight = FontWeight.Normal;
            }
            else if (xamlFontWeight.Weight == global::Windows.UI.Text.FontWeights.SemiBold.Weight)
            {
                fontWeight = FontWeight.SemiBold;
            }
            else if (xamlFontWeight.Weight == global::Windows.UI.Text.FontWeights.Bold.Weight)
            {
                fontWeight = FontWeight.Bold;
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(xamlFontWeight), xamlFontWeight, "Unsupported font weight.");
            }

            return(fontWeight);
        }
 public static FontWeight FromWinUIFontWeight(global::Windows.UI.Text.FontWeight fontWeight) =>
 new FontWeight((ushort)fontWeight.ToOpenTypeWeight());
示例#3
0
 /// <summary></summary>
 public global::Microsoft.Graphics.Canvas.Text.CanvasFontSet GetMatchingFontsFromProperties(global::System.String familyName, global::Windows.UI.Text.FontWeight weight, global::Windows.UI.Text.FontStretch stretch, global::Windows.UI.Text.FontStyle style)
 {
     throw new System.NotImplementedException();
 }