IFonts

public interface IFonts

Represents fonts collection.

Methods

MethodDescription
getLatinFont()Returns or sets the Latin font.
setLatinFont(IFontData value)Returns or sets the Latin font.
getEastAsianFont()Returns or sets the East Asian font.
setEastAsianFont(IFontData value)Returns or sets the East Asian font.
getComplexScriptFont()Returns or sets the complex script font.
setComplexScriptFont(IFontData value)Returns or sets the complex script font.
getScriptFontMap()Returns a dictionary of all script font definitions in the presentation.
getScriptFont(String script)Gets the font name associated with a specific script tag from the presentation theme.
setScriptFont(String script, String fontName)Assigns a font name to a specific script tag, which defines how text of that script will be rendered in the presentation.
removeScriptFont(String script)Removes the font setting associated with a specific script tag from the theme’s font collection.

getLatinFont()

public abstract IFontData getLatinFont()

Returns or sets the Latin font. Read/write IFontData.

Returns: IFontData

setLatinFont(IFontData value)

public abstract void setLatinFont(IFontData value)

Returns or sets the Latin font. Read/write IFontData.

Parameters:

ParameterTypeDescription
valueIFontData

getEastAsianFont()

public abstract IFontData getEastAsianFont()

Returns or sets the East Asian font. Read/write IFontData.

Returns: IFontData

setEastAsianFont(IFontData value)

public abstract void setEastAsianFont(IFontData value)

Returns or sets the East Asian font. Read/write IFontData.

Parameters:

ParameterTypeDescription
valueIFontData

getComplexScriptFont()

public abstract IFontData getComplexScriptFont()

Returns or sets the complex script font. Read/write IFontData.

Returns: IFontData

setComplexScriptFont(IFontData value)

public abstract void setComplexScriptFont(IFontData value)

Returns or sets the complex script font. Read/write IFontData.

Parameters:

ParameterTypeDescription
valueIFontData

getScriptFontMap()

public abstract System.Collections.Generic.Dictionary<String,String> getScriptFontMap()

Returns a dictionary of all script font definitions in the presentation.


Dictionary.Enumerator<String, String> map = presentation.getMasterTheme().getFontScheme().getMajor().getScriptFontMap().iterator();
 while (map.hasNext())
 {
     KeyValuePair<String, String> kvp = map.next();
     System.out.println(kvp.getKey() + " ? " + kvp.getValue());
 }

Returns: com.aspose.ms.System.Collections.Generic.Dictionary<java.lang.String,java.lang.String> - A dictionary mapping script codes to font names.

getScriptFont(String script)

public abstract String getScriptFont(String script)

Gets the font name associated with a specific script tag from the presentation theme.


This example demonstrates how to retrieve the font assigned to the Cyrillic script in the presentation theme.
 
 String font = presentation.getMasterTheme().getFontScheme().getMajor().getScriptFont("Cyrl");
 System.out.println("Font for Cyrillic script: " + font);

Parameters:

ParameterTypeDescription
scriptjava.lang.StringThe BCP-47 script code (e.g., “Latn”, “Cyrl”, “Jpan”) used to identify a writing system.

Returns: java.lang.String - The name of the font used for the specified script, or null if the script is not defined.

setScriptFont(String script, String fontName)

public abstract void setScriptFont(String script, String fontName)

Assigns a font name to a specific script tag, which defines how text of that script will be rendered in the presentation.


This example shows how to set the font for the Arabic script to "Segoe UI":
 
 presentation.getMasterTheme().getFontScheme().getMajor().setScriptFont("Arab", "Segoe UI");

Parameters:

ParameterTypeDescription
scriptjava.lang.StringThe BCP-47 script code (e.g., “Arab”, “Hebr”, “Hans”) identifying the writing system.
fontNamejava.lang.StringThe name of the font to assign to the specified script.

removeScriptFont(String script)

public abstract void removeScriptFont(String script)

Removes the font setting associated with a specific script tag from the theme’s font collection.


This example demonstrates how to remove the font mapping for the Hebrew script:
 
 presentation.getMasterTheme().getFontScheme().getMajor().removeScriptFont("Hebr");

Parameters:

ParameterTypeDescription
scriptjava.lang.StringThe BCP-47 script code whose font setting should be removed.