public Font(string familyName, double emHeight, FontWeightAttributeValue weight, FontStyleAttributeValue style)
 {
     LeftToRight = true;
     m_familyName = familyName;
     m_size = emHeight;
     switch (style)
     {
         case FontStyleAttributeValue.Italic:
             m_style = System.Windows.FontStyles.Italic;
             break;
         case FontStyleAttributeValue.Oblique:
             m_style = System.Windows.FontStyles.Italic;
             break;
         case FontStyleAttributeValue.ReverseOblique:
             m_style = System.Windows.FontStyles.Italic;
             break;
         default:
             m_style = System.Windows.FontStyles.Normal;
             break;
     }
     switch (weight)
     {
         case FontWeightAttributeValue.Bold: m_weight = System.Windows.FontWeights.Bold;
             break;
         default:
             m_weight = System.Windows.FontWeights.Normal;
             break;
     }
     m_stretch = 1.0;
  }
Пример #2
0
        public Font(string familyName, double emHeight, FontWeightAttributeValue weight, FontStyleAttributeValue style)
        {
            LeftToRight  = true;
            m_familyName = familyName;
            m_size       = emHeight;
            switch (style)
            {
            case FontStyleAttributeValue.Italic:
                m_style = FontStyles.Italic;
                break;

            case FontStyleAttributeValue.Oblique:
                m_style = FontStyles.Italic;
                break;

            case FontStyleAttributeValue.ReverseOblique:
                m_style = FontStyles.Italic;
                break;

            default:
                m_style = FontStyles.Normal;
                break;
            }
            switch (weight)
            {
            case FontWeightAttributeValue.Bold: m_weight = FontWeights.Bold;
                break;

            default:
                m_weight = FontWeights.Normal;
                break;
            }
            m_stretch = 1.0;
        }