Exemple #1
0
        public static void Convert(
            FontStyle value, 
            out sw.FontStyle fontStyle,
            out sw.FontWeight fontWeight)
        {
            fontStyle = sw.FontStyle.Normal;
            fontWeight = sw.FontWeight.Normal;

            if ((value & FontStyle.Italic) == FontStyle.Italic)
                fontStyle = sw.FontStyle.Italic;

            if ((value & FontStyle.Bold) == FontStyle.Bold)
                fontWeight = sw.FontWeight.Bold;           
        }
Exemple #2
0
		public static void Convert(FontStyle value, out sw.FontStyle fontStyle, out sw.FontWeight fontWeight)
		{
			fontStyle = sw.FontStyle.Normal;
			fontWeight = sw.FontWeight.Normal;

			if (value.HasFlag(FontStyle.Italic))
				fontStyle = sw.FontStyle.Italic;

			if (value.HasFlag(FontStyle.Bold))
				fontWeight = sw.FontWeight.Bold;
		}
Exemple #3
0
        public static FontStyle Convert(sw.FontStyle fontStyle, sw.FontWeight fontWeight)
        {
            var style = FontStyle.Normal;
            if (fontStyle == sw.FontStyle.Italic)
                style |= FontStyle.Italic;
            if (fontStyle == sw.FontStyle.Oblique)
                style |= FontStyle.Italic;

            if (fontWeight == sw.FontWeight.Bold)
                style |= FontStyle.Bold;
            return style;
        }