// constructor public OS2_cache(Table_OS2 OwnerTable) { // copy the data from the owner table's MBOBuffer // and store it in the cache variables m_version = OwnerTable.version; m_xAvgCharWidth = OwnerTable.xAvgCharWidth; m_usWeightClass = OwnerTable.usWeightClass; m_usWidthClass = OwnerTable.usWidthClass; m_fsType = OwnerTable.fsType; m_ySubscriptXSize = OwnerTable.ySubscriptXSize; m_ySubscriptYSize = OwnerTable.ySubscriptYSize; m_ySubscriptXOffset = OwnerTable.ySubscriptXOffset; m_ySubscriptYOffset = OwnerTable.ySubscriptYOffset; m_ySuperscriptXSize = OwnerTable.ySuperscriptXSize; m_ySuperscriptYSize = OwnerTable.ySuperscriptYSize; m_ySuperscriptXOffset = OwnerTable.ySuperscriptXOffset; m_ySuperscriptYOffset = OwnerTable.ySuperscriptYOffset; m_yStrikeoutSize = OwnerTable.yStrikeoutSize; m_yStrikeoutPosition = OwnerTable.yStrikeoutPosition; m_sFamilyClass = OwnerTable.sFamilyClass; m_panose_byte1 = OwnerTable.panose_byte1; m_panose_byte2 = OwnerTable.panose_byte2; m_panose_byte3 = OwnerTable.panose_byte3; m_panose_byte4 = OwnerTable.panose_byte4; m_panose_byte5 = OwnerTable.panose_byte5; m_panose_byte6 = OwnerTable.panose_byte6; m_panose_byte7 = OwnerTable.panose_byte7; m_panose_byte8 = OwnerTable.panose_byte8; m_panose_byte9 = OwnerTable.panose_byte9; m_panose_byte10 = OwnerTable.panose_byte10; m_ulUnicodeRange1 = OwnerTable.ulUnicodeRange1; m_ulUnicodeRange2 = OwnerTable.ulUnicodeRange2; m_ulUnicodeRange3 = OwnerTable.ulUnicodeRange3; m_ulUnicodeRange4 = OwnerTable.ulUnicodeRange4; m_achVendID = OwnerTable.achVendID; m_fsSelection = OwnerTable.fsSelection; m_usFirstCharIndex = OwnerTable.usFirstCharIndex; m_usLastCharIndex = OwnerTable.usLastCharIndex; m_sTypoAscender = OwnerTable.sTypoAscender; m_sTypoDescender = OwnerTable.sTypoDescender; m_sTypoLineGap = OwnerTable.sTypoLineGap; m_usWinAscent = OwnerTable.usWinAscent; m_usWinDescent = OwnerTable.usWinDescent; if (version > 0x000) { m_ulCodePageRange1 = OwnerTable.ulCodePageRange1; m_ulCodePageRange2 = OwnerTable.ulCodePageRange2; if (version > 0x001) // version 2 and 3 { m_sxHeight = OwnerTable.sxHeight; m_sCapHeight = OwnerTable.sCapHeight; m_usDefaultChar = OwnerTable.usDefaultChar; m_usBreakChar = OwnerTable.usBreakChar; m_usMaxContext = OwnerTable.usMaxContext; } } }
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 OS2_cache(Table_OS2 OwnerTable) { // copy the data from the owner table's MBOBuffer // and store it in the cache variables m_version = OwnerTable.version; m_xAvgCharWidth = OwnerTable.xAvgCharWidth; m_usWeightClass = OwnerTable.usWeightClass; m_usWidthClass = OwnerTable.usWidthClass; m_fsType = OwnerTable.fsType; m_ySubscriptXSize = OwnerTable.ySubscriptXSize; m_ySubscriptYSize = OwnerTable.ySubscriptYSize; m_ySubscriptXOffset = OwnerTable.ySubscriptXOffset; m_ySubscriptYOffset = OwnerTable.ySubscriptYOffset; m_ySuperscriptXSize = OwnerTable.ySuperscriptXSize; m_ySuperscriptYSize = OwnerTable.ySuperscriptYSize; m_ySuperscriptXOffset = OwnerTable.ySuperscriptXOffset; m_ySuperscriptYOffset = OwnerTable.ySuperscriptYOffset; m_yStrikeoutSize = OwnerTable.yStrikeoutSize; m_yStrikeoutPosition = OwnerTable.yStrikeoutPosition; m_sFamilyClass = OwnerTable.sFamilyClass; m_panose_byte1 = OwnerTable.panose_byte1; m_panose_byte2 = OwnerTable.panose_byte2; m_panose_byte3 = OwnerTable.panose_byte3; m_panose_byte4 = OwnerTable.panose_byte4; m_panose_byte5 = OwnerTable.panose_byte5; m_panose_byte6 = OwnerTable.panose_byte6; m_panose_byte7 = OwnerTable.panose_byte7; m_panose_byte8 = OwnerTable.panose_byte8; m_panose_byte9 = OwnerTable.panose_byte9; m_panose_byte10 = OwnerTable.panose_byte10; m_ulUnicodeRange1 = OwnerTable.ulUnicodeRange1; m_ulUnicodeRange2 = OwnerTable.ulUnicodeRange2; m_ulUnicodeRange3 = OwnerTable.ulUnicodeRange3; m_ulUnicodeRange4 = OwnerTable.ulUnicodeRange4; m_achVendID = OwnerTable.achVendID; m_fsSelection = OwnerTable.fsSelection; m_usFirstCharIndex = OwnerTable.usFirstCharIndex; m_usLastCharIndex = OwnerTable.usLastCharIndex; m_sTypoAscender = OwnerTable.sTypoAscender; m_sTypoDescender = OwnerTable.sTypoDescender; m_sTypoLineGap = OwnerTable.sTypoLineGap; m_usWinAscent = OwnerTable.usWinAscent; m_usWinDescent = OwnerTable.usWinDescent; if( version > 0x000 ) { m_ulCodePageRange1 = OwnerTable.ulCodePageRange1; m_ulCodePageRange2 = OwnerTable.ulCodePageRange2; if( version > 0x001 ) // version 2 and 3 { m_sxHeight = OwnerTable.sxHeight; m_sCapHeight = OwnerTable.sCapHeight; m_usDefaultChar = OwnerTable.usDefaultChar; m_usBreakChar = OwnerTable.usBreakChar; m_usMaxContext = OwnerTable.usMaxContext; } } }
public override OTTable GenerateTable() { MBOBuffer newbuf; switch( m_version ) { case 0x0000: newbuf = new MBOBuffer( 78 ); break; case 0x0001: newbuf = new MBOBuffer( 86 ); break; case 0x0002: newbuf = new MBOBuffer( 96 ); break; case 0x0003: goto case 0x0002; default: goto case 0x0002; // version 3 is default } newbuf.SetUshort( m_version, (uint)Table_OS2.FieldOffsets.version ); newbuf.SetShort( m_xAvgCharWidth, (uint)Table_OS2.FieldOffsets.xAvgCharWidth ); newbuf.SetUshort( m_usWeightClass, (uint)Table_OS2.FieldOffsets.usWeightClass ); newbuf.SetUshort( m_usWidthClass, (uint)Table_OS2.FieldOffsets.usWidthClass ); newbuf.SetUshort( m_fsType, (uint)Table_OS2.FieldOffsets.fsType ); newbuf.SetShort( m_ySubscriptXSize, (uint)Table_OS2.FieldOffsets.ySubscriptXSize ); newbuf.SetShort( m_ySubscriptYSize, (uint)Table_OS2.FieldOffsets.ySubscriptYSize ); newbuf.SetShort( m_ySubscriptXOffset, (uint)Table_OS2.FieldOffsets.ySubscriptXOffset ); newbuf.SetShort( m_ySubscriptYOffset, (uint)Table_OS2.FieldOffsets.ySubscriptYOffset ); newbuf.SetShort( m_ySuperscriptXSize, (uint)Table_OS2.FieldOffsets.ySuperscriptXSize ); newbuf.SetShort( m_ySuperscriptYSize, (uint)Table_OS2.FieldOffsets.ySuperscriptYSize ); newbuf.SetShort( m_ySuperscriptXOffset, (uint)Table_OS2.FieldOffsets.ySuperscriptXOffset ); newbuf.SetShort( m_ySuperscriptYOffset, (uint)Table_OS2.FieldOffsets.ySuperscriptYOffset ); newbuf.SetShort( m_yStrikeoutSize, (uint)Table_OS2.FieldOffsets.yStrikeoutSize ); newbuf.SetShort( m_yStrikeoutPosition, (uint)Table_OS2.FieldOffsets.yStrikeoutPosition ); newbuf.SetShort( m_sFamilyClass, (uint)Table_OS2.FieldOffsets.sFamilyClass ); newbuf.SetByte( m_panose_byte1, (uint)Table_OS2.FieldOffsets.panose_byte1 ); newbuf.SetByte( m_panose_byte2, (uint)Table_OS2.FieldOffsets.panose_byte2 ); newbuf.SetByte( m_panose_byte3, (uint)Table_OS2.FieldOffsets.panose_byte3 ); newbuf.SetByte( m_panose_byte4, (uint)Table_OS2.FieldOffsets.panose_byte4 ); newbuf.SetByte( m_panose_byte5, (uint)Table_OS2.FieldOffsets.panose_byte5 ); newbuf.SetByte( m_panose_byte6, (uint)Table_OS2.FieldOffsets.panose_byte6 ); newbuf.SetByte( m_panose_byte7, (uint)Table_OS2.FieldOffsets.panose_byte7 ); newbuf.SetByte( m_panose_byte8, (uint)Table_OS2.FieldOffsets.panose_byte8 ); newbuf.SetByte( m_panose_byte9, (uint)Table_OS2.FieldOffsets.panose_byte9 ); newbuf.SetByte( m_panose_byte10, (uint)Table_OS2.FieldOffsets.panose_byte10 ); newbuf.SetUint( m_ulUnicodeRange1, (uint)Table_OS2.FieldOffsets.ulUnicodeRange1 ); newbuf.SetUint( m_ulUnicodeRange2, (uint)Table_OS2.FieldOffsets.ulUnicodeRange2 ); newbuf.SetUint( m_ulUnicodeRange3, (uint)Table_OS2.FieldOffsets.ulUnicodeRange3 ); newbuf.SetUint( m_ulUnicodeRange4, (uint)Table_OS2.FieldOffsets.ulUnicodeRange4 ); for( int i = 0; i < 4; i++ ) { newbuf.SetByte( m_achVendID[i], (uint)(Table_OS2.FieldOffsets.achVendID + i)); } newbuf.SetUshort( m_fsSelection, (uint)Table_OS2.FieldOffsets.fsSelection ); newbuf.SetUshort( m_usFirstCharIndex, (uint)Table_OS2.FieldOffsets.usFirstCharIndex ); newbuf.SetUshort( m_usLastCharIndex, (uint)Table_OS2.FieldOffsets.usLastCharIndex ); newbuf.SetShort( m_sTypoAscender, (uint)Table_OS2.FieldOffsets.sTypoAscender ); newbuf.SetShort( m_sTypoDescender, (uint)Table_OS2.FieldOffsets.sTypoDescender ); newbuf.SetShort( m_sTypoLineGap, (uint)Table_OS2.FieldOffsets.sTypoLineGap ); newbuf.SetUshort( m_usWinAscent, (uint)Table_OS2.FieldOffsets.usWinAscent ); newbuf.SetUshort( m_usWinDescent, (uint)Table_OS2.FieldOffsets.usWinDescent ); // version 1.0 if( version > 0x000 ) { newbuf.SetUint( m_ulCodePageRange1, (uint)Table_OS2.FieldOffsets.ulCodePageRange1 ); newbuf.SetUint( m_ulCodePageRange2, (uint)Table_OS2.FieldOffsets.ulCodePageRange2 ); // vewrsion 2 & 3 if( version > 0x001 ) { newbuf.SetShort( m_sxHeight, (uint)Table_OS2.FieldOffsets.sxHeight ); newbuf.SetShort( m_sCapHeight, (uint)Table_OS2.FieldOffsets.sCapHeight ); newbuf.SetUshort( m_usDefaultChar, (uint)Table_OS2.FieldOffsets.usDefaultChar ); newbuf.SetUshort( m_usBreakChar, (uint)Table_OS2.FieldOffsets.usBreakChar ); newbuf.SetUshort( m_usMaxContext, (uint)Table_OS2.FieldOffsets.usMaxContext ); } } // put the buffer into a Table_maxp object and return it Table_OS2 OS2Table = new Table_OS2("OS/2", newbuf); return OS2Table; }
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 override OTTable GenerateTable() { MBOBuffer newbuf; switch (m_version) { case 0x0000: newbuf = new MBOBuffer(78); break; case 0x0001: newbuf = new MBOBuffer(86); break; case 0x0002: newbuf = new MBOBuffer(96); break; case 0x0003: goto case 0x0002; default: goto case 0x0002; // version 3 is default } newbuf.SetUshort(m_version, (uint)Table_OS2.FieldOffsets.version); newbuf.SetShort(m_xAvgCharWidth, (uint)Table_OS2.FieldOffsets.xAvgCharWidth); newbuf.SetUshort(m_usWeightClass, (uint)Table_OS2.FieldOffsets.usWeightClass); newbuf.SetUshort(m_usWidthClass, (uint)Table_OS2.FieldOffsets.usWidthClass); newbuf.SetUshort(m_fsType, (uint)Table_OS2.FieldOffsets.fsType); newbuf.SetShort(m_ySubscriptXSize, (uint)Table_OS2.FieldOffsets.ySubscriptXSize); newbuf.SetShort(m_ySubscriptYSize, (uint)Table_OS2.FieldOffsets.ySubscriptYSize); newbuf.SetShort(m_ySubscriptXOffset, (uint)Table_OS2.FieldOffsets.ySubscriptXOffset); newbuf.SetShort(m_ySubscriptYOffset, (uint)Table_OS2.FieldOffsets.ySubscriptYOffset); newbuf.SetShort(m_ySuperscriptXSize, (uint)Table_OS2.FieldOffsets.ySuperscriptXSize); newbuf.SetShort(m_ySuperscriptYSize, (uint)Table_OS2.FieldOffsets.ySuperscriptYSize); newbuf.SetShort(m_ySuperscriptXOffset, (uint)Table_OS2.FieldOffsets.ySuperscriptXOffset); newbuf.SetShort(m_ySuperscriptYOffset, (uint)Table_OS2.FieldOffsets.ySuperscriptYOffset); newbuf.SetShort(m_yStrikeoutSize, (uint)Table_OS2.FieldOffsets.yStrikeoutSize); newbuf.SetShort(m_yStrikeoutPosition, (uint)Table_OS2.FieldOffsets.yStrikeoutPosition); newbuf.SetShort(m_sFamilyClass, (uint)Table_OS2.FieldOffsets.sFamilyClass); newbuf.SetByte(m_panose_byte1, (uint)Table_OS2.FieldOffsets.panose_byte1); newbuf.SetByte(m_panose_byte2, (uint)Table_OS2.FieldOffsets.panose_byte2); newbuf.SetByte(m_panose_byte3, (uint)Table_OS2.FieldOffsets.panose_byte3); newbuf.SetByte(m_panose_byte4, (uint)Table_OS2.FieldOffsets.panose_byte4); newbuf.SetByte(m_panose_byte5, (uint)Table_OS2.FieldOffsets.panose_byte5); newbuf.SetByte(m_panose_byte6, (uint)Table_OS2.FieldOffsets.panose_byte6); newbuf.SetByte(m_panose_byte7, (uint)Table_OS2.FieldOffsets.panose_byte7); newbuf.SetByte(m_panose_byte8, (uint)Table_OS2.FieldOffsets.panose_byte8); newbuf.SetByte(m_panose_byte9, (uint)Table_OS2.FieldOffsets.panose_byte9); newbuf.SetByte(m_panose_byte10, (uint)Table_OS2.FieldOffsets.panose_byte10); newbuf.SetUint(m_ulUnicodeRange1, (uint)Table_OS2.FieldOffsets.ulUnicodeRange1); newbuf.SetUint(m_ulUnicodeRange2, (uint)Table_OS2.FieldOffsets.ulUnicodeRange2); newbuf.SetUint(m_ulUnicodeRange3, (uint)Table_OS2.FieldOffsets.ulUnicodeRange3); newbuf.SetUint(m_ulUnicodeRange4, (uint)Table_OS2.FieldOffsets.ulUnicodeRange4); for (int i = 0; i < 4; i++) { newbuf.SetByte(m_achVendID[i], (uint)(Table_OS2.FieldOffsets.achVendID + i)); } newbuf.SetUshort(m_fsSelection, (uint)Table_OS2.FieldOffsets.fsSelection); newbuf.SetUshort(m_usFirstCharIndex, (uint)Table_OS2.FieldOffsets.usFirstCharIndex); newbuf.SetUshort(m_usLastCharIndex, (uint)Table_OS2.FieldOffsets.usLastCharIndex); newbuf.SetShort(m_sTypoAscender, (uint)Table_OS2.FieldOffsets.sTypoAscender); newbuf.SetShort(m_sTypoDescender, (uint)Table_OS2.FieldOffsets.sTypoDescender); newbuf.SetShort(m_sTypoLineGap, (uint)Table_OS2.FieldOffsets.sTypoLineGap); newbuf.SetUshort(m_usWinAscent, (uint)Table_OS2.FieldOffsets.usWinAscent); newbuf.SetUshort(m_usWinDescent, (uint)Table_OS2.FieldOffsets.usWinDescent); // version 1.0 if (version > 0x000) { newbuf.SetUint(m_ulCodePageRange1, (uint)Table_OS2.FieldOffsets.ulCodePageRange1); newbuf.SetUint(m_ulCodePageRange2, (uint)Table_OS2.FieldOffsets.ulCodePageRange2); // vewrsion 2 & 3 if (version > 0x001) { newbuf.SetShort(m_sxHeight, (uint)Table_OS2.FieldOffsets.sxHeight); newbuf.SetShort(m_sCapHeight, (uint)Table_OS2.FieldOffsets.sCapHeight); newbuf.SetUshort(m_usDefaultChar, (uint)Table_OS2.FieldOffsets.usDefaultChar); newbuf.SetUshort(m_usBreakChar, (uint)Table_OS2.FieldOffsets.usBreakChar); newbuf.SetUshort(m_usMaxContext, (uint)Table_OS2.FieldOffsets.usMaxContext); } } // put the buffer into a Table_maxp object and return it Table_OS2 OS2Table = new Table_OS2("OS/2", newbuf); return(OS2Table); }