static void ProcessFontFile(string path, IGlyphVisitor visitor) { var families = Fonts.GetFontFamilies(path); foreach (FontFamily family in families) { ProcessFontFamily(family, visitor); } }
private static void ProcessGlyphInterface(GlyphTypeface glyph, IGlyphVisitor visitor) { IDictionary <int, ushort> characterMap = glyph.CharacterToGlyphMap; StringBuilder builder = new StringBuilder(); foreach (var kvp in characterMap) { visitor.GlyphFound(kvp.Key); } }
private static void ProcessFontFamily(FontFamily family, IGlyphVisitor visitor) { string fontFamilyName = family.FamilyNames.FirstOrDefault(a => a.Key.IetfLanguageTag.StartsWith("en")).Value; var typefaces = family.GetTypefaces(); foreach (Typeface typeface in typefaces) { ProcessTypeface(fontFamilyName, typeface, visitor); } }
public override void Accept(IGlyphVisitor visitor) { visitor.Visit (this); }
public override void Accept(IGlyphVisitor visitor) { visitor.Visit(this); }
public virtual void Accept(IGlyphVisitor visitor) { visitor.Visit(this); }
public virtual void Accept(IGlyphVisitor visitor) { visitor.Visit (this); }
private static void ProcessTypeface(string fontFamilyName, Typeface typeface, IGlyphVisitor visitor) { GlyphTypeface glyph = null; typeface.TryGetGlyphTypeface(out glyph); if (glyph != null) { visitor.Started(fontFamilyName, typeface.Style.ToString(), typeface.Weight.ToString()); ProcessGlyphInterface(glyph, visitor); visitor.Completed(); } }