[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

IThemeFonts

Interface IThemeFonts


public interface IThemeFonts
包含不同语言的主题字体。

此接口表示工作簿主题中基于语言的主题字体集合。它通常从 IThemeFontScheme.getMajor() 或 IThemeFontScheme.getMinor() 获取,并允许访问特定 FontLanguageIndex 的主题字体,例如 Latin、EastAsian 或 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

      获取 IThemeFont,使用 FontLanguageIndex。

      使用此方法可以访问当前主题字体集合中特定语言类别的主题字体,例如 Latin、EastAsian 或 ComplexScript。此集合通常从 IThemeFontScheme.getMajor() 或 IThemeFontScheme.getMinor() 获取。

      
       IThemeFonts themeFonts = workbook.getTheme().getThemeFontScheme().getMajor();
       IThemeFont latinFont = themeFonts.get(FontLanguageIndex.Latin);
       String fontName = latinFont.getName();
       
      Parameters:
      index - 指定 FontLanguageIndex。
      Returns:
      指定语言类别的 IThemeFont。
    • getCount

      int getCount()
      获取此集合中包含的主题字体条目数。

      使用此方法可以确定当前 IThemeFonts 集合中有多少个特定语言的主题字体条目可用。

      
       Theme theme = new Theme("CustomTheme", Themes.GetBerlin());
       workbook.setTheme(theme);
       IThemeFonts majorFonts = workbook.getTheme().getThemeFontScheme().getMajor();
       int count = majorFonts.getCount();
       
      Returns:
      此集合中包含的主题字体条目数。