internal void Read()
{
try
{
// m_EncodingID = encID;
this.format = this.fontData.ReadUShort();
Debug.Assert(this.format == 4, "Only format 4 expected.");
this.length = this.fontData.ReadUShort();
this.language = this.fontData.ReadUShort(); // Always null in Windows
this.segCountX2 = this.fontData.ReadUShort();
this.searchRange = this.fontData.ReadUShort();
this.entrySelector = this.fontData.ReadUShort();
this.rangeShift = this.fontData.ReadUShort();
int segCount = this.segCountX2 / 2;
this.glyphCount = (this.length - (16 + 8 * segCount)) / 2;
//ASSERT_CONDITION(0 <= m_NumGlyphIds && m_NumGlyphIds < m_Length, "Invalid Index");
this.endCount = new ushort[segCount];
this.startCount = new ushort[segCount];
this.idDelta = new short[segCount];
this.idRangeOffs = new ushort[segCount];
this.glyphIdArray = new ushort[this.glyphCount];
for (int idx = 0; idx < segCount; idx++)
this.endCount[idx] = this.fontData.ReadUShort();
//ASSERT_CONDITION(m_EndCount[segs - 1] == 0xFFFF, "Out of Index");
// Read reserved pad.
this.fontData.ReadUShort();
for (int idx = 0; idx < segCount; idx++)
this.startCount[idx] = this.fontData.ReadUShort();
for (int idx = 0; idx < segCount; idx++)
this.idDelta[idx] = this.fontData.ReadShort();
for (int idx = 0; idx < segCount; idx++)
this.idRangeOffs[idx] = this.fontData.ReadUShort();
for (int idx = 0; idx < this.glyphCount; idx++)
this.glyphIdArray[idx] = this.fontData.ReadUShort();
}
catch (Exception ex)
{
throw new PdfSharpException(PSSR.ErrorReadingFontData, ex);
}
}
}