Class OutputProfile.FontInfo

  • Enclosing class:
    OutputProfile

    public final class OutputProfile.FontInfo
    extends Object
    Represents information about a font used in the document.
    Since:
    2.11.9
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getAscender()
      Get the Ascender for the font (the maximum height above the baseline the font extends) as a proportion of the point size.
      String getBaseName()
      The name of the font.
      float getCapHeight()
      Get the Cap-Height of the font - usually the height of the upper-case "O" - as a proportion of the point size.
      float getDescender()
      Get the Descender for the font (the maximum height below the baseline the font extends) as a proportion of the point size.
      Reader getMetaData()
      Return any XML metadata associated with this object.
      String getType()
      Return the type of embedded font: one of the values "TrueType", "OpenType", "Type1", "Compact", "MultipleMaster" or "Type3".
      BitSet getUsedCharacters()
      Return a BitSet containing all the Unicode codepoints that are used by this font in the PDF.
      float getXHeight()
      Get the X-Height of the font - usually the height of the lower-case "x" - as a proportion of the point size.
      boolean isCIDFont()
      Whether this font is a CID font.
      boolean isEmbedded()
      Whether or not this font is embedded in the document.
      boolean isReferenced()
      Return true if the font is used in the PDF for visible or invisible text.
      boolean isSubset()
      Whether or not this embedded font is Subset
      boolean isVisible()
      Return true if the font is actually used in the PDF to create visible text.
      String toString()  
    • Method Detail

      • getBaseName

        public String getBaseName()
        The name of the font. Note for embedded subset fonts, the font name is usually prefixed by 6 random uppercase letters and a plus sign.
        See Also:
        PDFFont.getBaseName()
      • isSubset

        public boolean isSubset()
        Whether or not this embedded font is Subset
      • isVisible

        public boolean isVisible()
        Return true if the font is actually used in the PDF to create visible text. If false, the font may be created but never used to display glyphs, or it may only be used to display invisible test.
        Since:
        2.18
      • isReferenced

        public boolean isReferenced()
        Return true if the font is used in the PDF for visible or invisible text. If this method returns false, the font could be removed from the PDF without any ill-effect.
        Since:
        2.26.1
      • isCIDFont

        public boolean isCIDFont()
        Whether this font is a CID font.
      • getType

        public String getType()
        Return the type of embedded font: one of the values "TrueType", "OpenType", "Type1", "Compact", "MultipleMaster" or "Type3". Unembedded fonts return "Unembedded". Fonts that are created but never used in the PDF to display any glyphs have a type "Unused"
      • getUsedCharacters

        public BitSet getUsedCharacters()
        Return a BitSet containing all the Unicode codepoints that are used by this font in the PDF. If a font displays glyphs that cannot be resolved to a Unicode character, this set will return null, but that doesn't necessarily mean it's not been applied to the PDF
        Since:
        2.18
        See Also:
        isVisible()
      • getMetaData

        public Reader getMetaData()
                           throws IOException

        Return any XML metadata associated with this object. See the PDF.getMetaData() for more information

        Since 2.24.3, the returned type is guaranteed to hava a toString() method that will return the Metadata as a String.

        Returns:
        a Reader containing the source of the XML or null if no metadata is available.
        Throws:
        IOException - if the metadata can't be extracted
        Since:
        2.24.3
      • getAscender

        public float getAscender()
        Get the Ascender for the font (the maximum height above the baseline the font extends) as a proportion of the point size. If unspecified, returns NaN
        Since:
        2.24.3
        See Also:
        PDFFont.getAscender()
      • getDescender

        public float getDescender()
        Get the Descender for the font (the maximum height below the baseline the font extends) as a proportion of the point size. The returned value is usually negative. If unspecified, returns NaN
        Since:
        2.24.3
        See Also:
        PDFFont.getAscender()
      • getXHeight

        public float getXHeight()
        Get the X-Height of the font - usually the height of the lower-case "x" - as a proportion of the point size. If unspecified, returns NaN
        Since:
        2.24.3
        See Also:
        PDFFont.getXHeight()
      • getCapHeight

        public float getCapHeight()
        Get the Cap-Height of the font - usually the height of the upper-case "O" - as a proportion of the point size. If unspecified, returns NaN
        Since:
        2.24.3
        See Also:
        PDFFont.getCapHeight()