PdfSharp.Fonts.OpenType.IndexToLocationTable.Read C# (CSharp) Method

Read() public method

Converts the bytes in a handy representation
public Read ( ) : void
return void
    public void Read()
    {
      try
      {
        ShortIndex = this.fontData.head.indexToLocFormat == 0;
        this.fontData.Position = DirectoryEntry.Offset;
        if (ShortIndex)
        {
          int entries = DirectoryEntry.Length / 2;
          Debug.Assert(this.fontData.maxp.numGlyphs + 1 == entries,
            "For your information only: Number of glyphs mismatch in font. You can ignore this assertion.");
          this.locaTable = new int[entries];
          for (int idx = 0; idx < entries; idx++)
            locaTable[idx] = 2 * this.fontData.ReadUFWord();
        }
        else
        {
          int entries = DirectoryEntry.Length / 4;
          Debug.Assert(this.fontData.maxp.numGlyphs + 1 == entries,
            "For your information only: Number of glyphs mismatch in font. You can ignore this assertion.");
          this.locaTable = new int[entries];
          for (int idx = 0; idx < entries; idx++)
            locaTable[idx] = this.fontData.ReadLong();
        }
      }
      catch (Exception ex)
      {
        throw ex;
      }
    }