CustomFontSubstitutionBase

Inheritance: java.lang.Object, com.aspose.pdf.text.FontSubstitution

public class CustomFontSubstitutionBase extends FontSubstitution

Represents a base class for custom font substitution strategy.

Constructors

ConstructorDescription
CustomFontSubstitutionBase()

Methods

MethodDescription
trySubstitute(CustomFontSubstitutionBase.OriginalFontSpecification originalFontSpecification, Font[] substitutionFont)Substitutes original font with another font.

CustomFontSubstitutionBase()

public CustomFontSubstitutionBase()

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

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

Substitutes original font with another font.

Parameters:

ParameterTypeDescription
originalFontSpecificationOriginalFontSpecificationOriginal font specification.
substitutionFontFont[]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. |

Returns: boolean - True in case substitution was successful.