Exemplo n.º 1
0
        public void TestLoad()
        {
            FontBasisRecord record = new FontBasisRecord(TestcaseRecordInputStream.Create((short)0x1060, data));

            Assert.AreEqual(0x1a28, record.XBasis);
            Assert.AreEqual(0x0f9c, record.YBasis);
            Assert.AreEqual(0xc8, record.HeightBasis);
            Assert.AreEqual(0x00, record.Scale);
            Assert.AreEqual(0x05, record.IndexToFontTable);


            Assert.AreEqual(14, record.RecordSize);
        }
Exemplo n.º 2
0
        public void TestLoad()
        {

            FontBasisRecord record = new FontBasisRecord(TestcaseRecordInputStream.Create((short)0x1060, data));
            Assert.AreEqual(0x1a28, record.XBasis);
            Assert.AreEqual(0x0f9c, record.YBasis);
            Assert.AreEqual(0xc8, record.HeightBasis);
            Assert.AreEqual(0x00, record.Scale);
            Assert.AreEqual(0x05, record.IndexToFontTable);


            Assert.AreEqual(14, record.RecordSize);
        }
Exemplo n.º 3
0
        public void TestStore()
        {
            FontBasisRecord record = new FontBasisRecord();
            record.XBasis = ((short)0x1a28);
            record.YBasis = ((short)0x0f9c);
            record.HeightBasis = ((short)0xc8);
            record.Scale = ((short)0x00);
            record.IndexToFontTable = ((short)0x05);

            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
        }
Exemplo n.º 4
0
        public void TestStore()
        {
            FontBasisRecord record = new FontBasisRecord();

            record.XBasis           = ((short)0x1a28);
            record.YBasis           = ((short)0x0f9c);
            record.HeightBasis      = ((short)0xc8);
            record.Scale            = ((short)0x00);
            record.IndexToFontTable = ((short)0x05);

            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
            {
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
            }
        }
Exemplo n.º 5
0
 private FontBasisRecord CreateFontBasisRecord1()
 {
     FontBasisRecord r = new FontBasisRecord();
     r.XBasis = ((short)9120);
     r.YBasis = ((short)5640);
     r.HeightBasis = ((short)200);
     r.Scale = ((short)0);
     r.IndexToFontTable = ((short)5);
     return r;
 }