Class TextPreprocessingUtil


  • public final class TextPreprocessingUtil
    extends java.lang.Object
    • Constructor Detail

      • TextPreprocessingUtil

        private TextPreprocessingUtil()
    • Method Detail

      • replaceSpecialWhitespaceGlyphs

        public static GlyphLine replaceSpecialWhitespaceGlyphs​(GlyphLine line,
                                                               PdfFont font)
        Replaces special whitespace glyphs to new whitespace ' ' glyph that has custom width. Special whitespace glyphs are symbols such as ' ', ' ', ' ' and '\t'.
        Parameters:
        line - the string for preprocessing
        font - the font that will be used when displaying the string
        Returns:
        old line with new special whitespace glyphs
      • calculateXAdvancement

        private static java.lang.Integer calculateXAdvancement​(int spaceWidth,
                                                               boolean isMonospaceFont,
                                                               Glyph glyph)