private int m_numGlyph; // from maxp /* * METHODS: ACCESS */ protected int LengthGlyf(OTFont fontOwner) { if (this.m_lengthGlyf==Table_loca.ValueInvalid) { DirectoryEntry deGlyf=fontOwner.GetDirectoryEntry("glyf"); if (deGlyf != null) { this.m_lengthGlyf=(int)deGlyf.length; } } return this.m_lengthGlyf; }
private int m_numGlyph; // from maxp /* * METHODS: ACCESS */ protected int LengthGlyf(OTFont fontOwner) { if (this.m_lengthGlyf == Table_loca.ValueInvalid) { DirectoryEntry deGlyf = fontOwner.GetDirectoryEntry("glyf"); if (deGlyf != null) { this.m_lengthGlyf = (int)deGlyf.length; } } return(this.m_lengthGlyf); }
public uint GetNumPadBytesAfterTable(OTTable t) { long TableFilePos = t.GetBuffer().GetFilePos(); if (TableFilePos == -1) { // the table's file position is initialized to -1 if the table was not read from a file throw new ApplicationException("invalid file position"); } uint TableLength = t.GetBuffer().GetLength(); long PadFilePos = TableFilePos + TableLength; long NextTablePos = m_fs.Length; // possible DSIG in TTC after all the tables if (IsCollection() && m_ttch.DsigTag != null && (string)m_ttch.DsigTag == "DSIG" && m_ttch.DsigOffset > 0 && m_ttch.DsigOffset < NextTablePos && (string)t.m_tag != "DSIG") { NextTablePos = m_ttch.DsigOffset; } for (uint iFont = 0; iFont < m_nFonts; iFont++) { if (IsCollection()) { uint offset = (uint)m_ttch.DirectoryOffsets[(int)iFont]; if (offset >= PadFilePos && offset < NextTablePos) { NextTablePos = offset; } } OTFont f = GetFont(iFont); for (ushort iTable = 0; iTable < f.GetNumTables(); iTable++) { DirectoryEntry de = f.GetDirectoryEntry(iTable); if (de.offset >= PadFilePos && de.offset < NextTablePos) { NextTablePos = de.offset; } } } return((uint)(NextTablePos - PadFilePos)); }