byte[] bytes; // Instructions. n is the number of BYTE items that fit in the size of the table. public FontProgram(OpenTypeFontface fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Fpgm; DirectoryEntry = fontData.TableDictionary[TableTagNames.Fpgm]; Read(); }
public GlyphSubstitutionTable(OpenTypeFontface fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.GSUB; DirectoryEntry = fontData.TableDictionary[TableTagNames.GSUB]; Read(); }
internal OpenTypeDescriptor(string fontDescriptorKey, string idName, byte[] fontData) : base(fontDescriptorKey) { try { FontFace = new OpenTypeFontface(fontData, idName); // Try to get real name form name table if (idName.Contains("XPS-Font-") && FontFace.name != null && FontFace.name.Name.Length != 0) { string tag = String.Empty; if (idName.IndexOf('+') == 6) { tag = idName.Substring(0, 6); } idName = tag + "+" + FontFace.name.Name; if (FontFace.name.Style.Length != 0) { idName += "," + FontFace.name.Style; } //idName = idName.Replace(" ", ""); } FontName = idName; Initialize(); } catch (Exception) { GetType(); throw; } }
byte[] bytes; // Set of instructions executed whenever point size or font or transformation change. n is the number of BYTE items that fit in the size of the table. public ControlValueProgram(OpenTypeFontface fontData) : base(fontData, Tag) { DirectoryEntry.Tag = TableTagNames.Prep; DirectoryEntry = fontData.TableDictionary[TableTagNames.Prep]; Read(); }
/// <summary> /// New... /// </summary> public OpenTypeDescriptor(string fontDescriptorKey, string name, XFontStyle stlye, OpenTypeFontface fontface, XPDFFontOptions options) : base(fontDescriptorKey) { FontFace = fontface; FontName = name; Initialize(); }
/// <summary> /// Tries to get fontface by its check sum. /// </summary> public static bool TryGetFontface(ulong checkSum, out OpenTypeFontface fontface) { try { Lock.EnterFontFactory(); bool result = Singleton._fontfacesByCheckSum.TryGetValue(checkSum, out fontface); return(result); } finally { Lock.ExitFontFactory(); } }
/// <summary> /// Tries to get fontface by its key. /// </summary> public static bool TryGetFontface(string key, out OpenTypeFontface fontface) { try { Lock.EnterFontFactory(); bool result = Singleton._fontfaceCache.TryGetValue(key, out fontface); return(result); } finally { Lock.ExitFontFactory(); } }
/// <summary> /// Creates and reads a TableDirectoryEntry from the font image. /// </summary> public static TableDirectoryEntry ReadFrom(OpenTypeFontface fontData) { TableDirectoryEntry entry = new TableDirectoryEntry { Tag = fontData.ReadTag(), CheckSum = fontData.ReadULong(), Offset = fontData.ReadLong(), Length = (int)fontData.ReadULong() }; return(entry); }
public static OpenTypeFontface AddFontface(OpenTypeFontface fontface) { try { Lock.EnterFontFactory(); if (TryGetFontface(fontface.FullFaceName, out OpenTypeFontface fontfaceCheck)) { if (fontfaceCheck.CheckSum != fontface.CheckSum) { throw new InvalidOperationException("OpenTypeFontface with same signature but different bytes."); } return(fontfaceCheck); } Singleton._fontfaceCache.Add(fontface.FullFaceName, fontface); Singleton._fontfacesByCheckSum.Add(fontface.CheckSum, fontface); return(fontface); } finally { Lock.ExitFontFactory(); } }
public OpenTypeFontTable(OpenTypeFontface fontData, string tag) { _fontData = fontData; DirectoryEntry = fontData != null && fontData.TableDictionary.ContainsKey(tag) ? fontData.TableDictionary[tag] : new TableDirectoryEntry(tag); DirectoryEntry.FontTable = this; }
public VerticalHeaderTable(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
public PostScriptTable(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
public OS2Table(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
public ushort[] glyphIdArray; // Glyph index array (arbitrary length) public CMap4(OpenTypeFontface fontData, WinEncodingId encodingId) : base(fontData, "----") { this.encodingId = encodingId; Read(); }
public MaximumProfileTable(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
public VerticalMetricsTable(OpenTypeFontface fontData) : base(fontData, Tag) { Read(); throw new NotImplementedException("VerticalMetricsTable"); }
public VerticalMetrics(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
public IRefFontTable(OpenTypeFontface fontData, OpenTypeFontTable fontTable) : base(null, fontTable.DirectoryEntry.Tag) { _fontData = fontData; _irefDirectoryEntry = fontTable.DirectoryEntry; }
public HorizontalHeaderTable(OpenTypeFontface fontData) : base(fontData, Tag) => Read();
// Implementation Notes // OpenTypeFontface represents a 'decompiled' font file in memory. // // * An OpenTypeFontface can belong to more than one // XGlyphTypeface because of StyleSimulations. // // * Currently there is a one to one relationship to XFontSource. // // * Consider OpenTypeFontface as an decompiled XFontSource. // // http://www.microsoft.com/typography/otspec/ /// <summary> /// Shallow copy for font subset. /// </summary> OpenTypeFontface(OpenTypeFontface fontface) { _offsetTable = fontface._offsetTable; FullFaceName = fontface.FullFaceName; }
public HorizontalMetricsTable(OpenTypeFontface fontData) : base(fontData, Tag) => Read();