示例#1
0
        public virtual void CustomType1FontPreferEmbeddedTest()
        {
            Type1Font    fontProgram = new PdfFontFactoryTest.CustomType1FontProgram();
            PdfType1Font font        = (PdfType1Font)PdfFontFactory.CreateFont(fontProgram, PdfEncodings.UTF8, PdfFontFactory.EmbeddingStrategy
                                                                               .PREFER_EMBEDDED);

            NUnit.Framework.Assert.IsNotNull(font);
            NUnit.Framework.Assert.IsTrue(font.IsEmbedded());
        }
示例#2
0
        public virtual void DeprecatedEmbeddedFlagTrueWorksAsPreferEmbeddedTest()
        {
            // simply checks that embedded = true works as prefer embedded
            // this test can be safely removed with clean up of deprecated methods in PdfFontFactory
            PdfType1Font font = (PdfType1Font)PdfFontFactory.CreateFont(StandardFonts.HELVETICA, true);

            NUnit.Framework.Assert.IsNotNull(font);
            NUnit.Framework.Assert.IsFalse(font.IsEmbedded());
        }
示例#3
0
        public virtual void StandardFontForceNotEmbeddedTest()
        {
            Type1Font    fontProgram = (Type1Font)FontProgramFactory.CreateFont(StandardFonts.HELVETICA);
            PdfType1Font font        = (PdfType1Font)PdfFontFactory.CreateFont(fontProgram, PdfEncodings.UTF8, PdfFontFactory.EmbeddingStrategy
                                                                               .FORCE_NOT_EMBEDDED);

            NUnit.Framework.Assert.IsNotNull(font);
            NUnit.Framework.Assert.IsFalse(font.IsEmbedded());
        }
示例#4
0
        public virtual void StandardFontCachedWithoutDocumentTest()
        {
            // this test ensures that method which allows caching into the document does not fail
            // if the document is null
            PdfDocument  cacheTo = null;
            PdfType1Font font    = (PdfType1Font)PdfFontFactory.CreateFont(StandardFonts.HELVETICA, PdfEncodings.UTF8, cacheTo
                                                                           );

            NUnit.Framework.Assert.IsNotNull(font);
            NUnit.Framework.Assert.IsFalse(font.IsEmbedded());
        }