public final class FontSettings extends Object
This static class allows add/change/override directories containing the TrueType fonts.
The search of the font starts from last added folder to first added folder, if font has not been found
the search continues using standard Java font management engine
(in case if isJavaFontEngineUsed()
return true
otherwise default font will be returned.).
Modifier and Type | Method and Description |
---|---|
static void |
addFontsFolder(String fontFolder)
Adds the
fontFolder into font directory list and marks it as first folder for font searching |
static void |
addFontSubstitutes(String originalFontName,
String[] substituteFontNames)
Adds substitute (alternative) font names for given original font name.
|
static Font |
findFont(Map attributes)
Returns the required font (or default font if required font was not be found)
|
static Font |
findFont(String fontName,
int fontStyle,
int fontSize)
Returns the required font (or default font if required font was not be found)
|
static String[] |
getAllFonts()
Returns the list of fonts that are accessible to Aspose.Imaging for Java API.
|
static String |
getDefaultFontName()
Gets the default font name.
|
static String[] |
getFontsSources()
Returns all font folders which has been added by
FontSettings methods |
static String[] |
getFontSubstitutes(String originalFontName)
Returns array containing alternative font names to be used if original font is not presented in system.
|
static boolean |
isJavaFontEngineUsed()
Returns current flag to use the standard Java font management engine.
|
static void |
removeFontsFolder(String folder)
Removes
folder from folder list |
static void |
resetFontSources()
Resets configuration
|
static void |
setDefaultFontName(String fontName)
Sets the default font name.
|
static void |
setFontsFolder(String folder)
Override font folder list for
folder |
static void |
setFontsFolders(String[] folders)
Override font folder list for
folders |
static void |
setFontSubstitutes(String originalFontName,
String[] substituteFontNames)
Override substitute (alternative) font names for given original font name.
|
static void |
useJavaFontEngine(boolean use)
Informs the search engine to use or not use the standard Java font management engine.
|
public static void addFontsFolder(String fontFolder) throws InterruptedException
fontFolder
into font directory list and marks it as first folder for font searchingfontFolder
- The folder contains the TrueType fonts or single font file path.InterruptedException
public static String[] getFontsSources() throws InterruptedException
FontSettings
methodsInterruptedException
public static void setFontsFolders(String[] folders) throws InterruptedException
folders
folders
- Array of folderInterruptedException
public static void setFontsFolder(String folder) throws InterruptedException
folder
folder
- Folder with TrueType fonts.InterruptedException
public static void removeFontsFolder(String folder) throws InterruptedException
folder
from folder listfolder
- The folder to removeInterruptedException
public static void useJavaFontEngine(boolean use) throws InterruptedException
Informs the search engine to use or not use the standard Java font management engine.
Attention: if you set it to false
be ready that some fonts could be not found if you do not correct set the folder list
use
- flag
true
use the standard Java font management engine.
false
not use the standard Java font management engine.InterruptedException
public static boolean isJavaFontEngineUsed()
true
the standard Java font management engine is used.
false
the standard Java font management engine is not used.public static void resetFontSources() throws InterruptedException
InterruptedException
public static Font findFont(String fontName, int fontStyle, int fontSize) throws InterruptedException
fontName
- Font familyfontStyle
- Font stylefontSize
- Font sizeFont
objectInterruptedException
public static String[] getAllFonts() throws InterruptedException
InterruptedException
public static void addFontSubstitutes(String originalFontName, String[] substituteFontNames) throws InterruptedException
Adds substitute (alternative) font names for given original font name.
originalFontName
- The Font's real namesubstituteFontNames
- The font's substitutionsInterruptedException
public static String[] getFontSubstitutes(String originalFontName) throws InterruptedException
originalFontName
- InterruptedException
public static void setFontSubstitutes(String originalFontName, String[] substituteFontNames) throws InterruptedException
originalFontName
- substituteFontNames
- InterruptedException
public static String getDefaultFontName()
public static void setDefaultFontName(String fontName) throws InterruptedException
fontName
- InterruptedException
public static Font findFont(Map attributes) throws InterruptedException
attributes
- Font attributesFont
objectInterruptedException
Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.