Пример #1
0
        public BMPFontTextLoader(Stream stream)
        {
            this.stream = stream;
            StreamReader reader = new StreamReader(stream);

            this.reader = new BMPFontReader(reader);
        }
Пример #2
0
        public BMPFontBinaryLoader(Stream stream)
        {
            this.stream = stream;

            BinaryReader binaryReader = new BinaryReader(stream, Encoding.ASCII);

            r = new BMPFontReader(binaryReader);

            char fid1 = (char)r.ReadByte();
            char fid2 = (char)r.ReadByte();
            char fid3 = (char)r.ReadByte();

            if (fid1 != 'B' || fid2 != 'M' || fid3 != 'F')
            {
                throw new InvalidDataException("Failed to load binary angel font, specified file is not a binary angel bmp file!");
            }

            byte version = r.ReadByte();

            if (version != 3)
            {
                throw new NotSupportedException("Failed to load binary angel font, only version 3 is currently supported!");
            }
        }