public static FontWeight ToXwtWeight(SD.FontStyle style) { if (style == SD.FontStyle.Bold) { return(FontWeight.Bold); } return(FontWeight.Normal); }
// // Font // public static SD.Font ToDrawingFont(this Font font) { SD.FontStyle style = font.Style.ToDrawingFontStyle(); if (font.Weight > FontWeight.Normal) { style |= SD.FontStyle.Bold; } return(new SD.Font(font.Family, (float)font.Size, style)); }
public static FontStyle ToXwt(this SD.FontStyle value) { var result = FontStyle.Normal; if (value == null) { return(result); } if ((value & SD.FontStyle.Italic) != 0) { result |= FontStyle.Italic; } //if ((value & SD.FontStyle.Underline) != 0) { // result |= FontStyle.Underline; //} if ((value & SD.FontStyle.Bold) != 0) { result |= FontStyle.Oblique; } return(result); }