public virtual void TrueTypeFontAndCmapConstructorTest() { TrueTypeFont ttf = new TrueTypeFont(sourceFolder + "NotoSerif-Regular_v1.7.ttf"); PdfType0Font type0Font = new PdfType0Font(ttf, PdfEncodings.IDENTITY_H); CMapEncoding cmap = type0Font.GetCmap(); NUnit.Framework.Assert.IsNotNull(cmap); NUnit.Framework.Assert.IsTrue(cmap.IsDirect()); NUnit.Framework.Assert.IsFalse(cmap.HasUniMap()); NUnit.Framework.Assert.IsNull(cmap.GetUniMapName()); NUnit.Framework.Assert.AreEqual("Adobe", cmap.GetRegistry()); NUnit.Framework.Assert.AreEqual("Identity", cmap.GetOrdering()); NUnit.Framework.Assert.AreEqual(0, cmap.GetSupplement()); NUnit.Framework.Assert.AreEqual(PdfEncodings.IDENTITY_H, cmap.GetCmapName()); }
public virtual void DictionaryConstructorTest() { String filePath = sourceFolder + "documentWithType0Noto.pdf"; PdfDocument pdfDocument = new PdfDocument(new PdfReader(filePath)); PdfDictionary fontDict = pdfDocument.GetPage(1).GetResources().GetResource(PdfName.Font).GetAsDictionary(new PdfName("F1")); PdfType0Font type0Font = new PdfType0Font(fontDict); CMapEncoding cmap = type0Font.GetCmap(); NUnit.Framework.Assert.IsNotNull(cmap); NUnit.Framework.Assert.IsTrue(cmap.IsDirect()); NUnit.Framework.Assert.IsFalse(cmap.HasUniMap()); NUnit.Framework.Assert.IsNull(cmap.GetUniMapName()); NUnit.Framework.Assert.AreEqual("Adobe", cmap.GetRegistry()); NUnit.Framework.Assert.AreEqual("Identity", cmap.GetOrdering()); NUnit.Framework.Assert.AreEqual(0, cmap.GetSupplement()); NUnit.Framework.Assert.AreEqual(PdfEncodings.IDENTITY_H, cmap.GetCmapName()); }