Esempio n. 1
0
        // Methods to read primitive data types from the stream

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