Class PdfBoxTextRenderer

  • All Implemented Interfaces:
    com.openhtmltopdf.extend.TextRenderer

    public class PdfBoxTextRenderer
    extends Object
    implements com.openhtmltopdf.extend.TextRenderer
    • Method Summary

      Modifier and Type Method Description
      static List<PdfBoxSlowOutputDevice.FontRun> divideIntoFontRuns​(com.openhtmltopdf.render.FSFont font, String str, com.openhtmltopdf.bidi.BidiReorderer reorderer)  
      void drawGlyphVector​(com.openhtmltopdf.extend.OutputDevice outputDevice, com.openhtmltopdf.extend.FSGlyphVector vector, float x, float y)  
      void drawString​(com.openhtmltopdf.extend.OutputDevice outputDevice, String string, float x, float y)  
      void drawString​(com.openhtmltopdf.extend.OutputDevice outputDevice, String string, float x, float y, com.openhtmltopdf.render.JustificationInfo info)  
      float getFontScale()  
      com.openhtmltopdf.render.FSFontMetrics getFSFontMetrics​(com.openhtmltopdf.extend.FontContext context, com.openhtmltopdf.render.FSFont font, String string)  
      Rectangle getGlyphBounds​(com.openhtmltopdf.extend.OutputDevice outputDevice, com.openhtmltopdf.render.FSFont font, com.openhtmltopdf.extend.FSGlyphVector fsGlyphVector, int index, float x, float y)  
      float[] getGlyphPositions​(com.openhtmltopdf.extend.OutputDevice outputDevice, com.openhtmltopdf.render.FSFont font, com.openhtmltopdf.extend.FSGlyphVector fsGlyphVector)  
      com.openhtmltopdf.extend.FSGlyphVector getGlyphVector​(com.openhtmltopdf.extend.OutputDevice outputDevice, com.openhtmltopdf.render.FSFont font, String string)  
      int getSmoothingLevel()  
      int getWidth​(com.openhtmltopdf.extend.FontContext context, com.openhtmltopdf.render.FSFont font, String string)  
      static boolean isJustificationSpace​(int c)  
      void setFontScale​(float scale)  
      void setSmoothingLevel​(int level)  
      void setSmoothingThreshold​(float fontsize)  
      void setup​(com.openhtmltopdf.extend.FontContext context)  
      void setup​(com.openhtmltopdf.extend.FontContext context, com.openhtmltopdf.bidi.BidiReorderer reorderer)  
    • Constructor Detail

      • PdfBoxTextRenderer

        public PdfBoxTextRenderer()
    • Method Detail

      • setup

        public void setup​(com.openhtmltopdf.extend.FontContext context,
                          com.openhtmltopdf.bidi.BidiReorderer reorderer)
      • drawString

        public void drawString​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                               String string,
                               float x,
                               float y)
        Specified by:
        drawString in interface com.openhtmltopdf.extend.TextRenderer
      • drawString

        public void drawString​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                               String string,
                               float x,
                               float y,
                               com.openhtmltopdf.render.JustificationInfo info)
        Specified by:
        drawString in interface com.openhtmltopdf.extend.TextRenderer
      • getFSFontMetrics

        public com.openhtmltopdf.render.FSFontMetrics getFSFontMetrics​(com.openhtmltopdf.extend.FontContext context,
                                                                       com.openhtmltopdf.render.FSFont font,
                                                                       String string)
        Specified by:
        getFSFontMetrics in interface com.openhtmltopdf.extend.TextRenderer
      • isJustificationSpace

        public static boolean isJustificationSpace​(int c)
      • getWidth

        public int getWidth​(com.openhtmltopdf.extend.FontContext context,
                            com.openhtmltopdf.render.FSFont font,
                            String string)
        Specified by:
        getWidth in interface com.openhtmltopdf.extend.TextRenderer
      • setFontScale

        public void setFontScale​(float scale)
        Specified by:
        setFontScale in interface com.openhtmltopdf.extend.TextRenderer
      • getFontScale

        public float getFontScale()
        Specified by:
        getFontScale in interface com.openhtmltopdf.extend.TextRenderer
      • setSmoothingThreshold

        public void setSmoothingThreshold​(float fontsize)
        Specified by:
        setSmoothingThreshold in interface com.openhtmltopdf.extend.TextRenderer
      • getSmoothingLevel

        public int getSmoothingLevel()
        Specified by:
        getSmoothingLevel in interface com.openhtmltopdf.extend.TextRenderer
      • setSmoothingLevel

        public void setSmoothingLevel​(int level)
        Specified by:
        setSmoothingLevel in interface com.openhtmltopdf.extend.TextRenderer
      • getGlyphBounds

        public Rectangle getGlyphBounds​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                                        com.openhtmltopdf.render.FSFont font,
                                        com.openhtmltopdf.extend.FSGlyphVector fsGlyphVector,
                                        int index,
                                        float x,
                                        float y)
        Specified by:
        getGlyphBounds in interface com.openhtmltopdf.extend.TextRenderer
      • getGlyphPositions

        public float[] getGlyphPositions​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                                         com.openhtmltopdf.render.FSFont font,
                                         com.openhtmltopdf.extend.FSGlyphVector fsGlyphVector)
        Specified by:
        getGlyphPositions in interface com.openhtmltopdf.extend.TextRenderer
      • getGlyphVector

        public com.openhtmltopdf.extend.FSGlyphVector getGlyphVector​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                                                                     com.openhtmltopdf.render.FSFont font,
                                                                     String string)
        Specified by:
        getGlyphVector in interface com.openhtmltopdf.extend.TextRenderer
      • drawGlyphVector

        public void drawGlyphVector​(com.openhtmltopdf.extend.OutputDevice outputDevice,
                                    com.openhtmltopdf.extend.FSGlyphVector vector,
                                    float x,
                                    float y)
        Specified by:
        drawGlyphVector in interface com.openhtmltopdf.extend.TextRenderer
      • setup

        public void setup​(com.openhtmltopdf.extend.FontContext context)
        Specified by:
        setup in interface com.openhtmltopdf.extend.TextRenderer