Class OFFontLoader

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

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

    • multiFont

      private MultiByteFont multiFont
    • singleFont

      private SingleByteFont singleFont
    • subFontName

      private final String subFontName
    • encodingMode

      private EncodingMode encodingMode
    • embeddingMode

      private EmbeddingMode embeddingMode
    • simulateStyle

      private boolean simulateStyle
    • embedAsType1

      private boolean embedAsType1
    • useSVG

      private boolean useSVG
  • Constructor Details

    • OFFontLoader

      public OFFontLoader(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(URI fontFileURI, String subFontName, boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning, boolean useAdvanced, InternalResourceResolver resolver, boolean simulateStyle, boolean embedAsType1, boolean useSVG)
      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 IOException
      Reads/parses the font data.
      Specified by:
      read in class FontLoader
      Throws:
      IOException - In case of an I/O error
    • read

      private void read(String ttcFontName) throws IOException
      Reads a TrueType font.
      Parameters:
      ttcFontName - the TrueType sub-font name of TrueType Collection (may be null for normal TrueType fonts)
      Throws:
      IOException - if an I/O error occurs
    • readHeader

      public static String readHeader(FontFileReader fontFile) throws IOException
      Throws:
      IOException
    • buildFont

      private void buildFont(OpenFont otf, String ttcFontName)
    • getCMap

      private CMapSegment[] getCMap(OpenFont otf)
    • copyGlyphMetricsSingleByte

      private void copyGlyphMetricsSingleByte(OpenFont otf)
    • copyKerning

      private void copyKerning(OpenFont otf, boolean isCid)
      Copy kerning information.
    • copyAdvanced

      private void copyAdvanced(OpenFont otf)
      Copy advanced typographic information.