public TextRecognizer(List <FontFamily> families, List <FontStyle> styles, int size_start, int size_end, int spacing) { fonts = new List <FontCharCollection>(); matcher = new FontCharMatcher(); foreach (FontFamily family in families) { for (int size = size_start; size <= size_end; size += spacing) { foreach (FontStyle style in styles) { if (family.IsStyleAvailable(style)) { Font font = new Font(family, size, style, GraphicsUnit.Pixel); //Console.WriteLine("Processing font: {0} [{1}, {2}]", family.GetName(0), size, style); FontCharCollection fcc = new FontCharCollection(font); for (int i = 33; i <= 128; i++) { fcc.Add(new FontChar(fcc, (char)i)); } fcc.Add(new FontChar(fcc, '€')); // Add € symbol. fcc.SortBySize(); fonts.Add(fcc); matcher.Add(fcc); } } } } }
public TextRecognizer(List<FontFamily> families, List<FontStyle> styles, int size_start, int size_end, int spacing) { fonts = new List<FontCharCollection>(); matcher = new FontCharMatcher(); foreach (FontFamily family in families) { for (int size = size_start; size <= size_end; size += spacing) { foreach (FontStyle style in styles) { if (family.IsStyleAvailable(style)) { Font font = new Font(family, size, style, GraphicsUnit.Pixel); //Console.WriteLine("Processing font: {0} [{1}, {2}]", family.GetName(0), size, style); FontCharCollection fcc = new FontCharCollection(font); for (int i = 33; i <= 128; i++) fcc.Add(new FontChar(fcc, (char)i)); fcc.Add(new FontChar(fcc, '€')); // Add € symbol. fcc.SortBySize(); fonts.Add(fcc); matcher.Add(fcc); } } } } }