Пример #1
0
 private LRTF.FontStyle Convert(XD.FontStyle fontStyle)
 {
     if (fontStyle == XD.FontStyle.Italic || fontStyle == XD.FontStyle.Oblique)
     {
         return(LRTF.FontStyle.Italic);
     }
     return(LRTF.FontStyle.Normal);
 }
Пример #2
0
        public static SW.FontStyle ToWpfFontStyle(this FontStyle value)
        {
            if (value == FontStyle.Italic)
            {
                return(SW.FontStyles.Italic);
            }
            if (value == FontStyle.Oblique)
            {
                return(SW.FontStyles.Oblique);
            }

            return(SW.FontStyles.Normal);
        }
Пример #3
0
        public static SD.FontStyle ToGdi(this FontStyle style, FontWeight weight)
        {
            var result = SD.FontStyle.Regular;

            if (FontStyle.Italic == style || FontStyle.Oblique == style)
            {
                result |= SD.FontStyle.Italic;
            }
            if (FontWeight.Heavy == weight || FontWeight.Bold == weight || FontWeight.Ultrabold == weight)
            {
                result |= SD.FontStyle.Bold;
            }
            return(result);
        }
Пример #4
0
        public static SD.FontStyle ToDrawingFontStyle(this FontStyle value)
        {
            switch (value)
            {
            case FontStyle.Normal:
                return(SD.FontStyle.Regular);

            case FontStyle.Italic:
                return(SD.FontStyle.Italic);

            default:
                throw new NotImplementedException();
            }
        }
Пример #5
0
        public static SD.FontStyle ToGdi(this FontStyle value)
        {
            var result = SD.FontStyle.Regular;

            if (value == null)
            {
                return(result);
            }
            if ((value & FontStyle.Italic) != 0)
            {
                result |= SD.FontStyle.Italic;
            }
            //if ((value & FontStyle.Underline) != 0) {
            //    result |= SD.FontStyle.Underline;
            //}
            if ((value & FontStyle.Oblique) != 0)
            {
                result |= SD.FontStyle.Bold;
            }
            return(result);
        }