Class EmbedFontInfo

java.lang.Object
org.docx4j.fonts.fop.fonts.EmbedFontInfo
All Implemented Interfaces:
java.io.Serializable

public class EmbedFontInfo
extends java.lang.Object
implements java.io.Serializable
FontInfo contains meta information on fonts (where is the metrics file etc.)
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.String embedFile
    filename of the main font file
    protected EncodingMode encodingMode
    the requested encoding mode for the font
    protected java.util.Set familyNames  
    protected boolean kerning
    false, to disable kerning
    protected java.lang.String metricsFile
    filename of the metrics file
    protected Panose panose  
    protected java.lang.String postScriptName
    the PostScript name of the font
    protected java.lang.String subFontName
    the sub-fontname of the font (used for TrueType Collections, null otherwise)
  • Constructor Summary

    Constructors 
    Constructor Description
    EmbedFontInfo​(java.lang.String metricsFile, boolean kerning, java.util.List fontTriplets, java.lang.String embedFile, java.lang.String subFontName)
    Main constructor
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getEmbedFile()
    Returns the path to the embeddable font file
    EncodingMode getEncodingMode()
    Returns the requested encoding mode for this font.
    java.util.Set getFamilyNames()  
    java.util.List getFontTriplets()
    Returns the list of font triplets associated with this font.
    boolean getKerning()
    Determines if kerning is enabled
    java.lang.String getMetricsFile()
    Returns the path to the metrics file
    Panose getPanose()  
    java.lang.String getPostScriptName()
    Returns the PostScript name of the font.
    java.lang.String getSubFontName()
    Returns the sub-font name of the font.
    boolean isEmbeddable()  
    boolean isEmbedded()
    Indicates whether the font is only referenced rather than embedded.
    void setEmbeddable​(boolean isEmbeddable)  
    void setEmbedded​(boolean value)
    Defines whether the font is embedded or not.
    void setEncodingMode​(EncodingMode mode)
    Sets the requested encoding mode for this font.
    void setFamilyNames​(java.util.Set familyNames)  
    void setPanose​(Panose panose)  
    void setPostScriptName​(java.lang.String postScriptName)
    Sets the PostScript name of the font
    java.lang.String toString()

    Methods inherited from class java.lang.Object

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

    • familyNames

      protected java.util.Set familyNames
    • metricsFile

      protected java.lang.String metricsFile
      filename of the metrics file
    • embedFile

      protected java.lang.String embedFile
      filename of the main font file
    • kerning

      protected boolean kerning
      false, to disable kerning
    • encodingMode

      protected EncodingMode encodingMode
      the requested encoding mode for the font
    • postScriptName

      protected java.lang.String postScriptName
      the PostScript name of the font
    • subFontName

      protected java.lang.String subFontName
      the sub-fontname of the font (used for TrueType Collections, null otherwise)
    • panose

      protected Panose panose
  • Constructor Details

    • EmbedFontInfo

      public EmbedFontInfo​(java.lang.String metricsFile, boolean kerning, java.util.List fontTriplets, java.lang.String embedFile, java.lang.String subFontName)
      Main constructor
      Parameters:
      metricsFile - Path to the xml file containing font metrics
      kerning - True if kerning should be enabled
      fontTriplets - List of font triplets to associate with this font
      embedFile - Path to the embeddable font file (may be null)
      subFontName - the sub-fontname used for TrueType Collections (null otherwise)
  • Method Details

    • isEmbeddable

      public boolean isEmbeddable()
    • setEmbeddable

      public void setEmbeddable​(boolean isEmbeddable)
    • getPanose

      public Panose getPanose()
    • setPanose

      public void setPanose​(Panose panose)
    • getMetricsFile

      public java.lang.String getMetricsFile()
      Returns the path to the metrics file
      Returns:
      the metrics file path
    • getEmbedFile

      public java.lang.String getEmbedFile()
      Returns the path to the embeddable font file
      Returns:
      the font file path
    • getKerning

      public boolean getKerning()
      Determines if kerning is enabled
      Returns:
      True if enabled
    • getSubFontName

      public java.lang.String getSubFontName()
      Returns the sub-font name of the font. This is primarily used for TrueType Collections to select one of the sub-fonts. For all other fonts, this is always null.
      Returns:
      the sub-font name (or null)
    • getPostScriptName

      public java.lang.String getPostScriptName()
      Returns the PostScript name of the font.
      Returns:
      the PostScript name
    • setPostScriptName

      public void setPostScriptName​(java.lang.String postScriptName)
      Sets the PostScript name of the font
      Parameters:
      postScriptName - the PostScript name
    • getFontTriplets

      public java.util.List getFontTriplets()
      Returns the list of font triplets associated with this font.
      Returns:
      List of font triplets
    • isEmbedded

      public boolean isEmbedded()
      Indicates whether the font is only referenced rather than embedded.
      Returns:
      true if the font is embedded, false if it is referenced.
    • setEmbedded

      public void setEmbedded​(boolean value)
      Defines whether the font is embedded or not.
      Parameters:
      value - true to embed the font, false to reference it
    • getEncodingMode

      public EncodingMode getEncodingMode()
      Returns the requested encoding mode for this font.
      Returns:
      the encoding mode
    • setEncodingMode

      public void setEncodingMode​(EncodingMode mode)
      Sets the requested encoding mode for this font.
      Parameters:
      mode - the new encoding mode
    • getFamilyNames

      public java.util.Set getFamilyNames()
    • setFamilyNames

      public void setFamilyNames​(java.util.Set familyNames)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object