Class CustomFontSubstitutionBase

  • public class CustomFontSubstitutionBase
    extends FontSubstitution

    Represents a base class for custom font substitution strategy.

    • Constructor Detail

      • CustomFontSubstitutionBase

        public CustomFontSubstitutionBase()
    • Method Detail

      • trySubstitute

        public boolean trySubstitute(CustomFontSubstitutionBase.OriginalFontSpecification originalFontSpecification,
                                     Font[] substitutionFont)

        Substitutes original font with another font.

        originalFontSpecification - Original font specification.
        substitutionFont - Substitution font.

        The class CustomFontSubstitutionBase should be inherited to implement custom font substitution logic. TrySubstitute method should be overridden properly: Must return true in case substitution is required. substitutionFont must be set to valid Font object. Must return false in case no substitution is required. substitutionFont may be set to null.

        True in case substitution was successful.