Пример #1
0
        public MyFont(string filename)
        {
            FontInterpretator fi   = new FontInterpretator();
            string            line = "";

            symbols     = new List <Symbol>();
            symbolWidth = 100;
            StreamReader sr = new StreamReader(filename);

            line = sr.ReadLine();
            if (line == null)
            {
                return;
            }
            symbolWidth = Convert.ToInt32(line);
            while (true)
            {
                line = sr.ReadLine();
                if (line == null)
                {
                    break;
                }
                symbols.Add(fi.SymbolFromString(line));
            }
            sr.Close();
        }
Пример #2
0
        public MyFont Load(string filename)
        {
            MyFont            font = new MyFont();
            FontInterpretator fi   = new FontInterpretator();
            string            line = "";
            StreamReader      sr   = new StreamReader(filename);

            line = sr.ReadLine();
            if (line == null)
            {
                return(font);
            }

            while (true)
            {
                line = sr.ReadLine();
                if (line == null)
                {
                    break;
                }
                font.symbols.Add(fi.SymbolFromString(line));
            }
            sr.Close();
            return(font);
        }