Esempio n. 1
0
        public static GposAnchor ReadGposAnchor(OpenTypeFontTableReader tableReader, int location)
        {
            if (location == 0)
            {
                return(null);
            }
            tableReader.rf.Seek(location);
            int        format = tableReader.rf.ReadUnsignedShort();
            GposAnchor t      = null;

            switch (format)
            {
            default: {
                t             = new GposAnchor();
                t.XCoordinate = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
                t.YCoordinate = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
                break;
            }
            }
            return(t);
        }
Esempio n. 2
0
        public static GposValueRecord ReadGposValueRecord(OpenTypeFontTableReader tableReader, int mask)
        {
            GposValueRecord vr = new GposValueRecord();

            if ((mask & 0x0001) != 0)
            {
                vr.XPlacement = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
            }
            if ((mask & 0x0002) != 0)
            {
                vr.YPlacement = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
            }
            if ((mask & 0x0004) != 0)
            {
                vr.XAdvance = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
            }
            if ((mask & 0x0008) != 0)
            {
                vr.YAdvance = tableReader.rf.ReadShort() * 1000 / tableReader.GetUnitsPerEm();
            }
            if ((mask & 0x0010) != 0)
            {
                tableReader.rf.Skip(2);
            }
            if ((mask & 0x0020) != 0)
            {
                tableReader.rf.Skip(2);
            }
            if ((mask & 0x0040) != 0)
            {
                tableReader.rf.Skip(2);
            }
            if ((mask & 0x0080) != 0)
            {
                tableReader.rf.Skip(2);
            }
            return(vr);
        }