// generate a new table from the cached data 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_version, (uint)Table_vhea.FieldOffsets.version); newbuf.SetShort(m_vertTypoAscender, (uint)Table_vhea.FieldOffsets.vertTypoAscender); newbuf.SetShort(m_vertTypoDescender, (uint)Table_vhea.FieldOffsets.vertTypoDescender); newbuf.SetShort(m_vertTypoLineGap, (uint)Table_vhea.FieldOffsets.vertTypoLineGap); newbuf.SetShort(m_advanceHeightMax, (uint)Table_vhea.FieldOffsets.advanceHeightMax); newbuf.SetShort(m_minTopSideBearing, (uint)Table_vhea.FieldOffsets.minTopSideBearing); newbuf.SetShort(m_minBottomSideBearing, (uint)Table_vhea.FieldOffsets.minBottomSideBearing); newbuf.SetShort(m_yMaxExtent, (uint)Table_vhea.FieldOffsets.yMaxExtent); newbuf.SetShort(m_caretSlopeRise, (uint)Table_vhea.FieldOffsets.caretSlopeRise); newbuf.SetShort(m_caretSlopeRun, (uint)Table_vhea.FieldOffsets.caretSlopeRun); newbuf.SetShort(m_caretOffset, (uint)Table_vhea.FieldOffsets.caretOffset); newbuf.SetShort(m_reserved1, (uint)Table_vhea.FieldOffsets.reserved1); newbuf.SetShort(m_reserved2, (uint)Table_vhea.FieldOffsets.reserved2); newbuf.SetShort(m_reserved3, (uint)Table_vhea.FieldOffsets.reserved3); newbuf.SetShort(m_reserved4, (uint)Table_vhea.FieldOffsets.reserved4); newbuf.SetShort(m_metricDataFormat, (uint)Table_vhea.FieldOffsets.metricDataFormat); newbuf.SetUshort(m_numOfLongVerMetrics, (uint)Table_vhea.FieldOffsets.numOfLongVerMetrics); // put the buffer into a Table_vhea object and return it Table_vhea vheaTable = new Table_vhea("vhea", newbuf); return(vheaTable); }
public Table_vmtx(OTTag tag, MBOBuffer buf, Table_vhea vheaTable, ushort nGlyphsInTheFont) : base(tag, buf) { m_vheaTable = vheaTable; m_nGlyphsInTheFont = nGlyphsInTheFont; Debug.Assert(m_vheaTable != null); m_nLongVerMetrics = m_vheaTable.numOfLongVerMetrics; }
// constructor public vmtx_cache(Table_vmtx OwnerTable) { // assign variables m_vheaTable = OwnerTable.vheaTable; m_nGlyphsInTheFont = OwnerTable.numOfGlyphsInTheFont; m_nLongVerMetrics = OwnerTable.numOfLongVerMetrics; // For ease of use we will store all entrys as double entrys and fix up the single // entry arrays when we write out the table m_vMetric = new ArrayList(m_nGlyphsInTheFont); for (ushort i = 0; i < m_nGlyphsInTheFont; i++) { m_vMetric.Add(OwnerTable.GetVMetric(i)); } }
/************************ * protected methods */ protected uint GetNumOfLongVerMetrics(OTFont fontOwner) { if (m_nLongVerMetrics == 0) { // get the vhea table (to get access to the numOfLongVerMetrics property) Table_vhea vheaTable = (Table_vhea)fontOwner.GetTable("vhea"); if (vheaTable != null) { m_nLongVerMetrics = vheaTable.numOfLongVerMetrics; } } Debug.Assert(m_nLongVerMetrics != 0); return(m_nLongVerMetrics); }
// constructor public vhea_cache(Table_vhea OwnerTable) { // copy the data from the owner table's MBOBuffer // and store it in the cache variables m_version = OwnerTable.version; m_vertTypoAscender = OwnerTable.vertTypoAscender; m_vertTypoDescender = OwnerTable.vertTypoDescender; m_vertTypoLineGap = OwnerTable.vertTypoLineGap; m_advanceHeightMax = OwnerTable.advanceHeightMax; m_minTopSideBearing = OwnerTable.minTopSideBearing; m_minBottomSideBearing = OwnerTable.minBottomSideBearing; m_yMaxExtent = OwnerTable.yMaxExtent; 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_numOfLongVerMetrics = OwnerTable.numOfLongVerMetrics; }
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; }
// generate a new table from the cached data 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_version, (uint)Table_vhea.FieldOffsets.version); newbuf.SetShort (m_vertTypoAscender, (uint)Table_vhea.FieldOffsets.vertTypoAscender); newbuf.SetShort (m_vertTypoDescender, (uint)Table_vhea.FieldOffsets.vertTypoDescender); newbuf.SetShort (m_vertTypoLineGap, (uint)Table_vhea.FieldOffsets.vertTypoLineGap); newbuf.SetShort (m_advanceHeightMax, (uint)Table_vhea.FieldOffsets.advanceHeightMax); newbuf.SetShort (m_minTopSideBearing, (uint)Table_vhea.FieldOffsets.minTopSideBearing); newbuf.SetShort (m_minBottomSideBearing, (uint)Table_vhea.FieldOffsets.minBottomSideBearing); newbuf.SetShort (m_yMaxExtent, (uint)Table_vhea.FieldOffsets.yMaxExtent); newbuf.SetShort (m_caretSlopeRise, (uint)Table_vhea.FieldOffsets.caretSlopeRise); newbuf.SetShort (m_caretSlopeRun, (uint)Table_vhea.FieldOffsets.caretSlopeRun); newbuf.SetShort (m_caretOffset, (uint)Table_vhea.FieldOffsets.caretOffset); newbuf.SetShort (m_reserved1, (uint)Table_vhea.FieldOffsets.reserved1); newbuf.SetShort (m_reserved2, (uint)Table_vhea.FieldOffsets.reserved2); newbuf.SetShort (m_reserved3, (uint)Table_vhea.FieldOffsets.reserved3); newbuf.SetShort (m_reserved4, (uint)Table_vhea.FieldOffsets.reserved4); newbuf.SetShort (m_metricDataFormat, (uint)Table_vhea.FieldOffsets.metricDataFormat); newbuf.SetUshort (m_numOfLongVerMetrics, (uint)Table_vhea.FieldOffsets.numOfLongVerMetrics); // put the buffer into a Table_vhea object and return it Table_vhea vheaTable = new Table_vhea("vhea", newbuf); return vheaTable; }
// constructor public vmtx_cache(Table_vmtx OwnerTable) { // assign variables m_vheaTable = OwnerTable.vheaTable; m_nGlyphsInTheFont = OwnerTable.numOfGlyphsInTheFont; m_nLongVerMetrics = OwnerTable.numOfLongVerMetrics; // For ease of use we will store all entrys as double entrys and fix up the single // entry arrays when we write out the table m_vMetric = new ArrayList( m_nGlyphsInTheFont ); for( ushort i = 0; i < m_nGlyphsInTheFont; i++ ) { m_vMetric.Add( OwnerTable.GetVMetric( i )); } }