コード例 #1
0
ファイル: Conversions.cs プロジェクト: JohnACarruthers/Eto
        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;           
        }
コード例 #2
0
ファイル: Conversions.cs プロジェクト: alexandrebaker/Eto
		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;
		}
コード例 #3
0
ファイル: Conversions.cs プロジェクト: JohnACarruthers/Eto
        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;
        }