private static string GetFontName(FontInfo info) { return(info.FontFamily.Source); }
private static float GetFontSize(FontInfo info) { float fontSize = (float)info.FontSize * 72f / 96f; return(fontSize); }
/// <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; }
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; }
private static float GetFontSize(FontInfo info) { float fontSize = (float)info.FontSize * 72f / 96f; return fontSize; }
private static string GetFontName(FontInfo info) { return info.FontFamily.Source; }