예제 #1
0
        public static FigletFont Load(string filePath)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }

            return(FigletFont.Parse(File.ReadLines(filePath)));
        }
예제 #2
0
        public static FigletFont Parse(string fontContent)
        {
            if (fontContent == null)
            {
                throw new ArgumentNullException(nameof(fontContent));
            }

            return(FigletFont.Parse(fontContent.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None)));
        }
예제 #3
0
        public static FigletFont Load(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            List <string> fontLines = new List <string>();

            using (StreamReader streamReader = new StreamReader(stream))
            {
                while (!streamReader.EndOfStream)
                {
                    fontLines.Add(streamReader.ReadLine());
                }
            }

            return(FigletFont.Parse(fontLines));
        }