public static TextStyle CreateTextStyle(this Word.RunPropertiesDefault runPropertiesDefault, Draw.Theme theme) { var typeFace = runPropertiesDefault.GetTypeFace(theme); var fontStyle = runPropertiesDefault.RunPropertiesBaseStyle.EffectiveFontStyle(); var size = runPropertiesDefault.RunPropertiesBaseStyle.FontSize.ToDouble(11); var brush = runPropertiesDefault.RunPropertiesBaseStyle.Color.ToColor(); var font = new Font(typeFace, (float)size, fontStyle); return(new TextStyle(font, brush, Color.Empty)); }
private static string GetTypeFace(this Word.RunPropertiesDefault runPropertiesDefault, Draw.Theme theme) { return(runPropertiesDefault.RunPropertiesBaseStyle.RunFonts.Ascii ?? theme.ThemeElements.FontScheme.MinorFont.LatinFont.Typeface); }