IFontsManager

public interface IFontsManager

Manages fonts across the presentation.

Methods

MethodDescription
getFontSubstRuleList()Font substitutions to use when rendering Read/write IFontSubstRuleCollection.
setFontSubstRuleList(IFontSubstRuleCollection value)Font substitutions to use when rendering Read/write IFontSubstRuleCollection.
getFontFallBackRulesCollection()Represents a user’s collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality Read/write IFontFallBackRulesCollection.
setFontFallBackRulesCollection(IFontFallBackRulesCollection value)Represents a user’s collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality Read/write IFontFallBackRulesCollection.
getFonts()Returns the fonts used in the presentation
getSubstitutions()Gets the information about fonts that will be replaced on the presentation’s rendering.
getEmbeddedFonts()Returns the fonts embedded in the presentation
removeEmbeddedFont(IFontData fontData)Removes the embedded font
addEmbeddedFont(IFontData fontData, int embedFontRule)Adds the embedded font.
addEmbeddedFont(byte[] fontData, int embedFontRule)Adds the embedded font
replaceFont(IFontData sourceFont, IFontData destFont)Replace font in presentation
replaceFont(IFontSubstRule substRule)Replace font in presentation using information provided in IFontSubstRule
replaceFont(IFontSubstRuleCollection substRules)Replace font in presentation using information provided in collection of IFontSubstRule

getFontSubstRuleList()

public abstract IFontSubstRuleCollection getFontSubstRuleList()

Font substitutions to use when rendering Read/write IFontSubstRuleCollection.

Returns: IFontSubstRuleCollection

setFontSubstRuleList(IFontSubstRuleCollection value)

public abstract void setFontSubstRuleList(IFontSubstRuleCollection value)

Font substitutions to use when rendering Read/write IFontSubstRuleCollection.

Parameters:

ParameterTypeDescription
valueIFontSubstRuleCollection

getFontFallBackRulesCollection()

public abstract IFontFallBackRulesCollection getFontFallBackRulesCollection()

Represents a user’s collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality Read/write IFontFallBackRulesCollection.


Presentation pres = new Presentation();
 try
 {
     // Getting of empty or preinitialized rules collection from FontsManager
     IFontFallBackRulesCollection rulesList = pres.getFontsManager().getFontFallBackRulesCollection();
     // adding of rules to collection
     rulesList.add(new FontFallBackRule(0x400,0x4FF, "Times New Roman"));
     // or 
     // initialization of new instance of rules collection
     IFontFallBackRulesCollection rulesList = new FontFallBackRulesCollection();
     // adding of rules to collection
     rulesList.add(new FontFallBackRule(0x400,0x4FF, "Times New Roman"));
     // and replacing of existing collection by the new one in FontsManager 
     pres.getFontsManager().setFontFallBackRulesCollection(rulesList);
 }
 finally {
     if (pres != null) pres.dispose();
 }

Returns: IFontFallBackRulesCollection

setFontFallBackRulesCollection(IFontFallBackRulesCollection value)

public abstract void setFontFallBackRulesCollection(IFontFallBackRulesCollection value)

Represents a user’s collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality Read/write IFontFallBackRulesCollection.


Presentation pres = new Presentation();
 try
 {
     // Getting of empty or preinitialized rules collection from FontsManager
     IFontFallBackRulesCollection rulesList = pres.getFontsManager().getFontFallBackRulesCollection();
     // adding of rules to collection
     rulesList.add(new FontFallBackRule(0x400,0x4FF, "Times New Roman"));
     // or 
     // initialization of new instance of rules collection
     IFontFallBackRulesCollection rulesList = new FontFallBackRulesCollection();
     // adding of rules to collection
     rulesList.add(new FontFallBackRule(0x400,0x4FF, "Times New Roman"));
     // and replacing of existing collection by the new one in FontsManager 
     pres.getFontsManager().setFontFallBackRulesCollection(rulesList);
 }
 finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valueIFontFallBackRulesCollection

getFonts()

public abstract IFontData[] getFonts()

Returns the fonts used in the presentation

Returns: com.aspose.slides.IFontData[] - An array of fonts

getSubstitutions()

public abstract System.Collections.Generic.IGenericEnumerable<FontSubstitutionInfo> getSubstitutions()

Gets the information about fonts that will be replaced on the presentation’s rendering.


Presentation pres = new Presentation("pres.pptx");
 try {
     for (FontSubstitutionInfo fontSubstitution : pres.getFontsManager().getSubstitutions())
     {
         System.out.println(fontSubstitution.getOriginalFontName() + " -> " + fontSubstitution.getSubstitutedFontName());
     }
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.slides.FontSubstitutionInfo> - Collection of all fonts substitution FontSubstitutionInfo.

getEmbeddedFonts()

public abstract IFontData[] getEmbeddedFonts()

Returns the fonts embedded in the presentation

Returns: com.aspose.slides.IFontData[] - Embedded fonts IFontData[]

removeEmbeddedFont(IFontData fontData)

public abstract void removeEmbeddedFont(IFontData fontData)

Removes the embedded font

Parameters:

ParameterTypeDescription
fontDataIFontDataFont data object IFontData

addEmbeddedFont(IFontData fontData, int embedFontRule)

public abstract void addEmbeddedFont(IFontData fontData, int embedFontRule)

Adds the embedded font.

Parameters:

ParameterTypeDescription
fontDataIFontDataFont data object IFontData
embedFontRuleintEmbedded font rule EmbedFontCharacters

Keep in mind when copying any fonts that most fonts are copyrighted. First locate the license of a font before hand and verify they can be freely transferred to another machine. |

addEmbeddedFont(byte[] fontData, int embedFontRule)

public abstract void addEmbeddedFont(byte[] fontData, int embedFontRule)

Adds the embedded font

Parameters:

ParameterTypeDescription
fontDatabyte[]Font data byte[]
embedFontRuleintEmbedded font rule EmbedFontCharacters

Keep in mind when adding any fonts that most fonts are copyrighted. First locate the license of a font before hand and verify they can be freely transferred to another machine. |

replaceFont(IFontData sourceFont, IFontData destFont)

public abstract void replaceFont(IFontData sourceFont, IFontData destFont)

Replace font in presentation

Parameters:

ParameterTypeDescription
sourceFontIFontDataSource font
destFontIFontDataDestination font

replaceFont(IFontSubstRule substRule)

public abstract void replaceFont(IFontSubstRule substRule)

Replace font in presentation using information provided in IFontSubstRule

Parameters:

ParameterTypeDescription
substRuleIFontSubstRuleFont substitution info

replaceFont(IFontSubstRuleCollection substRules)

public abstract void replaceFont(IFontSubstRuleCollection substRules)

Replace font in presentation using information provided in collection of IFontSubstRule

Parameters:

ParameterTypeDescription
substRulesIFontSubstRuleCollectionFont substitution info collection