Exemple #1
0
        public static CFFTable Read(BinaryReaderFont reader)
        {
            long     position = reader.Position;
            CFFTable value    = new CFFTable();

            value.position = reader.Position;
            value.filePath = reader.FilePath;
            value.major    = reader.ReadByte();
            value.minor    = reader.ReadByte();
            value.hdrSize  = reader.ReadByte();
            value.offSize  = reader.ReadByte();

            reader.Position = position + value.hdrSize;
            value.ReadName(reader);
            value.ReadTopDict(reader);
            value.ReadString(reader);
            value.ReadGlobalSubr(reader);

            CFFTopDict topDict = value.topDict;

            //if (topDict.CharStrings > 0) {
            //	reader.Position = position + topDict.CharStrings;
            //	value.ReadCharStrings(reader);
            //}

            if (topDict.FDSelect > 0)
            {
                reader.Position = position + topDict.FDSelect;
                value.fdSelect  = CFFFDSelect.Read(reader);
            }

            if (topDict.charset > 0)
            {
                reader.Position = position + topDict.charset;
                //value.charsets = CFFCharset.Read(reader, value.CharStringsIndex.count);
            }

            if (topDict.Private.values[0] > 0)
            {
                reader.Position = position + (int)topDict.Private.values[1];
                value.ReadPrivate(reader);
            }

            //Console.WriteLine("Charset: " + value.charsets);
            //Console.WriteLine("Docode: {0}", CFFCharString.Decode(value.charStrings[0]));

            //index = CFFIndex.Read(reader);
            //Console.WriteLine("index ::4 " + index);
            return(value);
        }
Exemple #2
0
        public static CFFFDSelect Read(BinaryReaderFont reader)
        {
            CFFFDSelect fdSelect = null;
            byte        format   = reader.PeekByte();

            switch (format)
            {
            case 0:
                fdSelect = CFFFDSelect0.Read(reader);
                break;

            case 3:
                fdSelect = CFFFDSelect3.Read(reader);
                break;
            }
            return(fdSelect);
        }