/// <summary> /// Initializes a new instance of the <see cref="ComponentRecord"/> class. /// </summary> /// <param name="reader">The big endian binary reader.</param> /// <param name="markClassCount">Number of defined mark classes.</param> /// <param name="offset">Offset from beginning of LigatureAttach table.</param> public ComponentRecord(BigEndianBinaryReader reader, ushort markClassCount, long offset) { // +--------------+---------------------------------------+----------------------------------------------------------------------------------------+ // | Type | Name | Description | // +==============+=======================================+========================================================================================+ // | Offset16 | ligatureAnchorOffsets[markClassCount] | Array of offsets (one per class) to Anchor tables. Offsets are from | // | | | beginning of LigatureAttach table, ordered by class (offsets may be NULL). | // +--------------+---------------------------------------+----------------------------------------------------------------------------------------+ this.LigatureAnchorTables = new AnchorTable[markClassCount]; ushort[] ligatureAnchorOffsets = new ushort[markClassCount]; for (int i = 0; i < markClassCount; i++) { ligatureAnchorOffsets[i] = reader.ReadOffset16(); } long position = reader.BaseStream.Position; for (int i = 0; i < markClassCount; i++) { if (ligatureAnchorOffsets[i] is not 0) { this.LigatureAnchorTables[i] = AnchorTable.Load(reader, offset + ligatureAnchorOffsets[i]); } } reader.BaseStream.Position = position; }
/// <summary> /// Initializes a new instance of the <see cref="BaseRecord"/> struct. /// </summary> /// <param name="reader">The big endian binary reader.</param> /// <param name="classCount">The class count.</param> /// <param name="offset">Offset to the from beginning of BaseArray table.</param> public BaseRecord(BigEndianBinaryReader reader, ushort classCount, long offset) { // +--------------+-----------------------------------+----------------------------------------------------------------------------------------+ // | Type | Name | Description | // +==============+===================================+========================================================================================+ // | Offset16 | baseAnchorOffsets[markClassCount] | Array of offsets (one per mark class) to Anchor tables. | // | | | Offsets are from beginning of BaseArray table, ordered by class (offsets may be NULL). | // +--------------+-----------------------------------+----------------------------------------------------------------------------------------+ this.BaseAnchorTables = new AnchorTable[classCount]; ushort[] baseAnchorOffsets = new ushort[classCount]; for (int i = 0; i < classCount; i++) { baseAnchorOffsets[i] = reader.ReadOffset16(); } long position = reader.BaseStream.Position; for (int i = 0; i < classCount; i++) { if (baseAnchorOffsets[i] is not 0) { this.BaseAnchorTables[i] = AnchorTable.Load(reader, offset + baseAnchorOffsets[i]); } } reader.BaseStream.Position = position; }
/// <summary> /// Initializes a new instance of the <see cref="Mark2Record"/> class. /// </summary> /// <param name="reader">The big endian binary reader.</param> /// <param name="markClassCount">The Number of Mark2 records.</param> /// <param name="offset">Offset to the beginning of MarkArray table.</param> public Mark2Record(BigEndianBinaryReader reader, ushort markClassCount, long offset) { // +--------------+------------------------------------+--------------------------------------------------------------------------------------+ // | Type | Name | Description | // +==============+====================================+======================================================================================+ // | Offset16 | mark2AnchorOffsets[markClassCount] | Array of offsets (one per class) to Anchor tables. Offsets are from beginning of | // | | | Mark2Array table, in class order (offsets may be NULL). | // +--------------+------------------------------------+--------------------------------------------------------------------------------------+ ushort[] mark2AnchorOffsets = new ushort[markClassCount]; this.MarkAnchorTable = new AnchorTable[markClassCount]; for (int i = 0; i < markClassCount; i++) { mark2AnchorOffsets[i] = reader.ReadOffset16(); } long position = reader.BaseStream.Position; for (int i = 0; i < markClassCount; i++) { if (mark2AnchorOffsets[i] != 0) { this.MarkAnchorTable[i] = AnchorTable.Load(reader, offset + mark2AnchorOffsets[i]); } } reader.BaseStream.Position = position; }
/// <summary> /// Initializes a new instance of the <see cref="EntryExitAnchors"/> class. /// </summary> /// <param name="reader">The big endian binary reader.</param> /// <param name="offset">The offset to exitAnchor table, from beginning of CursivePos subtable.</param> /// <param name="entryExitRecord">Offsets to entry and exit Anchor table, from beginning of CursivePos subtable.</param> public EntryExitAnchors(BigEndianBinaryReader reader, long offset, EntryExitRecord entryExitRecord) { this.EntryAnchor = entryExitRecord.EntryAnchorOffset != 0 ? AnchorTable.Load(reader, offset + entryExitRecord.EntryAnchorOffset) : null; this.ExitAnchor = entryExitRecord.ExitAnchorOffset != 0 ? AnchorTable.Load(reader, offset + entryExitRecord.ExitAnchorOffset) : null; }