Exemplo n.º 1
0
        public virtual void RegularSymbolTest()
        {
            GlyphLine glyphLine    = new GlyphLine();
            Glyph     regularGlyph = pdfFont.GetGlyph('a');

            glyphLine.Add(0, regularGlyph);
            TextPreprocessingUtil.ReplaceSpecialWhitespaceGlyphs(glyphLine, pdfFont);
            Glyph glyph = glyphLine.Get(0);

            NUnit.Framework.Assert.AreEqual(regularGlyph, glyph);
        }
Exemplo n.º 2
0
        private void SpecialWhitespaceGlyphTest(int unicode)
        {
            GlyphLine glyphLine = new GlyphLine();

            // Create a new glyph, because it is a special glyph, and it is not contained in the regular font
            glyphLine.Add(0, new Glyph(0, unicode));
            TextPreprocessingUtil.ReplaceSpecialWhitespaceGlyphs(glyphLine, pdfFont);
            Glyph glyph = glyphLine.Get(0);
            Glyph space = pdfFont.GetGlyph('\u0020');

            NUnit.Framework.Assert.IsTrue(space.GetCode() == glyph.GetCode() && space.GetWidth() == glyph.GetWidth());
        }