protected virtual OpenTypeFontTable DeepCopy() { OpenTypeFontTable fontTable = (OpenTypeFontTable)MemberwiseClone(); fontTable.DirectoryEntry.Offset = 0; fontTable.DirectoryEntry.FontTable = fontTable; return(fontTable); }
public GenericFontTable(OpenTypeFontTable fontTable) : base(null, "xxxx") { DirectoryEntry.Tag = fontTable.DirectoryEntry.Tag; int length = fontTable.DirectoryEntry.Length; if (length > 0) { this.table = new byte[length]; Buffer.BlockCopy(fontTable.FontData.Data, fontTable.DirectoryEntry.Offset, this.table, 0, length); } }
public IRefFontTable(OpenTypeFontface fontData, OpenTypeFontTable fontTable) : base(null, fontTable.DirectoryEntry.Tag) { _fontData = fontData; _irefDirectoryEntry = fontTable.DirectoryEntry; }
/// <summary> /// Adds the specified table to this font image. /// </summary> public void AddTable(OpenTypeFontTable fontTable) { if (!CanWrite) { throw new InvalidOperationException("Font image cannot be modified."); } if (fontTable == null) { throw new ArgumentNullException("fontTable"); } if (fontTable._fontData == null) { fontTable._fontData = this; } else { Debug.Assert(fontTable._fontData.CanRead); // Create a reference to this font table fontTable = new IRefFontTable(this, fontTable); } //Debug.Assert(fontTable.FontData == null); //fontTable.fontData = this; TableDictionary[fontTable.DirectoryEntry.Tag] = fontTable.DirectoryEntry; switch (fontTable.DirectoryEntry.Tag) { case TableTagNames.CMap: cmap = fontTable as CMapTable; break; case TableTagNames.Cvt: cvt = fontTable as ControlValueTable; break; case TableTagNames.Fpgm: fpgm = fontTable as FontProgram; break; case TableTagNames.MaxP: maxp = fontTable as MaximumProfileTable; break; case TableTagNames.Name: name = fontTable as NameTable; break; case TableTagNames.Head: head = fontTable as FontHeaderTable; break; case TableTagNames.HHea: hhea = fontTable as HorizontalHeaderTable; break; case TableTagNames.HMtx: hmtx = fontTable as HorizontalMetricsTable; break; case TableTagNames.OS2: os2 = fontTable as OS2Table; break; case TableTagNames.Post: post = fontTable as PostScriptTable; break; case TableTagNames.Glyf: glyf = fontTable as GlyphDataTable; break; case TableTagNames.Loca: loca = fontTable as IndexToLocationTable; break; case TableTagNames.GSUB: gsub = fontTable as GlyphSubstitutionTable; break; case TableTagNames.Prep: prep = fontTable as ControlValueProgram; break; } }
public IRefFontTable(FontData fontData, OpenTypeFontTable fontTable) : base(null, fontTable.DirectoryEntry.Tag) { this.fontData = fontData; this.irefDirectoryEntry = fontTable.DirectoryEntry; }
/// <summary> /// Adds the specified table to this font image. /// </summary> public void AddTable(OpenTypeFontTable fontTable) { if (!CanWrite) throw new InvalidOperationException("Font image cannot be modified."); if (fontTable == null) throw new ArgumentNullException("fontTable"); if (fontTable.fontData == null) { fontTable.fontData = this; } else { Debug.Assert(fontTable.fontData.CanRead); // Create a reference to this font table fontTable = new IRefFontTable(this, fontTable); } //Debug.Assert(fontTable.FontData == null); //fontTable.fontData = this; this.tableDictionary[fontTable.DirectoryEntry.Tag] = fontTable.DirectoryEntry; switch (fontTable.DirectoryEntry.Tag) { case TableTagNames.CMap: this.cmap = fontTable as CMapTable; break; case TableTagNames.Cvt: this.cvt = fontTable as ControlValueTable; break; case TableTagNames.Fpgm: this.fpgm = fontTable as FontProgram; break; case TableTagNames.MaxP: this.maxp = fontTable as MaximumProfileTable; break; case TableTagNames.Name: this.name = fontTable as NameTable; break; case TableTagNames.Head: this.head = fontTable as FontHeaderTable; break; case TableTagNames.HHea: this.hhea = fontTable as HorizontalHeaderTable; break; case TableTagNames.HMtx: this.hmtx = fontTable as HorizontalMetricsTable; break; case TableTagNames.OS2: this.os2 = fontTable as OS2Table; break; case TableTagNames.Post: this.post = fontTable as PostScriptTable; break; case TableTagNames.Glyf: this.glyf = fontTable as GlyphDataTable; break; case TableTagNames.Loca: this.loca = fontTable as IndexToLocationTable; break; case TableTagNames.GSUB: this.gsub = fontTable as GlyphSubstitutionTable; break; case TableTagNames.Prep: this.prep = fontTable as ControlValueProgram; break; } }