Beispiel #1
0
        private void LoadTableInfo(
            )
        {
            // 1. Offset Table.
            FontData.Seek(0);
            // Get the outline format!
            this.OutlineFormat = GetOutlineFormat(FontData.ReadInt());
            // Get the number of tables!
            int tableCount = FontData.ReadUnsignedShort();

            // 2. Table Directory.
            // Skip to the beginning of the table directory!
            FontData.Skip(6);
            // Collecting the table offsets...
            tableOffsets = new Dictionary <string, int>(tableCount);
            for (
                int index = 0;
                index < tableCount;
                index++
                )
            {
                // Get the table tag!
                String tag = ReadAsciiString(4);
                // Skip to the table offset!
                FontData.Skip(4);
                // Get the table offset!
                int offset = FontData.ReadInt();
                // Collect the table offset!
                tableOffsets[tag] = offset;

                // Skip to the next entry!
                FontData.Skip(4);
            }
        }
Beispiel #2
0
        private void LoadTableInfo(
            )
        {
            // 1. Offset Table.
            FontData.Seek(4);
            int tableCount = FontData.ReadUnsignedShort();

            // 2. Table Directory.
            // Skip to the beginning of the table directory!
            FontData.Skip(6);
            // Collecting the table offsets...
            tableOffsets = new Dictionary <string, int>(tableCount);
            for (
                int index = 0;
                index < tableCount;
                index++
                )
            {
                // Get the table tag!
                String tag = ReadAsciiString(4);
                // Skip to the table offset!
                FontData.Skip(4);
                // Get the table offset!
                int offset = FontData.ReadInt();
                // Collect the table offset!
                tableOffsets[tag] = offset;

                // Skip to the next entry!
                FontData.Skip(4);
            }
            OutlineFormat = (tableOffsets.ContainsKey(TableName_CFF) ? OutlineFormatEnum.PostScript : OutlineFormatEnum.TrueType);
        }
Beispiel #3
0
        /**
         * <summary>Loads the font data.</summary>
         */
        private void Load(
            )
        {
            Metrics = new FontMetrics();

            // 1. Offset Table.
            FontData.Seek(0);
            // Get the outline format!
            this.OutlineFormat = GetOutlineFormat(FontData.ReadInt());
            // Get the number of tables!
            int tableCount = FontData.ReadUnsignedShort();

            tableOffsets = new Dictionary <string, int>(tableCount);

            // 2. Table Directory.
            // Skip to the beginning of the table directory!
            FontData.Skip(6);
            // Collecting the table offsets...
            for (
                int index = 0;
                index < tableCount;
                index++
                )
            {
                // Get the table tag!
                String tag = ReadAsciiString(4);
                // Skip to the table offset!
                FontData.Skip(4);
                // Get the table offset!
                int offset = FontData.ReadInt();
                // Collect the table offset!
                tableOffsets[tag] = offset;

                // Skip to the next entry!
                FontData.Skip(4);
            }

            FontName = Load_GetName(NameID_FontPostscriptName);

            Load_Tables();
            Load_CMap();
            Load_GlyphWidths();
            Load_GlyphKerning();
        }
        private void LoadTableInfo(
      )
        {
            // 1. Offset Table.
              FontData.Seek(0);
              // Get the outline format!
              this.OutlineFormat = GetOutlineFormat(FontData.ReadInt());
              // Get the number of tables!
              int tableCount = FontData.ReadUnsignedShort();

              // 2. Table Directory.
              // Skip to the beginning of the table directory!
              FontData.Skip(6);
              // Collecting the table offsets...
              tableOffsets = new Dictionary<string,int>(tableCount);
              for(
            int index = 0;
            index < tableCount;
            index++
            )
              {
            // Get the table tag!
            String tag = ReadAsciiString(4);
            // Skip to the table offset!
            FontData.Skip(4);
            // Get the table offset!
            int offset = FontData.ReadInt();
            // Collect the table offset!
            tableOffsets[tag] = offset;

            // Skip to the next entry!
            FontData.Skip(4);
              }
        }