FontSettings

Inheritance: java.lang.Object

public final class FontSettings

General imaging vector formats renderer font settings.

Methods

MethodDescription
equals(Object arg0)
getAdobeFontName(String fontFamilyName)Gets the adobe font name by font family name.
getClass()
getDefaultFontName()Gets the default font name.
getDefaultFontsFolders()Gets the default fonts folders.
getFontReplacements(String fontName)Gets the font replacements array by the font name
getFontsFolders()Gets a copy of the array that contains the list of folders where Aspose.Imaging looks for TrueType fonts.
getGetSystemAlternativeFont()Gets or sets a value indicating whether [get alternative font].
getReplacementFont(String fontName)Gets the most suitable replacement font.
hashCode()
isFontAllowed(String fontName)Determines whether [is font allowed] [the specified font name].
notify()
notifyAll()
removeFontCacheFile()Removes of the font cache file.
reset()Resets the fonts folder and default font name to the system default.
setAllowedFonts(String[] fontList)Restricts font using by list of fonts.
setDefaultFontName(String fontName)Sets the default font name.
setFontReplacements(String fontToReplace, String[] fontNames)Sets the font replacement list.
setFontsFolder(String folder)Override font folder list for folder
setFontsFolders(String[] folders)Override font folder list for folders
setFontsFolders(String[] folders, boolean recursive)Sets the folders where TrueType fonts are loaded from and clears all loaded fonts.
setGetSystemAlternativeFont(boolean value)Gets or sets a value indicating whether [get alternative font].
toString()
updateFonts()Updates fonts cache for PSD files that contain text layers.
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAdobeFontName(String fontFamilyName)

public static String getAdobeFontName(String fontFamilyName)

Gets the adobe font name by font family name.

Parameters:

ParameterTypeDescription
fontFamilyNamejava.lang.StringThe font family name.

Returns: java.lang.String - The adobe font name by font family name.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDefaultFontName()

public static String getDefaultFontName()

Gets the default font name.

Returns: java.lang.String - default font’s name

getDefaultFontsFolders()

public static String[] getDefaultFontsFolders()

Gets the default fonts folders.

Returns: java.lang.String[] - Returns system folder

getFontReplacements(String fontName)

public static String[] getFontReplacements(String fontName)

Gets the font replacements array by the font name

Parameters:

ParameterTypeDescription
fontNamejava.lang.StringName of the font.

Returns: java.lang.String[] - Array of names of replacements for provided fonts

getFontsFolders()

public static String[] getFontsFolders()

Gets a copy of the array that contains the list of folders where Aspose.Imaging looks for TrueType fonts.

The returned value is a copy of the data that Aspose.Imaging uses. If you change the entries in the returned array, it will have no effect on document rendering. To specify new font locations use the setFontsFolders method.

Returns: java.lang.String[] - A copy of the current font locations.

getGetSystemAlternativeFont()

public static boolean getGetSystemAlternativeFont()

Gets or sets a value indicating whether [get alternative font].

Value: true if [get alternative font]; otherwise, false .

Returns: boolean

getReplacementFont(String fontName)

public static String getReplacementFont(String fontName)

Gets the most suitable replacement font. If all replacements are not allowed then will returned first allowed and available font. If there are no available fonts then will be returned font from argument

Parameters:

ParameterTypeDescription
fontNamejava.lang.StringName of the font.

Returns: java.lang.String - The name of replaced font

hashCode()

public native int hashCode()

Returns: int

isFontAllowed(String fontName)

public static boolean isFontAllowed(String fontName)

Determines whether [is font allowed] [the specified font name].

Parameters:

ParameterTypeDescription
fontNamejava.lang.StringName of the font.

Returns: boolean - true if [is font allowed] [the specified font name]; otherwise, false .

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeFontCacheFile()

public static void removeFontCacheFile()

Removes of the font cache file.

reset()

public static void reset()

Resets the fonts folder and default font name to the system default.

setAllowedFonts(String[] fontList)

public static void setAllowedFonts(String[] fontList)

Restricts font using by list of fonts. Please check real font names before restriction Set Allowed font list to Null to remove restrictrions

Parameters:

ParameterTypeDescription
fontListjava.lang.String[]The font list.

setDefaultFontName(String fontName)

public static void setDefaultFontName(String fontName)

Sets the default font name.

Parameters:

ParameterTypeDescription
fontNamejava.lang.StringThe default name of the font.

setFontReplacements(String fontToReplace, String[] fontNames)

public static void setFontReplacements(String fontToReplace, String[] fontNames)

Sets the font replacement list. If font is not allowed then will be find replacement. The first one font in list will be used first. If it retricted too, then will be selected next font from list. If font has not replacements or all replacements are not allowed then will be used first allowed font from allowed font list. If there are no allowed and available fonts then library will try use system default font even if it is not allowed.

Parameters:

ParameterTypeDescription
fontToReplacejava.lang.StringThe font to replace.
fontNamesjava.lang.String[]The replacement font names in order of similarity.

setFontsFolder(String folder)

public static void setFontsFolder(String folder)

Override font folder list for folder

Parameters:

ParameterTypeDescription
folderjava.lang.StringFolder with TrueType fonts.

setFontsFolders(String[] folders)

public static void setFontsFolders(String[] folders)

Override font folder list for folders

Parameters:

ParameterTypeDescription
foldersjava.lang.String[]Array of folder

setFontsFolders(String[] folders, boolean recursive)

public static void setFontsFolders(String[] folders, boolean recursive)

Sets the folders where TrueType fonts are loaded from and clears all loaded fonts. There are no checks performed on the fonts folders.

Parameters:

ParameterTypeDescription
foldersjava.lang.String[]The fonts folders.
recursivebooleanif set to true [recursive].

setGetSystemAlternativeFont(boolean value)

public static void setGetSystemAlternativeFont(boolean value)

Gets or sets a value indicating whether [get alternative font].

Value: true if [get alternative font]; otherwise, false .

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

updateFonts()

public static void updateFonts()

Updates fonts cache for PSD files that contain text layers. This method guarantees that fonts from folder fontsFolder using method FontSettings.setFontsFolder(fontsFolder) or after reset fonts using FontSettings.reset() will be taken into consideration when processing PSD files. Please use this method each time when FontSettings.setFontsFolder(fontsFolder) or FontSettings.reset() called for PSD images. Without calling this Method there is no guarantee that fonts will be updated.

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int