com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class FontsManager

  • java.lang.Object
    • com.aspose.slides.FontsManager
  • All Implemented Interfaces:
    IFontsManager


    public class FontsManager
    extends java.lang.Object
    implements IFontsManager

    Manages fonts across the presentation.

    • Method Detail

      • getFontFallBackRulesCollection

        public final 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();
         }
         
        Specified by:
        getFontFallBackRulesCollection in interface IFontsManager
      • setFontFallBackRulesCollection

        public final 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();
         }
         
        Specified by:
        setFontFallBackRulesCollection in interface IFontsManager
      • getFonts

        public final IFontData[] getFonts()

        Returns the fonts used in the presentation

        Specified by:
        getFonts in interface IFontsManager
        Returns:
        An array of fonts
      • addEmbeddedFont

        public final void addEmbeddedFont(IFontData fontData,
                                          int embedFontRule)

        Adds the embedded font

        Specified by:
        addEmbeddedFont in interface IFontsManager
        Throws:
        com.aspose.ms.System.ArgumentException - An ArgumentException can be thrown if font data is null or this font is already embedded


        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

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

        Adds the embedded font

        Specified by:
        addEmbeddedFont in interface IFontsManager
        Throws:
        com.aspose.ms.System.ArgumentException - An ArgumentException can be thrown if font data is null or this font is already embedded


        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.
      • replaceFont

        public final void replaceFont(IFontData sourceFont,
                                      IFontData destFont)

        Replace font in presentation

        Specified by:
        replaceFont in interface IFontsManager
        Parameters:
        sourceFont - Source font
        destFont - Destination font