[]
        
(Showing Draft Content)

IThemeFonts

Interface IThemeFonts


public interface IThemeFonts
Contains the theme fonts in different languages.

This interface represents a language-based collection of theme fonts in a workbook theme. It is typically obtained from IThemeFontScheme.getMajor() or IThemeFontScheme.getMinor() and lets you access the theme font for a specific FontLanguageIndex, such as Latin, EastAsian, or ComplexScript.


 Theme theme = new Theme("CustomTheme", Themes.GetBerlin());
 workbook.setTheme(theme);
 IThemeFonts themeFonts = workbook.getTheme().getThemeFontScheme().getMajor();
 IThemeFont latinFont = themeFonts.get(FontLanguageIndex.Latin);
 latinFont.setName("Aptos");
 IThemeFont eastAsianFont = themeFonts.get(FontLanguageIndex.EastAsian);
 int count = themeFonts.getCount();
 
  • Method Details

    • get

      Gets the IThemeFont using FontLanguageIndex.

      Use this method to access the theme font for a specific language category in the current theme font collection, such as Latin, EastAsian, or ComplexScript. This collection is typically obtained from IThemeFontScheme.getMajor() or IThemeFontScheme.getMinor().

      
       IThemeFonts themeFonts = workbook.getTheme().getThemeFontScheme().getMajor();
       IThemeFont latinFont = themeFonts.get(FontLanguageIndex.Latin);
       String fontName = latinFont.getName();
       
      Parameters:
      index - Specifies the FontLanguageIndex.
      Returns:
      The IThemeFont for the specified language category.
    • getCount

      int getCount()
      Gets the number of theme font entries in this collection.

      Use this method to determine how many language-specific theme font entries are available in the current IThemeFonts collection.

      
       Theme theme = new Theme("CustomTheme", Themes.GetBerlin());
       workbook.setTheme(theme);
       IThemeFonts majorFonts = workbook.getTheme().getThemeFontScheme().getMajor();
       int count = majorFonts.getCount();
       
      Returns:
      The number of theme font entries in this collection.