public override OTTable GenerateTable() { // create a Motorola Byte Order buffer for the new table MBOBuffer newbuf = new MBOBuffer(36); // populate the buffer newbuf.SetFixed(m_TableVersionNumber, (uint)Table_hhea.FieldOffsets.TableVersionNumber); newbuf.SetShort(m_Ascender, (uint)Table_hhea.FieldOffsets.Ascender); newbuf.SetShort(m_Descender, (uint)Table_hhea.FieldOffsets.Descender); newbuf.SetShort(m_LineGap, (uint)Table_hhea.FieldOffsets.LineGap); newbuf.SetUshort(m_advanceWidthMax, (uint)Table_hhea.FieldOffsets.advanceWidthMax); newbuf.SetShort(m_minLeftSideBearing, (uint)Table_hhea.FieldOffsets.minLeftSideBearing); newbuf.SetShort(m_minRightSideBearing, (uint)Table_hhea.FieldOffsets.minRightSideBearing); newbuf.SetShort(m_xMaxExtent, (uint)Table_hhea.FieldOffsets.xMaxExtent); newbuf.SetShort(m_caretSlopeRise, (uint)Table_hhea.FieldOffsets.caretSlopeRise); newbuf.SetShort(m_caretSlopeRun, (uint)Table_hhea.FieldOffsets.caretSlopeRun); newbuf.SetShort(m_caretOffset, (uint)Table_hhea.FieldOffsets.caretOffset); newbuf.SetShort(m_reserved1, (uint)Table_hhea.FieldOffsets.reserved1); newbuf.SetShort(m_reserved2, (uint)Table_hhea.FieldOffsets.reserved2); newbuf.SetShort(m_reserved3, (uint)Table_hhea.FieldOffsets.reserved3); newbuf.SetShort(m_reserved4, (uint)Table_hhea.FieldOffsets.reserved4); newbuf.SetShort(m_metricDataFormat, (uint)Table_hhea.FieldOffsets.metricDataFormat); newbuf.SetUshort(m_numberOfHMetrics, (uint)Table_hhea.FieldOffsets.numberOfHMetrics); // put the buffer into a Table_vhea object and return it Table_hhea hheaTable = new Table_hhea("hhea", newbuf); return(hheaTable); }
public Table_hmtx(OTTag tag, MBOBuffer buf, Table_hhea hheaTable, ushort nGlyphsInTheFont) : base(tag, buf) { m_hheaTable = hheaTable; m_nGlyphsInTheFont = nGlyphsInTheFont; Debug.Assert(m_hheaTable != null); m_nNumberOfHMetrics = m_hheaTable.numberOfHMetrics; }
/************************ * protected methods */ protected ushort GetNumberOfHMetrics(OTFont fontOwner) { Table_hhea hheaTable = (Table_hhea)fontOwner.GetTable("hhea"); if (hheaTable != null) { m_nNumberOfHMetrics = hheaTable.numberOfHMetrics; } //Debug.Assert(numberOfHMetrics != 0); return(m_nNumberOfHMetrics); }
// constructor public hmtx_cache(Table_hmtx OwnerTable) { // assign m_hheaTable = OwnerTable.hheaTable; m_nGlyphsInTheFont = OwnerTable.numOfGlyphsInTheFont; m_nNumberOfHMetrics = OwnerTable.numOfHMetrics; // For ease of use we will store all entrys as double entrys and fix up the single // entry arrays (left side bearing only ) when we write out the table m_longHorMetric = new ArrayList(m_nGlyphsInTheFont); for (ushort i = 0; i < m_nGlyphsInTheFont; i++) { m_longHorMetric.Add(OwnerTable.GetOrMakeHMetric(i)); } }
// constructor public hhea_cache(Table_hhea OwnerTable) { // copy the data from the owner table's MBOBuffer // and store it in the cache variables m_TableVersionNumber = OwnerTable.TableVersionNumber; m_Ascender = OwnerTable.Ascender; m_Descender = OwnerTable.Descender; m_LineGap = OwnerTable.LineGap; m_advanceWidthMax = OwnerTable.advanceWidthMax; m_minLeftSideBearing = OwnerTable.minLeftSideBearing; m_minRightSideBearing = OwnerTable.minRightSideBearing; m_xMaxExtent = OwnerTable.xMaxExtent; m_caretSlopeRise = OwnerTable.caretSlopeRise; m_caretSlopeRun = OwnerTable.caretSlopeRun; m_caretOffset = OwnerTable.caretOffset; m_reserved1 = OwnerTable.reserved1; m_reserved2 = OwnerTable.reserved2; m_reserved3 = OwnerTable.reserved3; m_reserved4 = OwnerTable.reserved4; m_metricDataFormat = OwnerTable.metricDataFormat; m_numberOfHMetrics = OwnerTable.numberOfHMetrics; }
public virtual OTTable CreateTableObject(OTTag tag, MBOBuffer buf) { OTTable table = null; string sName = GetUnaliasedTableName(tag); switch (sName) { case "BASE": table = new Table_BASE(tag, buf); break; case "CFF ": table = new Table_CFF(tag, buf); break; case "cmap": table = new Table_cmap(tag, buf); break; case "cvt ": table = new Table_cvt(tag, buf); break; case "DSIG": table = new Table_DSIG(tag, buf); break; case "EBDT": table = new Table_EBDT(tag, buf); break; case "EBLC": table = new Table_EBLC(tag, buf); break; case "EBSC": table = new Table_EBSC(tag, buf); break; case "fpgm": table = new Table_fpgm(tag, buf); break; case "gasp": table = new Table_gasp(tag, buf); break; case "GDEF": table = new Table_GDEF(tag, buf); break; case "glyf": table = new Table_glyf(tag, buf); break; case "GPOS": table = new Table_GPOS(tag, buf); break; case "GSUB": table = new Table_GSUB(tag, buf); break; case "hdmx": table = new Table_hdmx(tag, buf); break; case "head": table = new Table_head(tag, buf); break; case "hhea": table = new Table_hhea(tag, buf); break; case "hmtx": table = new Table_hmtx(tag, buf); break; case "JSTF": table = new Table_JSTF(tag, buf); break; case "kern": table = new Table_kern(tag, buf); break; case "loca": table = new Table_loca(tag, buf); break; case "LTSH": table = new Table_LTSH(tag, buf); break; case "maxp": table = new Table_maxp(tag, buf); break; case "name": table = new Table_name(tag, buf); break; case "OS/2": table = new Table_OS2(tag, buf); break; case "PCLT": table = new Table_PCLT(tag, buf); break; case "post": table = new Table_post(tag, buf); break; case "prep": table = new Table_prep(tag, buf); break; case "VDMX": table = new Table_VDMX(tag, buf); break; case "vhea": table = new Table_vhea(tag, buf); break; case "vmtx": table = new Table_vmtx(tag, buf); break; case "VORG": table = new Table_VORG(tag, buf); break; //case "Zapf": table = new Table_Zapf(tag, buf); break; default: table = new Table__Unknown(tag, buf); break; } return(table); }
public virtual OTTable CreateTableObject(OTTag tag, MBOBuffer buf) { OTTable table = null; string sName = GetUnaliasedTableName(tag); switch (sName) { case "BASE": table = new Table_BASE(tag, buf); break; case "CFF ": table = new Table_CFF(tag, buf); break; case "cmap": table = new Table_cmap(tag, buf); break; case "cvt ": table = new Table_cvt(tag, buf); break; case "DSIG": table = new Table_DSIG(tag, buf); break; case "EBDT": table = new Table_EBDT(tag, buf); break; case "EBLC": table = new Table_EBLC(tag, buf); break; case "EBSC": table = new Table_EBSC(tag, buf); break; case "fpgm": table = new Table_fpgm(tag, buf); break; case "gasp": table = new Table_gasp(tag, buf); break; case "GDEF": table = new Table_GDEF(tag, buf); break; case "glyf": table = new Table_glyf(tag, buf); break; case "GPOS": table = new Table_GPOS(tag, buf); break; case "GSUB": table = new Table_GSUB(tag, buf); break; case "hdmx": table = new Table_hdmx(tag, buf); break; case "head": table = new Table_head(tag, buf); break; case "hhea": table = new Table_hhea(tag, buf); break; case "hmtx": table = new Table_hmtx(tag, buf); break; case "JSTF": table = new Table_JSTF(tag, buf); break; case "kern": table = new Table_kern(tag, buf); break; case "loca": table = new Table_loca(tag, buf); break; case "LTSH": table = new Table_LTSH(tag, buf); break; case "maxp": table = new Table_maxp(tag, buf); break; case "name": table = new Table_name(tag, buf); break; case "OS/2": table = new Table_OS2(tag, buf); break; case "PCLT": table = new Table_PCLT(tag, buf); break; case "post": table = new Table_post(tag, buf); break; case "prep": table = new Table_prep(tag, buf); break; case "VDMX": table = new Table_VDMX(tag, buf); break; case "vhea": table = new Table_vhea(tag, buf); break; case "vmtx": table = new Table_vmtx(tag, buf); break; case "VORG": table = new Table_VORG(tag, buf); break; //case "Zapf": table = new Table_Zapf(tag, buf); break; default: table = new Table__Unknown(tag, buf); break; } return table; }
// constructor public hmtx_cache(Table_hmtx OwnerTable) { // assign m_hheaTable = OwnerTable.hheaTable; m_nGlyphsInTheFont = OwnerTable.numOfGlyphsInTheFont; m_nNumberOfHMetrics = OwnerTable.numOfHMetrics; // For ease of use we will store all entrys as double entrys and fix up the single // entry arrays (left side bearing only ) when we write out the table m_longHorMetric = new ArrayList( m_nGlyphsInTheFont ); for( ushort i = 0; i < m_nGlyphsInTheFont; i++ ) { m_longHorMetric.Add( OwnerTable.GetOrMakeHMetric( i )); } }
public override OTTable GenerateTable() { // create a Motorola Byte Order buffer for the new table MBOBuffer newbuf = new MBOBuffer(36); // populate the buffer newbuf.SetFixed( m_TableVersionNumber, (uint)Table_hhea.FieldOffsets.TableVersionNumber ); newbuf.SetShort( m_Ascender, (uint)Table_hhea.FieldOffsets.Ascender ); newbuf.SetShort( m_Descender, (uint)Table_hhea.FieldOffsets.Descender ); newbuf.SetShort( m_LineGap, (uint)Table_hhea.FieldOffsets.LineGap ); newbuf.SetUshort( m_advanceWidthMax, (uint)Table_hhea.FieldOffsets.advanceWidthMax ); newbuf.SetShort( m_minLeftSideBearing, (uint)Table_hhea.FieldOffsets.minLeftSideBearing ); newbuf.SetShort( m_minRightSideBearing, (uint)Table_hhea.FieldOffsets.minRightSideBearing ); newbuf.SetShort( m_xMaxExtent, (uint)Table_hhea.FieldOffsets.xMaxExtent ); newbuf.SetShort( m_caretSlopeRise, (uint)Table_hhea.FieldOffsets.caretSlopeRise ); newbuf.SetShort( m_caretSlopeRun, (uint)Table_hhea.FieldOffsets.caretSlopeRun ); newbuf.SetShort( m_caretOffset, (uint)Table_hhea.FieldOffsets.caretOffset ); newbuf.SetShort( m_reserved1, (uint)Table_hhea.FieldOffsets.reserved1 ); newbuf.SetShort( m_reserved2, (uint)Table_hhea.FieldOffsets.reserved2 ); newbuf.SetShort( m_reserved3, (uint)Table_hhea.FieldOffsets.reserved3 ); newbuf.SetShort( m_reserved4, (uint)Table_hhea.FieldOffsets.reserved4 ); newbuf.SetShort( m_metricDataFormat, (uint)Table_hhea.FieldOffsets.metricDataFormat ); newbuf.SetUshort( m_numberOfHMetrics, (uint)Table_hhea.FieldOffsets.numberOfHMetrics ); // put the buffer into a Table_vhea object and return it Table_hhea hheaTable = new Table_hhea("hhea", newbuf); return hheaTable; }