static void Main(string[] args) { SampleClient.TestUsage(); var value = ""; var fig = new Figlet(); fig.PrepareAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789."); while (value.ToLower() != "quit") { System.Console.Write("Enter text to be converted (Quit for exit) :"); value = System.Console.ReadLine(); var asciiart = fig.ToAsciiArt(value); System.Console.WriteLine(asciiart); var recognize = fig.RecognizeAsciiArt(asciiart); System.Console.WriteLine("OCR-ArtASCII: {0}", recognize); } }
public string GetASCIIartFromFont(string text) { var figlet = new Figlet("Fonts/Alphabet"); string content = figlet.ToAsciiArt(text.Replace('|', '\n')); content = content.Replace('A', '█'); content = content.Replace('B', '█'); content = content.Replace('C', '█'); content = content.Replace('D', '█'); content = content.Replace('E', '█'); content = content.Replace('F', '█'); content = content.Replace('G', '█'); content = content.Replace('H', '█'); content = content.Replace('I', '█'); content = content.Replace('J', '█'); content = content.Replace('K', '█'); content = content.Replace('L', '█'); content = content.Replace('M', '█'); content = content.Replace('N', '█'); content = content.Replace('O', '█'); content = content.Replace('P', '█'); content = content.Replace('Q', '█'); content = content.Replace('R', '█'); content = content.Replace('S', '█'); content = content.Replace('T', '█'); content = content.Replace('U', '█'); content = content.Replace('V', '█'); content = content.Replace('W', '█'); content = content.Replace('Z', '█'); content = content.Replace('X', '█'); content = content.Replace('Y', '█'); content = content.Replace('a', '█'); content = content.Replace('b', '█'); content = content.Replace('c', '█'); content = content.Replace('d', '█'); content = content.Replace('e', '█'); content = content.Replace('f', '█'); content = content.Replace('g', '█'); content = content.Replace('h', '█'); content = content.Replace('i', '█'); content = content.Replace('j', '█'); content = content.Replace('k', '█'); content = content.Replace('l', '█'); content = content.Replace('m', '█'); content = content.Replace('n', '█'); content = content.Replace('o', '█'); content = content.Replace('p', '█'); content = content.Replace('q', '█'); content = content.Replace('r', '█'); content = content.Replace('s', '█'); content = content.Replace('t', '█'); content = content.Replace('u', '█'); content = content.Replace('v', '█'); content = content.Replace('w', '█'); content = content.Replace('z', '█'); content = content.Replace('x', '█'); content = content.Replace('y', '█'); content = content.Replace('0', '█'); content = content.Replace('1', '█'); content = content.Replace('2', '█'); content = content.Replace('3', '█'); content = content.Replace('4', '█'); content = content.Replace('5', '█'); content = content.Replace('6', '█'); content = content.Replace('7', '█'); content = content.Replace('8', '█'); content = content.Replace('9', '█'); content = content.Replace('.', '█'); content = content.Replace(',', '█'); content = content.Replace(':', '█'); content = content.Replace(';', '█'); content = content.Replace('\'', '█'); return(content); }