public virtual SubTable GetSubTable(uint i) { if (i >= SubTableCount) { throw new ArgumentOutOfRangeException(); } SubTable st = null; uint stOffset = m_offsetLookupTable + (uint)GetSubTableOffset(i); if ((string)m_tag == "GPOS") { switch (LookupType) { case 1: st = new Table_GPOS.SinglePos (stOffset, m_bufTable); break; case 2: st = new Table_GPOS.PairPos (stOffset, m_bufTable); break; case 3: st = new Table_GPOS.CursivePos (stOffset, m_bufTable); break; case 4: st = new Table_GPOS.MarkBasePos (stOffset, m_bufTable); break; case 5: st = new Table_GPOS.MarkLigPos (stOffset, m_bufTable); break; case 6: st = new Table_GPOS.MarkMarkPos (stOffset, m_bufTable); break; case 7: st = new Table_GPOS.ContextPos (stOffset, m_bufTable); break; case 8: st = new Table_GPOS.ChainContextPos(stOffset, m_bufTable); break; case 9: st = new Table_GPOS.ExtensionPos (stOffset, m_bufTable); break; } } else if ((string)m_tag == "GSUB") { switch (LookupType) { case 1: st = new Table_GSUB.SingleSubst (stOffset, m_bufTable); break; case 2: st = new Table_GSUB.MultipleSubst (stOffset, m_bufTable); break; case 3: st = new Table_GSUB.AlternateSubst (stOffset, m_bufTable); break; case 4: st = new Table_GSUB.LigatureSubst (stOffset, m_bufTable); break; case 5: st = new Table_GSUB.ContextSubst (stOffset, m_bufTable); break; case 6: st = new Table_GSUB.ChainContextSubst(stOffset, m_bufTable); break; case 7: st = new Table_GSUB.ExtensionSubst (stOffset, m_bufTable); break; case 8: st = new Table_GSUB.ReverseChainSubst(stOffset, m_bufTable); break; } } else { throw new InvalidOperationException("unknown table type"); } return st; }
public virtual SubTable GetSubTable(uint i) { if (i >= SubTableCount) { throw new ArgumentOutOfRangeException(); } SubTable st = null; uint stOffset = m_offsetLookupTable + (uint)GetSubTableOffset(i); if ((string)m_tag == "GPOS") { switch (LookupType) { case 1: st = new Table_GPOS.SinglePos(stOffset, m_bufTable); break; case 2: st = new Table_GPOS.PairPos(stOffset, m_bufTable); break; case 3: st = new Table_GPOS.CursivePos(stOffset, m_bufTable); break; case 4: st = new Table_GPOS.MarkBasePos(stOffset, m_bufTable); break; case 5: st = new Table_GPOS.MarkLigPos(stOffset, m_bufTable); break; case 6: st = new Table_GPOS.MarkMarkPos(stOffset, m_bufTable); break; case 7: st = new Table_GPOS.ContextPos(stOffset, m_bufTable); break; case 8: st = new Table_GPOS.ChainContextPos(stOffset, m_bufTable); break; case 9: st = new Table_GPOS.ExtensionPos(stOffset, m_bufTable); break; } } else if ((string)m_tag == "GSUB") { switch (LookupType) { case 1: st = new Table_GSUB.SingleSubst(stOffset, m_bufTable); break; case 2: st = new Table_GSUB.MultipleSubst(stOffset, m_bufTable); break; case 3: st = new Table_GSUB.AlternateSubst(stOffset, m_bufTable); break; case 4: st = new Table_GSUB.LigatureSubst(stOffset, m_bufTable); break; case 5: st = new Table_GSUB.ContextSubst(stOffset, m_bufTable); break; case 6: st = new Table_GSUB.ChainContextSubst(stOffset, m_bufTable); break; case 7: st = new Table_GSUB.ExtensionSubst(stOffset, m_bufTable); break; case 8: st = new Table_GSUB.ReverseChainSubst(stOffset, m_bufTable); break; } } else { throw new InvalidOperationException("unknown table type"); } return(st); }