// Methods to read primitive data types from the stream private short ReadShort(RandomAccessFileOrArray stream) { if (isBigEndian) { return stream.ReadShort(); } else { return stream.ReadShortLE(); } }
private void Openpfm() { inp.Seek(0); vers = inp.ReadShortLE(); h_len = inp.ReadIntLE(); copyright = ReadString(60); type = inp.ReadShortLE(); points = inp.ReadShortLE(); verres = inp.ReadShortLE(); horres = inp.ReadShortLE(); ascent = inp.ReadShortLE(); intleading = inp.ReadShortLE(); extleading = inp.ReadShortLE(); italic = (byte)inp.Read(); uline = (byte)inp.Read(); overs = (byte)inp.Read(); weight = inp.ReadShortLE(); charset = (byte)inp.Read(); pixwidth = inp.ReadShortLE(); pixheight = inp.ReadShortLE(); kind = (byte)inp.Read(); avgwidth = inp.ReadShortLE(); maxwidth = inp.ReadShortLE(); firstchar = inp.Read(); lastchar = inp.Read(); defchar = (byte)inp.Read(); brkchar = (byte)inp.Read(); widthby = inp.ReadShortLE(); device = inp.ReadIntLE(); face = inp.ReadIntLE(); bits = inp.ReadIntLE(); bitoff = inp.ReadIntLE(); extlen = inp.ReadShortLE(); psext = inp.ReadIntLE(); chartab = inp.ReadIntLE(); res1 = inp.ReadIntLE(); kernpairs = inp.ReadIntLE(); res2 = inp.ReadIntLE(); fontname = inp.ReadIntLE(); if (h_len != inp.Length || extlen != 30 || fontname < 75 || fontname > 512) { throw new IOException(MessageLocalization.GetComposedMessage("not.a.valid.pfm.file")); } inp.Seek(psext + 14); capheight = inp.ReadShortLE(); xheight = inp.ReadShortLE(); ascender = inp.ReadShortLE(); descender = inp.ReadShortLE(); }