Ejemplo n.º 1
0
 private static string GetFontName(FontInfo info)
 {
     return(info.FontFamily.Source);
 }
Ejemplo n.º 2
0
        private static float GetFontSize(FontInfo info)
        {
            float fontSize = (float)info.FontSize * 72f / 96f;

            return(fontSize);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the font.
 /// </summary>
 /// <param name="family">The family.</param>
 /// <param name="size">The size.</param>
 /// <param name="style">The style.</param>
 /// <param name="weight">The weight.</param>
 /// <param name="method">The method.</param>
 public void AddFont(FontFamily family, double size, FontStyle style, FontWeight weight, CodeMemberMethod method)
 {
     FontInfo info = new FontInfo(family, size, style, weight);
     fonts[info.GetHashCode()] = info;            
 }
Ejemplo n.º 4
0
        private static string GetFontStyle(FontInfo info)
        {
            string fontStyle = "Regular";
            if (info.FontWeight == FontWeights.Bold)
            {
                fontStyle = "Bold";
            }

            if (info.FontStyle == FontStyles.Italic)
            {
                if (info.FontWeight == FontWeights.Regular || info.FontWeight == FontWeights.Normal)
                {
                    fontStyle = "Italic";
                }
                if (info.FontWeight == FontWeights.Bold)
                {
                    fontStyle = "Bold, Italic";
                }
            }

            return fontStyle;
        }
Ejemplo n.º 5
0
 private static float GetFontSize(FontInfo info)
 {
     float fontSize = (float)info.FontSize * 72f / 96f;
     return fontSize;
 }
Ejemplo n.º 6
0
 private static string GetFontName(FontInfo info)
 {
     return info.FontFamily.Source;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Adds the font.
        /// </summary>
        /// <param name="family">The family.</param>
        /// <param name="size">The size.</param>
        /// <param name="style">The style.</param>
        /// <param name="weight">The weight.</param>
        /// <param name="method">The method.</param>
        public void AddFont(FontFamily family, double size, FontStyle style, FontWeight weight, CodeMemberMethod method)
        {
            FontInfo info = new FontInfo(family, size, style, weight);

            fonts[info.GetHashCode()] = info;
        }