Class OFFontLoader

java.lang.Object
org.docx4j.fonts.fop.fonts.FontLoader
org.docx4j.fonts.fop.fonts.truetype.OFFontLoader

public class OFFontLoader
extends FontLoader
Loads a TrueType font into memory directly from the original font file.
  • Constructor Details

    • OFFontLoader

      public OFFontLoader​(java.net.URI fontFileURI, InternalResourceResolver resourceResolver)
      Default constructor
      Parameters:
      fontFileURI - the URI representing the font file
      resourceResolver - the resource resolver for font URI resolution
    • OFFontLoader

      public OFFontLoader​(java.net.URI fontFileURI, java.lang.String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resolver, boolean simulateStyle, boolean embedAsType1)
      Additional constructor for TrueType Collections.
      Parameters:
      fontFileURI - the URI representing the font file
      subFontName - the sub-fontname of a font in a TrueType Collection (or null for normal TrueType fonts)
      embedded - indicates whether the font is embedded or referenced
      embeddingMode - the embedding mode of the font
      encodingMode - the requested encoding mode
      useKerning - true to enable loading kerning info if available, false to disable
      useAdvanced - true to enable loading advanced info if available, false to disable
      resolver - the FontResolver for font URI resolution
      simulateStyle - Determines whether to simulate font styles if a font does not support those by default.
  • Method Details

    • read

      protected void read() throws java.io.IOException
      Reads/parses the font data.
      Specified by:
      read in class FontLoader
      Throws:
      java.io.IOException - In case of an I/O error
    • readHeader

      public static java.lang.String readHeader​(FontFileReader fontFile) throws java.io.IOException
      Throws:
      java.io.IOException