Beispiel #1
0
        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));
        }
Beispiel #2
0
 private static string GetTypeFace(this Word.RunPropertiesDefault runPropertiesDefault, Draw.Theme theme)
 {
     return(runPropertiesDefault.RunPropertiesBaseStyle.RunFonts.Ascii
            ?? theme.ThemeElements.FontScheme.MinorFont.LatinFont.Typeface);
 }