com.aspose.words

Class TableSubstitutionRule

public class TableSubstitutionRule 
extends FontSubstitutionRule

Table font substitution rule.
This rule defines the list of substitute font names to be used if the original font is not available. Substitutes will be checked for the font name and the FontInfo.AltName (if any).

Property Getters/Setters Summary
booleangetEnabled()
void
setEnabled(booleanvalue)
           Specifies whether the rule is enabled or not.
 
Method Summary
voidaddSubstitutes(java.lang.String originalFontName, java.lang.String[] substituteFontNames)
Adds substitute font names for given original font name.
System.Collections.Generic.IEnumerable`1getSubstitutes(java.lang.String originalFontName)
Returns array containing substitute font names for the specified original font name.
voidload(java.lang.String fileName)
Loads table substitution settings from XML file.
voidloadLinuxSettings()
Loads predefined table substitution settings for Linux platform.
voidloadWindowsSettings()
Loads predefined table substitution settings for Windows platform.
voidsave(java.lang.String fileName)
Saves the current table substitution settings to file.
voidsetSubstitutes(java.lang.String originalFontName, java.lang.String[] substituteFontNames)
Override substitute font names for given original font name.
 

    • Property Getters/Setters Detail

      • getEnabled/setEnabled

        public boolean getEnabled() / public void setEnabled(boolean value)
        
        Specifies whether the rule is enabled or not.
    • Method Detail

      • addSubstitutes

        public void addSubstitutes(java.lang.String originalFontName, java.lang.String[] substituteFontNames)
        Adds substitute font names for given original font name.
        Parameters:
        originalFontName - Original font name.
        substituteFontNames - List of alternative font names.
      • getSubstitutes

        public System.Collections.Generic.IEnumerable`1 getSubstitutes(java.lang.String originalFontName)
        Returns array containing substitute font names for the specified original font name.
        Parameters:
        originalFontName - Original font name.
        Returns:
        List of alternative font names.
      • load

        public void load(java.lang.String fileName)
                 throws java.lang.Exception
        Loads table substitution settings from XML file.
        Parameters:
        fileName - Input file name.
      • loadLinuxSettings

        public void loadLinuxSettings()
        Loads predefined table substitution settings for Linux platform.
      • loadWindowsSettings

        public void loadWindowsSettings()
        Loads predefined table substitution settings for Windows platform.
      • save

        public void save(java.lang.String fileName)
                 throws java.lang.Exception
        Saves the current table substitution settings to file.
        Parameters:
        fileName - Output file name.
      • setSubstitutes

        public void setSubstitutes(java.lang.String originalFontName, java.lang.String[] substituteFontNames)
        Override substitute font names for given original font name.
        Parameters:
        originalFontName - Original font name.
        substituteFontNames - List of alternative font names.

        Example:

        Shows how to define alternative fonts if original does not exist
        FontSettings fontSettings = new FontSettings();
        fontSettings.getSubstitutionSettings().getTableSubstitution().addSubstitutes("Times New Roman","Slab", "Arvo" );