Class BaseFont

java.lang.Object
com.lowagie.text.pdf.BaseFont
Direct Known Subclasses:
DocumentFont, Type3Font

@Deprecated public abstract class BaseFont extends Object
Deprecated.
Base class for the several font types supported
Author:
Paulo Soares (psoares@consiste.pt)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated.
    The maximum height above the baseline reached by glyphs in this font, excluding the height of glyphs for accented characters.
    static final int
    Deprecated.
    java.awt.Font property
    static final int
    Deprecated.
    java.awt.Font property
    static final int
    Deprecated.
    java.awt.Font property
    static final int
    Deprecated.
    java.awt.Font property
    static final int
    Deprecated.
    The lower left x glyph coordinate.
    static final int
    Deprecated.
    The lower left y glyph coordinate.
    static final int
    Deprecated.
    The upper right x glyph coordinate.
    static final int
    Deprecated.
    The upper right y glyph coordinate.
    protected static final HashMap<String,PdfName>
    Deprecated.
    list of the 14 built in fonts.
    static final boolean
    Deprecated.
    if the font has to be cached
    static final int
    Deprecated.
    The y coordinate of the top of flat capital letters, measured from the baseline.
    static final int[]
    Deprecated.
     
    static final int[]
    Deprecated.
     
    static final int[]
    Deprecated.
     
    static final int[]
    Deprecated.
     
    protected int[][]
    Deprecated.
     
    static final char
    Deprecated.
    The fake CID code that represents a newline.
    protected int
    Deprecated.
    The compression level for the font stream.
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    A possible encoding.
    static final String
    Deprecated.
    A possible encoding.
    static final String
    Deprecated.
    A possible encoding.
    static final int
    Deprecated.
    The maximum depth below the baseline reached by glyphs in this font.
    protected String[]
    Deprecated.
    encoding names
    protected boolean
    Deprecated.
    Converts char directly to byte by casting.
    protected boolean
    Deprecated.
    true if the font is to be embedded in the PDF
    static final boolean
    Deprecated.
    if the font has to be embedded
    protected String
    Deprecated.
    encoding used with this font
    protected boolean
    Deprecated.
     
    static final int
    Deprecated.
    The font is CJK.
    static final int
    Deprecated.
    A font already inside the document.
    static final int
    Deprecated.
    The font is Type 1.
    static final int
    Deprecated.
    A Type3 font.
    static final int
    Deprecated.
    The font is True Type with a standard encoding.
    static final int
    Deprecated.
    The font is True Type with a Unicode encoding.
    Deprecated.
    cache for the fonts already used.
    protected boolean
    Deprecated.
    true if the font must use its built in encoding.
    protected boolean
    Deprecated.
    Forces the output of the width array.
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    The Unicode encoding with horizontal writing.
    static final String
    Deprecated.
    The Unicode encoding with vertical writing.
    protected boolean
    Deprecated.
    Indicates if a CIDSet stream should be included in the document.
    static final int
    Deprecated.
    The angle, expressed in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font.
    static final String
    Deprecated.
    A possible encoding.
    static final boolean
    Deprecated.
    if the font doesn't have to be cached
    static final boolean
    Deprecated.
    if the font doesn't have to be embedded
    static final String
    Deprecated.
    a not defined character in a custom PDF encoding
    static final String
    Deprecated.
    The path to the font resources.
    protected SecureRandom
    Deprecated.
    Used to build a randomized prefix for a subset name
    protected IntHashtable
    Deprecated.
    Custom encodings use this map to key the Unicode character to the single byte code.
    static final int
    Deprecated.
    The strikethrough position.
    static final int
    Deprecated.
    The strikethrough thickness.
    static final int
    Deprecated.
    The recommended vertical offset from the baseline for subscripts for this font.
    static final int
    Deprecated.
    The recommended vertical size for subscripts for this font.
    protected boolean
    Deprecated.
    Indicates if all the glyphs and widths for that particular encoding should be included in the document.
    protected ArrayList<int[]>
    Deprecated.
     
    static final int
    Deprecated.
    The recommended vertical offset from the baseline for superscripts for this font.
    static final int
    Deprecated.
    The recommended vertical size for superscripts for this font.
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
    static final int
    Deprecated.
    The underline position.
    static final int
    Deprecated.
    The underline thickness.
    protected char[]
    Deprecated.
    same as differences but with the unicode codes
    protected int[]
    Deprecated.
    table of characters widths for this encoding
    static final String
    Deprecated.
    A possible encoding.
    static final String
    Deprecated.
    This is a possible value of a base 14 type 1 font
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Deprecated.
    Creates new BaseFont
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSubsetRange(int[] range)
    Deprecated.
    Adds a character range when subsetting.
    boolean
    charExists(int c)
    Deprecated.
    Checks if a character exists in this font.
    void
    Deprecated.
    iText expects Arabic Diactrics (tashkeel) to have zero advance but some fonts, most notably those that come with Windows, like times.ttf, have non-zero advance for those characters.
    protected void
    Deprecated.
    Creates the widths and the differences arrays
    static BaseFont
    Deprecated.
    Creates a new font.
    static BaseFont
    Deprecated.
    Creates a font based on an existing document font.
    static BaseFont
    createFont(String name, String encoding, boolean embedded)
    Deprecated.
    Creates a new font.
    static BaseFont
    createFont(String name, String encoding, boolean embedded, boolean forceRead)
    Deprecated.
    Creates a new font.
    static BaseFont
    createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb)
    Deprecated.
    Creates a new font.
    static BaseFont
    createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb, boolean noThrow)
    Deprecated.
    Creates a new font.
    static BaseFont
    createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb, boolean noThrow, boolean forceRead)
    Deprecated.
    Creates a new font.
    protected String
    Deprecated.
    Creates a unique subset prefix to be added to the font name when the font is embedded and subset.
    static String[]
    enumerateTTCNames(byte[] ttcArray)
    Deprecated.
    Enumerates the postscript font names present inside a True Type Collection.
    static String[]
    Deprecated.
    Enumerates the postscript font names present inside a True Type Collection.
    static Object[]
    getAllFontNames(String name, String encoding, byte[] ttfAfm)
    Deprecated.
    Gets all the names from the font.
    abstract String[][]
    Deprecated.
    Gets all the entries of the names-table.
    static String[][]
    getAllNameEntries(String name, String encoding, byte[] ttfAfm)
    Deprecated.
    Gets all the entries of the namestable from the font.
    int
    Deprecated.
    Gets the ascent of a String in normalized 1000 units.
    float
    getAscentPoint(String text, float fontSize)
    Deprecated.
    Gets the ascent of a String in points.
    protected static String
    Deprecated.
    Gets the name without the modifiers Bold, Italic or BoldItalic.
    int[]
    getCharBBox(int c)
    Deprecated.
    Gets the smallest box enclosing the character contours.
    int
    getCidCode(int c)
    Deprecated.
    Gets the CID code given an Unicode.
    Deprecated.
    Gets the code pages supported by the font.
    int
    Deprecated.
    Returns the compression level used for the font streams.
    int
    Deprecated.
    Gets the descent of a String in normalized 1000 units.
    float
    getDescentPoint(String text, float fontSize)
    Deprecated.
    Gets the descent of a String in points.
    Deprecated.
    Gets the array with the names of the characters.
    static ArrayList<Object[]>
    Deprecated.
    Gets a list of all document fonts.
    static ArrayList<Object[]>
    getDocumentFonts(PdfReader reader, int page)
    Deprecated.
    Gets a list of the document fonts in a particular page.
    Deprecated.
    Gets the encoding used to convert String into byte[].
    abstract String[][]
    Deprecated.
    Gets the family name of the font.
    abstract float
    getFontDescriptor(int key, float fontSize)
    Deprecated.
    Gets the font parameter identified by key.
    int
    Deprecated.
    Gets the font type.
    abstract String[][]
    Deprecated.
    Gets the full name of the font.
    static String[][]
    getFullFontName(String name, String encoding, byte[] ttfAfm)
    Deprecated.
    Gets the full name of the font.
    abstract int
    getKerning(int char1, int char2)
    Deprecated.
    Gets the kerning between two Unicode chars.
    abstract String
    Deprecated.
    Gets the postscript font name.
    protected abstract int[]
    getRawCharBBox(int c, String name)
    Deprecated.
     
    Deprecated.
    Gets the font resources.
    Deprecated.
    Gets the font resources.
    protected SecureRandom
    Deprecated.
    Returns a defined SecureRandom implementation.
    char[]
    Deprecated.
    Gets the array with the unicode characters.
    int
    Deprecated.
    Gets the Unicode equivalent to a CID.
    int
    getWidth(int char1)
    Deprecated.
    Gets the width of a char in normalized 1000 units.
    int
    Deprecated.
    Gets the width of a String in normalized 1000 units.
    float
    getWidthPoint(int char1, float fontSize)
    Deprecated.
    Gets the width of a char in points.
    float
    getWidthPoint(String text, float fontSize)
    Deprecated.
    Gets the width of a String in points.
    float
    getWidthPointKerned(String text, float fontSize)
    Deprecated.
    Gets the width of a String in points taking kerning into account.
    int[]
    Deprecated.
    Gets the font width array.
    abstract boolean
    Deprecated.
    Checks if the font has any kerning pairs.
    boolean
    Deprecated.
    Gets the direct conversion of char to byte.
    boolean
    Deprecated.
    Gets the embedded flag.
    boolean
    Deprecated.
    Gets the symbolic flag of the font.
    boolean
    Deprecated.
    Gets the state of the property.
    boolean
    Deprecated.
    Indicates if a CIDSet stream should be included in the document for TrueTypeFontUnicode.
    boolean
    Deprecated.
    Indicates if all the glyphs and widths for that particular encoding should be included in the document.
    protected static String
    Deprecated.
    Normalize the encoding names.
    boolean
    setCharAdvance(int c, int advance)
    Deprecated.
    Sets the character advance.
    void
    setCompressionLevel(int compressionLevel)
    Deprecated.
    Sets the compression level to be used for the font streams.
    void
    setDirectTextToByte(boolean directTextToByte)
    Deprecated.
    Sets the conversion of char directly to byte by casting.
    void
    setForceWidthsOutput(boolean forceWidthsOutput)
    Deprecated.
    Set to true to force the generation of the widths array.
    void
    setIncludeCidSet(boolean includeCidSet)
    Deprecated.
    Indicates if a CIDSet stream should be included in the document for TrueTypeFontUnicode.
    abstract boolean
    setKerning(int char1, int char2, int kern)
    Deprecated.
    Sets the kerning between two Unicode chars.
    abstract void
    Deprecated.
    Sets the font name that will appear in the pdf font dictionary.
    void
    Deprecated.
    Sets the SecureRandom instance to be used for a subset's prefix generation
    void
    setSubset(boolean subset)
    Deprecated.
    Indicates if all the glyphs and widths for that particular encoding should be included in the document.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COURIER

      public static final String COURIER
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • COURIER_BOLD

      public static final String COURIER_BOLD
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • COURIER_OBLIQUE

      public static final String COURIER_OBLIQUE
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • COURIER_BOLDOBLIQUE

      public static final String COURIER_BOLDOBLIQUE
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • HELVETICA

      public static final String HELVETICA
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • HELVETICA_BOLD

      public static final String HELVETICA_BOLD
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • HELVETICA_OBLIQUE

      public static final String HELVETICA_OBLIQUE
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • HELVETICA_BOLDOBLIQUE

      public static final String HELVETICA_BOLDOBLIQUE
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • SYMBOL

      public static final String SYMBOL
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • TIMES_ROMAN

      public static final String TIMES_ROMAN
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • TIMES_BOLD

      public static final String TIMES_BOLD
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • TIMES_ITALIC

      public static final String TIMES_ITALIC
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • TIMES_BOLDITALIC

      public static final String TIMES_BOLDITALIC
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • ZAPFDINGBATS

      public static final String ZAPFDINGBATS
      Deprecated.
      This is a possible value of a base 14 type 1 font
      See Also:
    • ASCENT

      public static final int ASCENT
      Deprecated.
      The maximum height above the baseline reached by glyphs in this font, excluding the height of glyphs for accented characters.
      See Also:
    • CAPHEIGHT

      public static final int CAPHEIGHT
      Deprecated.
      The y coordinate of the top of flat capital letters, measured from the baseline.
      See Also:
    • DESCENT

      public static final int DESCENT
      Deprecated.
      The maximum depth below the baseline reached by glyphs in this font. The value is a negative number.
      See Also:
    • ITALICANGLE

      public static final int ITALICANGLE
      Deprecated.
      The angle, expressed in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font. The value is negative for fonts that slope to the right, as almost all italic fonts do.
      See Also:
    • BBOXLLX

      public static final int BBOXLLX
      Deprecated.
      The lower left x glyph coordinate.
      See Also:
    • BBOXLLY

      public static final int BBOXLLY
      Deprecated.
      The lower left y glyph coordinate.
      See Also:
    • BBOXURX

      public static final int BBOXURX
      Deprecated.
      The upper right x glyph coordinate.
      See Also:
    • BBOXURY

      public static final int BBOXURY
      Deprecated.
      The upper right y glyph coordinate.
      See Also:
    • AWT_ASCENT

      public static final int AWT_ASCENT
      Deprecated.
      java.awt.Font property
      See Also:
    • AWT_DESCENT

      public static final int AWT_DESCENT
      Deprecated.
      java.awt.Font property
      See Also:
    • AWT_LEADING

      public static final int AWT_LEADING
      Deprecated.
      java.awt.Font property
      See Also:
    • AWT_MAXADVANCE

      public static final int AWT_MAXADVANCE
      Deprecated.
      java.awt.Font property
      See Also:
    • UNDERLINE_POSITION

      public static final int UNDERLINE_POSITION
      Deprecated.
      The underline position. Usually a negative value.
      See Also:
    • UNDERLINE_THICKNESS

      public static final int UNDERLINE_THICKNESS
      Deprecated.
      The underline thickness.
      See Also:
    • STRIKETHROUGH_POSITION

      public static final int STRIKETHROUGH_POSITION
      Deprecated.
      The strikethrough position.
      See Also:
    • STRIKETHROUGH_THICKNESS

      public static final int STRIKETHROUGH_THICKNESS
      Deprecated.
      The strikethrough thickness.
      See Also:
    • SUBSCRIPT_SIZE

      public static final int SUBSCRIPT_SIZE
      Deprecated.
      The recommended vertical size for subscripts for this font.
      See Also:
    • SUBSCRIPT_OFFSET

      public static final int SUBSCRIPT_OFFSET
      Deprecated.
      The recommended vertical offset from the baseline for subscripts for this font. Usually a negative value.
      See Also:
    • SUPERSCRIPT_SIZE

      public static final int SUPERSCRIPT_SIZE
      Deprecated.
      The recommended vertical size for superscripts for this font.
      See Also:
    • SUPERSCRIPT_OFFSET

      public static final int SUPERSCRIPT_OFFSET
      Deprecated.
      The recommended vertical offset from the baseline for superscripts for this font.
      See Also:
    • FONT_TYPE_T1

      public static final int FONT_TYPE_T1
      Deprecated.
      The font is Type 1.
      See Also:
    • FONT_TYPE_TT

      public static final int FONT_TYPE_TT
      Deprecated.
      The font is True Type with a standard encoding.
      See Also:
    • FONT_TYPE_CJK

      public static final int FONT_TYPE_CJK
      Deprecated.
      The font is CJK.
      See Also:
    • FONT_TYPE_TTUNI

      public static final int FONT_TYPE_TTUNI
      Deprecated.
      The font is True Type with a Unicode encoding.
      See Also:
    • FONT_TYPE_DOCUMENT

      public static final int FONT_TYPE_DOCUMENT
      Deprecated.
      A font already inside the document.
      See Also:
    • FONT_TYPE_T3

      public static final int FONT_TYPE_T3
      Deprecated.
      A Type3 font.
      See Also:
    • IDENTITY_H

      public static final String IDENTITY_H
      Deprecated.
      The Unicode encoding with horizontal writing.
      See Also:
    • IDENTITY_V

      public static final String IDENTITY_V
      Deprecated.
      The Unicode encoding with vertical writing.
      See Also:
    • CP1250

      public static final String CP1250
      Deprecated.
      A possible encoding.
      See Also:
    • CP1252

      public static final String CP1252
      Deprecated.
      A possible encoding.
      See Also:
    • CP1257

      public static final String CP1257
      Deprecated.
      A possible encoding.
      See Also:
    • WINANSI

      public static final String WINANSI
      Deprecated.
      A possible encoding.
      See Also:
    • MACROMAN

      public static final String MACROMAN
      Deprecated.
      A possible encoding.
      See Also:
    • CHAR_RANGE_LATIN

      public static final int[] CHAR_RANGE_LATIN
      Deprecated.
    • CHAR_RANGE_ARABIC

      public static final int[] CHAR_RANGE_ARABIC
      Deprecated.
    • CHAR_RANGE_HEBREW

      public static final int[] CHAR_RANGE_HEBREW
      Deprecated.
    • CHAR_RANGE_CYRILLIC

      public static final int[] CHAR_RANGE_CYRILLIC
      Deprecated.
    • EMBEDDED

      public static final boolean EMBEDDED
      Deprecated.
      if the font has to be embedded
      See Also:
    • NOT_EMBEDDED

      public static final boolean NOT_EMBEDDED
      Deprecated.
      if the font doesn't have to be embedded
      See Also:
    • CACHED

      public static final boolean CACHED
      Deprecated.
      if the font has to be cached
      See Also:
    • NOT_CACHED

      public static final boolean NOT_CACHED
      Deprecated.
      if the font doesn't have to be cached
      See Also:
    • RESOURCE_PATH

      public static final String RESOURCE_PATH
      Deprecated.
      The path to the font resources.
      See Also:
    • CID_NEWLINE

      public static final char CID_NEWLINE
      Deprecated.
      The fake CID code that represents a newline.
      See Also:
    • notdef

      public static final String notdef
      Deprecated.
      a not defined character in a custom PDF encoding
      See Also:
    • BuiltinFonts14

      protected static final HashMap<String,PdfName> BuiltinFonts14
      Deprecated.
      list of the 14 built in fonts.
    • fontCache

      protected static ConcurrentHashMap<String,BaseFont> fontCache
      Deprecated.
      cache for the fonts already used.
    • subsetRanges

      protected ArrayList<int[]> subsetRanges
      Deprecated.
    • widths

      protected int[] widths
      Deprecated.
      table of characters widths for this encoding
    • differences

      protected String[] differences
      Deprecated.
      encoding names
    • unicodeDifferences

      protected char[] unicodeDifferences
      Deprecated.
      same as differences but with the unicode codes
    • charBBoxes

      protected int[][] charBBoxes
      Deprecated.
    • encoding

      protected String encoding
      Deprecated.
      encoding used with this font
    • embedded

      protected boolean embedded
      Deprecated.
      true if the font is to be embedded in the PDF
    • compressionLevel

      protected int compressionLevel
      Deprecated.
      The compression level for the font stream.
      Since:
      2.1.3
    • fontSpecific

      protected boolean fontSpecific
      Deprecated.
      true if the font must use its built in encoding. In that case the encoding is only used to map a char to the position inside the font, not to the expected char name.
    • forceWidthsOutput

      protected boolean forceWidthsOutput
      Deprecated.
      Forces the output of the width array. Only matters for the 14 built-in fonts.
    • directTextToByte

      protected boolean directTextToByte
      Deprecated.
      Converts char directly to byte by casting.
    • subset

      protected boolean subset
      Deprecated.
      Indicates if all the glyphs and widths for that particular encoding should be included in the document.
    • fastWinansi

      protected boolean fastWinansi
      Deprecated.
    • specialMap

      protected IntHashtable specialMap
      Deprecated.
      Custom encodings use this map to key the Unicode character to the single byte code.
    • secureRandom

      protected SecureRandom secureRandom
      Deprecated.
      Used to build a randomized prefix for a subset name
    • includeCidSet

      protected boolean includeCidSet
      Deprecated.
      Indicates if a CIDSet stream should be included in the document.
  • Constructor Details

    • BaseFont

      protected BaseFont()
      Deprecated.
      Creates new BaseFont
  • Method Details

    • createFont

      public static BaseFont createFont() throws DocumentException, IOException
      Deprecated.
      Creates a new font. This will always be the default Helvetica font (not embedded). This method is introduced because Helvetica is used in many examples.
      Returns:
      a BaseFont object (Helvetica, Winansi, not embedded)
      Throws:
      IOException - This shouldn't occur ever
      DocumentException - This shouldn't occur ever
      Since:
      2.1.1
    • createFont

      public static BaseFont createFont(String name, String encoding, boolean embedded) throws DocumentException, IOException
      Deprecated.
      Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".

      The fonts are cached and if they already exist they are extracted from the cache, not parsed again.

      Besides the common encodings described by name, custom encodings can also be made. These encodings will only work for the single byte fonts Type1 and TrueType. The encoding string starts with a '#' followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list of hex values representing the Unicode codes that compose that encoding.
      The "simple" encoding is recommended for TrueType fonts as the "full" encoding risks not matching the character with the right glyph if not done with care.
      The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be described by non standard names like the Tex math fonts. Each group of three elements compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character used to access the glyph. The space must be assigned to character position 32 otherwise text justification will not work.

      Example for a "simple" encoding that includes the Unicode character space, A, B and ecyrillic:

       "# simple 32 0020 0041 0042 0454"
       

      Example for a "full" encoding for a Type1 Tex font:

       "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
       

      This method calls:

       createFont(name, encoding, embedded, true, null, null);
       
      Parameters:
      name - the name of the font or its location on file
      encoding - the encoding to be applied to this font
      embedded - true if the font is to be embedded in the PDF
      Returns:
      returns a new font. This font may come from the cache
      Throws:
      DocumentException - the font is invalid
      IOException - the font file could not be read
    • createFont

      public static BaseFont createFont(String name, String encoding, boolean embedded, boolean forceRead) throws DocumentException, IOException
      Deprecated.
      Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".

      The fonts are cached and if they already exist they are extracted from the cache, not parsed again.

      Besides the common encodings described by name, custom encodings can also be made. These encodings will only work for the single byte fonts Type1 and TrueType. The encoding string starts with a '#' followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list of hex values representing the Unicode codes that compose that encoding.
      The "simple" encoding is recommended for TrueType fonts as the "full" encoding risks not matching the character with the right glyph if not done with care.
      The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be described by non standard names like the Tex math fonts. Each group of three elements compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character used to access the glyph. The space must be assigned to character position 32 otherwise text justification will not work.

      Example for a "simple" encoding that includes the Unicode character space, A, B and ecyrillic:

       "# simple 32 0020 0041 0042 0454"
       

      Example for a "full" encoding for a Type1 Tex font:

       "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
       

      This method calls:

       createFont(name, encoding, embedded, true, null, null);
       
      Parameters:
      name - the name of the font or its location on file
      encoding - the encoding to be applied to this font
      embedded - true if the font is to be embedded in the PDF
      forceRead - in some cases (TrueTypeFont, Type1Font), the full font file will be read and kept in memory if forceRead is true
      Returns:
      returns a new font. This font may come from the cache
      Throws:
      DocumentException - the font is invalid
      IOException - the font file could not be read
      Since:
      2.1.5
    • createFont

      public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb) throws DocumentException, IOException
      Deprecated.
      Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".

      The fonts may or may not be cached depending on the flag cached. If the byte arrays are present the font will be read from them instead of the name. A name is still required to identify the font type.

      Besides the common encodings described by name, custom encodings can also be made. These encodings will only work for the single byte fonts Type1 and TrueType. The encoding string starts with a '#' followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list of hex values representing the Unicode codes that compose that encoding.
      The "simple" encoding is recommended for TrueType fonts as the "full" encoding risks not matching the character with the right glyph if not done with care.
      The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be described by non standard names like the Tex math fonts. Each group of three elements compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character used to access the glyph. The space must be assigned to character position 32 otherwise text justification will not work.

      Example for a "simple" encoding that includes the Unicode character space, A, B and ecyrillic:

       "# simple 32 0020 0041 0042 0454"
       

      Example for a "full" encoding for a Type1 Tex font:

       "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
       
      Parameters:
      name - the name of the font or its location on file
      encoding - the encoding to be applied to this font
      embedded - true if the font is to be embedded in the PDF
      cached - true if the font comes from the cache or is added to the cache if new, false if the font is always created new
      ttfAfm - the true type font or the afm in a byte array
      pfb - the pfb in a byte array
      Returns:
      returns a new font. This font may come from the cache but only if cached is true, otherwise it will always be created new
      Throws:
      DocumentException - the font is invalid
      IOException - the font file could not be read
      Since:
      iText 0.80
    • createFont

      public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb, boolean noThrow) throws DocumentException, IOException
      Deprecated.
      Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".

      The fonts may or may not be cached depending on the flag cached. If the byte arrays are present the font will be read from them instead of the name. A name is still required to identify the font type.

      Besides the common encodings described by name, custom encodings can also be made. These encodings will only work for the single byte fonts Type1 and TrueType. The encoding string starts with a '#' followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list of hex values representing the Unicode codes that compose that encoding.
      The "simple" encoding is recommended for TrueType fonts as the "full" encoding risks not matching the character with the right glyph if not done with care.
      The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be described by non standard names like the Tex math fonts. Each group of three elements compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character used to access the glyph. The space must be assigned to character position 32 otherwise text justification will not work.

      Example for a "simple" encoding that includes the Unicode character space, A, B and ecyrillic:

       "# simple 32 0020 0041 0042 0454"
       

      Example for a "full" encoding for a Type1 Tex font:

       "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
       
      Parameters:
      name - the name of the font or its location on file
      encoding - the encoding to be applied to this font
      embedded - true if the font is to be embedded in the PDF
      cached - true if the font comes from the cache or is added to the cache if new, false if the font is always created new
      ttfAfm - the true type font or the afm in a byte array
      pfb - the pfb in a byte array
      noThrow - if true will not throw an exception if the font is not recognized and will return null, if false will throw an exception if the font is not recognized. Note that even if true an exception may be thrown in some circumstances. This parameter is useful for FontFactory that may have to check many invalid font names before finding the right one
      Returns:
      returns a new font. This font may come from the cache but only if cached is true, otherwise it will always be created new
      Throws:
      DocumentException - the font is invalid
      IOException - the font file could not be read
      Since:
      2.0.3
    • createFont

      public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte[] ttfAfm, byte[] pfb, boolean noThrow, boolean forceRead) throws DocumentException, IOException
      Deprecated.
      Creates a new font. This font can be one of the 14 built in types, a Type1 font referred to by an AFM or PFM file, a TrueType font (simple or collection) or a CJK font from the Adobe Asian Font Pack. TrueType fonts and CJK fonts can have an optional style modifier appended to the name. These modifiers are: Bold, Italic and BoldItalic. An example would be "STSong-Light,Bold". Note that this modifiers do not work if the font is embedded. Fonts in TrueType collections are addressed by index such as "msgothic.ttc,1". This would get the second font (indexes start at 0), in this case "MS PGothic".

      The fonts may or may not be cached depending on the flag cached. If the byte arrays are present the font will be read from them instead of the name. A name is still required to identify the font type.

      Besides the common encodings described by name, custom encodings can also be made. These encodings will only work for the single byte fonts Type1 and TrueType. The encoding string starts with a '#' followed by "simple" or "full". If "simple" there is a decimal for the first character position and then a list of hex values representing the Unicode codes that compose that encoding.
      The "simple" encoding is recommended for TrueType fonts as the "full" encoding risks not matching the character with the right glyph if not done with care.
      The "full" encoding is specially aimed at Type1 fonts where the glyphs have to be described by non standard names like the Tex math fonts. Each group of three elements compose a code position: the one byte code order in decimal or as 'x' (x cannot be the space), the name and the Unicode character used to access the glyph. The space must be assigned to character position 32 otherwise text justification will not work.

      Example for a "simple" encoding that includes the Unicode character space, A, B and ecyrillic:

       "# simple 32 0020 0041 0042 0454"
       

      Example for a "full" encoding for a Type1 Tex font:

       "# full 'A' nottriangeqlleft 0041 'B' dividemultiply 0042 32 space 0020"
       
      Parameters:
      name - the name of the font or its location on file
      encoding - the encoding to be applied to this font
      embedded - true if the font is to be embedded in the PDF
      cached - true if the font comes from the cache or is added to the cache if new, false if the font is always created new
      ttfAfm - the true type font or the afm in a byte array
      pfb - the pfb in a byte array
      noThrow - if true will not throw an exception if the font is not recognized and will return null, if false will throw an exception if the font is not recognized. Note that even if true an exception may be thrown in some circumstances. This parameter is useful for FontFactory that may have to check many invalid font names before finding the right one
      forceRead - in some cases (TrueTypeFont, Type1Font), the full font file will be read and kept in memory if forceRead is true
      Returns:
      returns a new font. This font may come from the cache but only if cached is true, otherwise it will always be created new
      Throws:
      DocumentException - the font is invalid
      IOException - the font file could not be read
      Since:
      2.1.5
    • createFont

      public static BaseFont createFont(PRIndirectReference fontRef)
      Deprecated.
      Creates a font based on an existing document font. The created font font may not behave as expected, depending on the encoding or subset.
      Parameters:
      fontRef - the reference to the document font
      Returns:
      the font
    • getBaseName

      protected static String getBaseName(String name)
      Deprecated.
      Gets the name without the modifiers Bold, Italic or BoldItalic.
      Parameters:
      name - the full name of the font
      Returns:
      the name without the modifiers Bold, Italic or BoldItalic
    • normalizeEncoding

      protected static String normalizeEncoding(String enc)
      Deprecated.
      Normalize the encoding names. "winansi" is changed to "Cp1252" and "macroman" is changed to "MacRoman".
      Parameters:
      enc - the encoding to be normalized
      Returns:
      the normalized encoding
    • getFullFontName

      public static String[][] getFullFontName(String name, String encoding, byte[] ttfAfm) throws DocumentException, IOException
      Deprecated.
      Gets the full name of the font. If it is a True Type font each array element will have {Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
      For the other fonts the array has a single element with {"", "", "", font name}.
      Parameters:
      name - the name of the font
      encoding - the encoding of the font
      ttfAfm - the true type font or the afm in a byte array
      Returns:
      the full name of the font
      Throws:
      DocumentException - on error
      IOException - on error
    • getAllFontNames

      public static Object[] getAllFontNames(String name, String encoding, byte[] ttfAfm) throws DocumentException, IOException
      Deprecated.
      Gets all the names from the font. Only the required tables are read.
      Parameters:
      name - the name of the font
      encoding - the encoding of the font
      ttfAfm - the true type font or the afm in a byte array
      Returns:
      an array of Object[] built with {getPostscriptFontName(), getFamilyFontName(), getFullFontName()}
      Throws:
      DocumentException - on error
      IOException - on error
    • getAllNameEntries

      public static String[][] getAllNameEntries(String name, String encoding, byte[] ttfAfm) throws DocumentException, IOException
      Deprecated.
      Gets all the entries of the namestable from the font. Only the required tables are read.
      Parameters:
      name - the name of the font
      encoding - the encoding of the font
      ttfAfm - the true type font or the afm in a byte array
      Returns:
      an array of Object[] built with {getPostscriptFontName(), getFamilyFontName(), getFullFontName()}
      Throws:
      DocumentException - on error
      IOException - on error
      Since:
      2.0.8
    • enumerateTTCNames

      public static String[] enumerateTTCNames(String ttcFile) throws DocumentException, IOException
      Deprecated.
      Enumerates the postscript font names present inside a True Type Collection.
      Parameters:
      ttcFile - the file name of the font
      Returns:
      the postscript font names
      Throws:
      DocumentException - on error
      IOException - on error
    • enumerateTTCNames

      public static String[] enumerateTTCNames(byte[] ttcArray) throws DocumentException, IOException
      Deprecated.
      Enumerates the postscript font names present inside a True Type Collection.
      Parameters:
      ttcArray - the font as a byte array
      Returns:
      the postscript font names
      Throws:
      DocumentException - on error
      IOException - on error
    • getResourceStream

      public static InputStream getResourceStream(String key)
      Deprecated.
      Gets the font resources.
      Parameters:
      key - the full name of the resource
      Returns:
      the InputStream to get the resource or null if not found
    • getResourceStream

      public static InputStream getResourceStream(String key, ClassLoader loader)
      Deprecated.
      Gets the font resources.
      Parameters:
      key - the full name of the resource
      loader - the ClassLoader to load the resource or null to try the ones available
      Returns:
      the InputStream to get the resource or null if not found
    • getDocumentFonts

      public static ArrayList<Object[]> getDocumentFonts(PdfReader reader)
      Deprecated.
      Gets a list of all document fonts. Each element of the ArrayList contains a Object[]{String,PRIndirectReference} with the font name and the indirect reference to it.
      Parameters:
      reader - the document where the fonts are to be listed from
      Returns:
      the list of fonts and references
    • getDocumentFonts

      public static ArrayList<Object[]> getDocumentFonts(PdfReader reader, int page)
      Deprecated.
      Gets a list of the document fonts in a particular page. Each element of the ArrayList contains a Object[]{String,PRIndirectReference} with the font name and the indirect reference to it.
      Parameters:
      reader - the document where the fonts are to be listed from
      page - the page to list the fonts from
      Returns:
      the list of fonts and references
    • createEncoding

      protected void createEncoding()
      Deprecated.
      Creates the widths and the differences arrays
    • getKerning

      public abstract int getKerning(int char1, int char2)
      Deprecated.
      Gets the kerning between two Unicode chars.
      Parameters:
      char1 - the first char
      char2 - the second char
      Returns:
      the kerning to be applied in normalized 1000 units
    • setKerning

      public abstract boolean setKerning(int char1, int char2, int kern)
      Deprecated.
      Sets the kerning between two Unicode chars.
      Parameters:
      char1 - the first char
      char2 - the second char
      kern - the kerning to apply in normalized 1000 units
      Returns:
      true if the kerning was applied, false otherwise
    • getWidth

      public int getWidth(int char1)
      Deprecated.
      Gets the width of a char in normalized 1000 units.
      Parameters:
      char1 - the unicode char to get the width of
      Returns:
      the width in normalized 1000 units
    • getWidth

      public int getWidth(String text)
      Deprecated.
      Gets the width of a String in normalized 1000 units.
      Parameters:
      text - the String to get the width of
      Returns:
      the width in normalized 1000 units
    • getDescent

      public int getDescent(String text)
      Deprecated.
      Gets the descent of a String in normalized 1000 units. The descent will always be less than or equal to zero even if all the characters have an higher descent.
      Parameters:
      text - the String to get the descent of
      Returns:
      the descent in normalized 1000 units
    • getAscent

      public int getAscent(String text)
      Deprecated.
      Gets the ascent of a String in normalized 1000 units. The ascent will always be greater than or equal to zero even if all the characters have a lower ascent.
      Parameters:
      text - the String to get the ascent of
      Returns:
      the ascent in normalized 1000 units
    • getDescentPoint

      public float getDescentPoint(String text, float fontSize)
      Deprecated.
      Gets the descent of a String in points. The descent will always be less than or equal to zero even if all the characters have an higher descent.
      Parameters:
      text - the String to get the descent of
      fontSize - the size of the font
      Returns:
      the descent in points
    • getAscentPoint

      public float getAscentPoint(String text, float fontSize)
      Deprecated.
      Gets the ascent of a String in points. The ascent will always be greater than or equal to zero even if all the characters have a lower ascent.
      Parameters:
      text - the String to get the ascent of
      fontSize - the size of the font
      Returns:
      the ascent in points
    • getWidthPointKerned

      public float getWidthPointKerned(String text, float fontSize)
      Deprecated.
      Gets the width of a String in points taking kerning into account.
      Parameters:
      text - the String to get the width of
      fontSize - the font size
      Returns:
      the width in points
    • getWidthPoint

      public float getWidthPoint(String text, float fontSize)
      Deprecated.
      Gets the width of a String in points.
      Parameters:
      text - the String to get the width of
      fontSize - the font size
      Returns:
      the width in points
    • getWidthPoint

      public float getWidthPoint(int char1, float fontSize)
      Deprecated.
      Gets the width of a char in points.
      Parameters:
      char1 - the char to get the width of
      fontSize - the font size
      Returns:
      the width in points
    • getEncoding

      public String getEncoding()
      Deprecated.
      Gets the encoding used to convert String into byte[].
      Returns:
      the encoding name
    • getFontDescriptor

      public abstract float getFontDescriptor(int key, float fontSize)
      Deprecated.
      Gets the font parameter identified by key. Valid values for key are ASCENT, AWT_ASCENT, CAPHEIGHT, DESCENT, AWT_DESCENT, ITALICANGLE, BBOXLLX, BBOXLLY, BBOXURX and BBOXURY.
      Parameters:
      key - the parameter to be extracted
      fontSize - the font size in points
      Returns:
      the parameter in points
    • getFontType

      public int getFontType()
      Deprecated.
      Gets the font type. The font types can be: FONT_TYPE_T1, FONT_TYPE_TT, FONT_TYPE_CJK and FONT_TYPE_TTUNI.
      Returns:
      the font type
    • isEmbedded

      public boolean isEmbedded()
      Deprecated.
      Gets the embedded flag.
      Returns:
      true if the font is embedded.
    • isFontSpecific

      public boolean isFontSpecific()
      Deprecated.
      Gets the symbolic flag of the font.
      Returns:
      true if the font is symbolic
    • createSubsetPrefix

      protected String createSubsetPrefix()
      Deprecated.
      Creates a unique subset prefix to be added to the font name when the font is embedded and subset.
      Returns:
      the subset prefix
    • getSecureRandom

      protected SecureRandom getSecureRandom()
      Deprecated.
      Returns a defined SecureRandom implementation. If nothing is set, returns a new
      Returns:
      SecureRandom
    • setSecureRandom

      public void setSecureRandom(SecureRandom secureRandom)
      Deprecated.
      Sets the SecureRandom instance to be used for a subset's prefix generation
      Parameters:
      secureRandom - SecureRandom
    • getPostscriptFontName

      public abstract String getPostscriptFontName()
      Deprecated.
      Gets the postscript font name.
      Returns:
      the postscript font name
    • setPostscriptFontName

      public abstract void setPostscriptFontName(String name)
      Deprecated.
      Sets the font name that will appear in the pdf font dictionary. Use with care as it can easily make a font unreadable if not embedded.
      Parameters:
      name - the new font name
    • getFullFontName

      public abstract String[][] getFullFontName()
      Deprecated.
      Gets the full name of the font. If it is a True Type font each array element will have {Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
      For the other fonts the array has a single element with {"", "", "", font name}.
      Returns:
      the full name of the font
    • getAllNameEntries

      public abstract String[][] getAllNameEntries()
      Deprecated.
      Gets all the entries of the names-table. If it is a True Type font each array element will have {Name ID, Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
      For the other fonts the array has a single element with {"4", "", "", "", font name}.
      Returns:
      the full name of the font
      Since:
      2.0.8
    • getFamilyFontName

      public abstract String[][] getFamilyFontName()
      Deprecated.
      Gets the family name of the font. If it is a True Type font each array element will have {Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
      For the other fonts the array has a single element with {"", "", "", font name}.
      Returns:
      the family name of the font
    • getCodePagesSupported

      public String[] getCodePagesSupported()
      Deprecated.
      Gets the code pages supported by the font. This has only meaning with True Type fonts.
      Returns:
      the code pages supported by the font
    • getWidths

      public int[] getWidths()
      Deprecated.
      Gets the font width array.
      Returns:
      the font width array
    • getDifferences

      public String[] getDifferences()
      Deprecated.
      Gets the array with the names of the characters.
      Returns:
      the array with the names of the characters
    • getUnicodeDifferences

      public char[] getUnicodeDifferences()
      Deprecated.
      Gets the array with the unicode characters.
      Returns:
      the array with the unicode characters
    • isForceWidthsOutput

      public boolean isForceWidthsOutput()
      Deprecated.
      Gets the state of the property.
      Returns:
      value of property forceWidthsOutput
    • setForceWidthsOutput

      public void setForceWidthsOutput(boolean forceWidthsOutput)
      Deprecated.
      Set to true to force the generation of the widths array.
      Parameters:
      forceWidthsOutput - true to force the generation of the widths array
    • isDirectTextToByte

      public boolean isDirectTextToByte()
      Deprecated.
      Gets the direct conversion of char to byte.
      Returns:
      value of property directTextToByte.
      See Also:
    • setDirectTextToByte

      public void setDirectTextToByte(boolean directTextToByte)
      Deprecated.
      Sets the conversion of char directly to byte by casting. This is a low level feature to put the bytes directly in the content stream without passing through String.getBytes().
      Parameters:
      directTextToByte - New value of property directTextToByte.
    • isSubset

      public boolean isSubset()
      Deprecated.
      Indicates if all the glyphs and widths for that particular encoding should be included in the document.
      Returns:
      false to include all the glyphs and widths.
    • setSubset

      public void setSubset(boolean subset)
      Deprecated.
      Indicates if all the glyphs and widths for that particular encoding should be included in the document. When set to true only the glyphs used will be included in the font. When set to false and addSubsetRange(int[]) was not called the full font will be included otherwise just the characters ranges will be included.
      Parameters:
      subset - new value of property subset
    • getUnicodeEquivalent

      public int getUnicodeEquivalent(int c)
      Deprecated.
      Gets the Unicode equivalent to a CID. The (nonexistent) CID FF00 is translated as '\n'. It has only meaning with CJK fonts with Identity encoding.
      Parameters:
      c - the CID code
      Returns:
      the Unicode equivalent
    • getCidCode

      public int getCidCode(int c)
      Deprecated.
      Gets the CID code given an Unicode. It has only meaning with CJK fonts.
      Parameters:
      c - the Unicode
      Returns:
      the CID equivalent
    • hasKernPairs

      public abstract boolean hasKernPairs()
      Deprecated.
      Checks if the font has any kerning pairs.
      Returns:
      true if the font has any kerning pairs
    • charExists

      public boolean charExists(int c)
      Deprecated.
      Checks if a character exists in this font.
      Parameters:
      c - the character to check
      Returns:
      true if the character has a glyph, false otherwise
    • setCharAdvance

      public boolean setCharAdvance(int c, int advance)
      Deprecated.
      Sets the character advance.
      Parameters:
      c - the character
      advance - the character advance normalized to 1000 units
      Returns:
      true if the advance was set, false otherwise
    • getCharBBox

      public int[] getCharBBox(int c)
      Deprecated.
      Gets the smallest box enclosing the character contours. It will return null if the font has not the information or the character has no contours, as in the case of the space, for example. Characters with no contours may also return [0,0,0,0].
      Parameters:
      c - the character to get the contour bounding box from
      Returns:
      an array of four floats with the bounding box in the format [llx,lly,urx,ury] or null
    • getRawCharBBox

      protected abstract int[] getRawCharBBox(int c, String name)
      Deprecated.
    • correctArabicAdvance

      public void correctArabicAdvance()
      Deprecated.
      iText expects Arabic Diactrics (tashkeel) to have zero advance but some fonts, most notably those that come with Windows, like times.ttf, have non-zero advance for those characters. This method makes those character to have zero width advance and work correctly in the iText Arabic shaping and reordering context.
    • addSubsetRange

      public void addSubsetRange(int[] range)
      Deprecated.
      Adds a character range when subsetting. The range is an int array where the first element is the start range inclusive and the second element is the end range inclusive. Several ranges are allowed in the same array.
      Parameters:
      range - the character range
    • getCompressionLevel

      public int getCompressionLevel()
      Deprecated.
      Returns the compression level used for the font streams.
      Returns:
      the compression level (0 = best speed, 9 = best compression, -1 is default)
      Since:
      2.1.3
    • setCompressionLevel

      public void setCompressionLevel(int compressionLevel)
      Deprecated.
      Sets the compression level to be used for the font streams.
      Parameters:
      compressionLevel - a value between 0 (best speed) and 9 (best compression)
      Since:
      2.1.3
    • isIncludeCidSet

      public boolean isIncludeCidSet()
      Deprecated.
      Indicates if a CIDSet stream should be included in the document for TrueTypeFontUnicode.
      Returns:
      true to include a CIDSet stream.
    • setIncludeCidSet

      public void setIncludeCidSet(boolean includeCidSet)
      Deprecated.
      Indicates if a CIDSet stream should be included in the document for TrueTypeFontUnicode. When set to true, a CIDSet stream will be included in the document. When set to false, and PdfWriter.getPDFXConformance() does not require it, no CIDSet stream will be included.
      Parameters:
      includeCidSet - new value of includeCidSet