public uint GetNumLeftSideBearingEntries(OTFont fontOwner) { uint nhm = GetNumberOfHMetrics(fontOwner); uint numGlyphs = fontOwner.GetMaxpNumGlyphs(); return(numGlyphs - nhm); }
public header GetGlyphHeader(uint iGlyph, OTFont fontOwner) { if (iGlyph >= fontOwner.GetMaxpNumGlyphs()) { throw new ArgumentOutOfRangeException("iGlyph"); } header h = null; Table_loca locaTable = (Table_loca)fontOwner.GetTable("loca"); if (locaTable != null) { int offsGlyph, length; if (locaTable.GetEntryGlyf((int)iGlyph, out offsGlyph, out length, fontOwner)) { if (length != 0) { h = new header((uint)offsGlyph, m_bufTable); } } } return(h); }
public uint GetGlyphInfoOffset(uint iGlyph, OTFont fontOwner) { if (iGlyph >= fontOwner.GetMaxpNumGlyphs()) { throw new ArgumentOutOfRangeException("iGlyph"); } return(m_bufTable.GetUint((uint)FieldOffsets.offsets + iGlyph * 4)); }
/************************ * accessors */ public vMetric GetVMetric(uint i, OTFont fontOwner) { vMetric vm = new vMetric(); m_nLongVerMetrics = (ushort)GetNumOfLongVerMetrics(fontOwner); m_nGlyphsInTheFont = fontOwner.GetMaxpNumGlyphs(); if( i >= m_nGlyphsInTheFont ) { throw new ArgumentOutOfRangeException(); } vm = GetVMetric( i ); return vm; }
/************************ * accessors */ public vMetric GetVMetric(uint i, OTFont fontOwner) { vMetric vm = new vMetric(); m_nLongVerMetrics = (ushort)GetNumOfLongVerMetrics(fontOwner); m_nGlyphsInTheFont = fontOwner.GetMaxpNumGlyphs(); if (i >= m_nGlyphsInTheFont) { throw new ArgumentOutOfRangeException(); } vm = GetVMetric(i); return(vm); }
// constructor public glyf_cache(Table_glyf OwnerTable, OTFont OwnerFont) { m_arrGlyphs = new ArrayList(); // get each glyph from the glyf table for (uint iGlyph = 0; iGlyph < OwnerFont.GetMaxpNumGlyphs(); iGlyph++) { header h = OwnerTable.GetGlyphHeader(iGlyph, OwnerFont); if (h == null) { m_arrGlyphs.Add(null); } else { glyph_base gb = GetGlyphLogicalData(h); m_arrGlyphs.Add(gb); } } }
public longHorMetric GetOrMakeHMetric(uint i, OTFont fontOwner) { longHorMetric hm = null; m_nGlyphsInTheFont = fontOwner.GetMaxpNumGlyphs(); m_nNumberOfHMetrics = GetNumberOfHMetrics(fontOwner); uint nlsb = GetNumLeftSideBearingEntries(fontOwner); uint CalcTableLength = (uint)m_nNumberOfHMetrics*4 + nlsb*2; if( i >= m_nGlyphsInTheFont ) { throw new ArgumentOutOfRangeException(); } // only try to parse out the data if the table length is correct if (CalcTableLength == GetLength()) { hm = GetOrMakeHMetric( i ); } return hm; }
public longHorMetric GetOrMakeHMetric(uint i, OTFont fontOwner) { longHorMetric hm = null; m_nGlyphsInTheFont = fontOwner.GetMaxpNumGlyphs(); m_nNumberOfHMetrics = GetNumberOfHMetrics(fontOwner); uint nlsb = GetNumLeftSideBearingEntries(fontOwner); uint CalcTableLength = (uint)m_nNumberOfHMetrics * 4 + nlsb * 2; if (i >= m_nGlyphsInTheFont) { throw new ArgumentOutOfRangeException(); } // only try to parse out the data if the table length is correct if (CalcTableLength == GetLength()) { hm = GetOrMakeHMetric(i); } return(hm); }
// constructor public glyf_cache(Table_glyf OwnerTable, OTFont OwnerFont) { m_arrGlyphs = new ArrayList(); // get each glyph from the glyf table for (uint iGlyph=0; iGlyph<OwnerFont.GetMaxpNumGlyphs(); iGlyph++) { header h = OwnerTable.GetGlyphHeader(iGlyph, OwnerFont); if (h == null) { m_arrGlyphs.Add(null); } else { glyph_base gb = GetGlyphLogicalData(h); m_arrGlyphs.Add(gb); } } }
public header GetGlyphHeader(uint iGlyph, OTFont fontOwner) { if (iGlyph >= fontOwner.GetMaxpNumGlyphs()) { throw new ArgumentOutOfRangeException("iGlyph"); } header h = null; Table_loca locaTable = (Table_loca)fontOwner.GetTable("loca"); if (locaTable != null) { int offsGlyph, length; if (locaTable.GetEntryGlyf((int)iGlyph, out offsGlyph, out length, fontOwner)) { if (length!=0) { h = new header((uint)offsGlyph, m_bufTable); } } } return h; }
public uint GetNumLeftSideBearingEntries(OTFont fontOwner) { uint nhm = GetNumberOfHMetrics(fontOwner); uint numGlyphs = fontOwner.GetMaxpNumGlyphs(); return numGlyphs - nhm; }
public uint GetGlyphInfoOffset(uint iGlyph, OTFont fontOwner) { if (iGlyph >= fontOwner.GetMaxpNumGlyphs()) { throw new ArgumentOutOfRangeException("iGlyph"); } return m_bufTable.GetUint((uint)FieldOffsets.offsets + iGlyph*4); }