/// <exception cref="System.IO.IOException"/> private static FontProgramDescriptor FetchTTCDescriptor(String baseName) { int ttcSplit = baseName.ToLowerInvariant().IndexOf(".ttc,", StringComparison.Ordinal); if (ttcSplit > 0) { String ttcName; int ttcIndex; try { ttcName = baseName.JSubstring(0, ttcSplit + 4); // count(.ttc) = 4 ttcIndex = Convert.ToInt32(baseName.Substring(ttcSplit + 5)); } catch (FormatException nfe) { // count(.ttc,) = 5) throw new iText.IO.IOException(nfe.Message, nfe); } OpenTypeParser parser = new OpenTypeParser(ttcName, ttcIndex); FontProgramDescriptor descriptor = FetchOpenTypeFontDescriptor(parser); parser.Close(); return(descriptor); } else { return(null); } }
/// <exception cref="System.IO.IOException"/> public virtual void Close() { if (fontParser != null) { fontParser.Close(); } fontParser = null; }
/// <exception cref="System.IO.IOException"/> internal TrueTypeFont(String ttcPath, int ttcIndex) { fontParser = new OpenTypeParser(ttcPath, ttcIndex); fontParser.LoadTables(true); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> public TrueTypeFont(byte[] ttf) { fontParser = new OpenTypeParser(ttf); fontParser.LoadTables(true); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> public TrueTypeFont(String path) { fontParser = new OpenTypeParser(path); fontParser.LoadTables(true); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> internal TrueTypeFont(byte[] ttc, int ttcIndex) { fontParser = new OpenTypeParser(ttc, ttcIndex); fontParser.LoadTables(true); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> private static FontProgramDescriptor FetchOpenTypeFontDescriptor(OpenTypeParser fontParser) { fontParser.LoadTables(false); return(new FontProgramDescriptor(fontParser.GetFontNames(), fontParser.GetPostTable().italicAngle, fontParser .GetPostTable().isFixedPitch)); }
/// <exception cref="System.IO.IOException"/> private static FontProgramDescriptor FetchTrueTypeFontDescriptor(byte[] fontProgram) { using (OpenTypeParser parser = new OpenTypeParser(fontProgram)) { return(FetchOpenTypeFontDescriptor(parser)); } }
/// <exception cref="System.IO.IOException"/> private TrueTypeFont(OpenTypeParser fontParser) { this.fontParser = fontParser; this.fontParser.LoadTables(true); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> internal TrueTypeFont(String ttcPath, int ttcIndex) { CheckFilePath(ttcPath); fontParser = new OpenTypeParser(ttcPath, ttcIndex); InitializeFontProperties(); }
/// <exception cref="System.IO.IOException"/> public TrueTypeFont(String path) { CheckFilePath(path); fontParser = new OpenTypeParser(path); InitializeFontProperties(); }