Interface OutputProfiler.FontAction

  • All Known Implementing Classes:
    OutputProfiler.AutoEmbeddingFontAction
    Enclosing class:
    OutputProfiler

    public static interface OutputProfiler.FontAction

    An action that can be set on an OutputProfiler to replace one font with another in the PDF. Typically it's used to replace unembedded fonts with embedded ones, but other possibilities exist. The position of each glyph will not be altered on the page, so the metrics for the original and replacement font should be substantially the same.

    Note that the interface changed in release 2.27 to return a list of fonts rather than a single font.

    • Method Detail

      • getFont

        List<PDFFont> getFont​(OutputProfiler profiler,
                              String name,
                              boolean embedded,
                              PDFFont font)
        Returns the font(s) to use instead of the specified font, or null to make no changes
        Parameters:
        profiler - the OutputProfiler this action is being run on
        name - the font name
        embedded - whether the font is embedded in the PDF - typically embedded fonts should be left unchanged.
        font - the font that is being replaced. Note this structure is unlikely to support the full PDFFont API, and the object cannot be reused elsewhere.
        Returns:
        either null to make no changes, or a list of one or more fonts that can be used to substitute.