Class CFFType1Font

    • Constructor Detail

      • CFFType1Font

        public CFFType1Font()
    • Method Detail

      • getPath

        public java.awt.geom.GeneralPath getPath​(java.lang.String name)
                                          throws java.io.IOException
        Description copied from interface: FontBoxFont
        Returns the path for the character with the given name.
        Specified by:
        getPath in interface FontBoxFont
        Returns:
        glyph path
        Throws:
        java.io.IOException - if the path could not be read
      • getWidth

        public float getWidth​(java.lang.String name)
                       throws java.io.IOException
        Description copied from interface: FontBoxFont
        Returns the advance width for the character with the given name.
        Specified by:
        getWidth in interface FontBoxFont
        Returns:
        glyph advance width
        Throws:
        java.io.IOException - if the path could not be read
      • hasGlyph

        public boolean hasGlyph​(java.lang.String name)
        Description copied from interface: FontBoxFont
        Returns true if the font contains the given glyph.
        Specified by:
        hasGlyph in interface FontBoxFont
        Parameters:
        name - PostScript glyph name
      • getType1CharString

        public Type1CharString getType1CharString​(java.lang.String name)
                                           throws java.io.IOException
        Returns the Type 1 charstring for the given PostScript glyph name.
        Parameters:
        name - PostScript glyph name
        Throws:
        java.io.IOException - if the charstring could not be read
      • nameToGID

        public int nameToGID​(java.lang.String name)
        Returns the GID for the given PostScript glyph name.
        Parameters:
        name - a PostScript glyph name.
        Returns:
        GID
      • getType2CharString

        public Type2CharString getType2CharString​(int gid)
                                           throws java.io.IOException
        Returns the Type 1 charstring for the given GID.
        Specified by:
        getType2CharString in class CFFFont
        Parameters:
        gid - GID
        Throws:
        java.io.IOException - if the charstring could not be read
      • getType2CharString

        private Type2CharString getType2CharString​(int gid,
                                                   java.lang.String name)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getPrivateDict

        public java.util.Map<java.lang.String,​java.lang.Object> getPrivateDict()
        Returns the private dictionary.
        Returns:
        the dictionary
      • addToPrivateDict

        void addToPrivateDict​(java.lang.String name,
                              java.lang.Object value)
        Adds the given key/value pair to the private dictionary.
        Parameters:
        name - the given key
        value - the given value
      • setEncoding

        void setEncoding​(CFFEncoding encoding)
        Sets the CFFEncoding of the font.
        Parameters:
        encoding - the given CFFEncoding
      • getLocalSubrIndex

        private byte[][] getLocalSubrIndex()
      • getProperty

        private java.lang.Object getProperty​(java.lang.String name)
      • getDefaultWidthX

        private int getDefaultWidthX()
      • getNominalWidthX

        private int getNominalWidthX()