public class Java2DFontResolver extends Object implements FontResolver
| 构造器和说明 |
|---|
Java2DFontResolver(SharedContext sharedCtx,
boolean useEnvironmentFonts) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFontFile(File fontFile,
String fontFamilyNameOverride,
Integer fontWeightOverride,
IdentValue fontStyleOverride)
Add a font using a existing file.
|
void |
addInputStreamFont(FSSupplier<InputStream> fontSupplier,
String fontFamilyNameOverride,
Integer fontWeightOverride,
IdentValue fontStyleOverride) |
protected static Font |
createFont(SharedContext ctx,
Font rootFont,
float size,
IdentValue weight,
IdentValue style,
IdentValue variant)
Creates a concrete instance of a font at specified size, weight, style and variant.
|
void |
flushCache()
已过时。
|
protected static String |
getFontInstanceHashName(SharedContext ctx,
String name,
float size,
IdentValue weight,
IdentValue style,
IdentValue variant)
Gets the hash key for a concrete instance of a font.
|
void |
importFontFaces(List<FontFaceRule> fontFaces) |
FSFont |
resolveFont(SharedContext renderingContext,
FontSpecification spec) |
FSFont |
resolveFont(SharedContext ctx,
String[] families,
float size,
IdentValue weight,
IdentValue style,
IdentValue variant)
Resolves a list of font families.
|
void |
setFontMapping(String name,
Font font)
Sets the fontMapping attribute of the FontResolver object
|
public Java2DFontResolver(SharedContext sharedCtx, boolean useEnvironmentFonts)
@Deprecated public void flushCache()
public void importFontFaces(List<FontFaceRule> fontFaces)
public void addInputStreamFont(FSSupplier<InputStream> fontSupplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride)
public void addFontFile(File fontFile, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride)
public FSFont resolveFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant)
public void setFontMapping(String name, Font font)
name - The new fontMapping valuefont - The new fontMapping valueprotected static Font createFont(SharedContext ctx, Font rootFont, float size, IdentValue weight, IdentValue style, IdentValue variant)
protected static String getFontInstanceHashName(SharedContext ctx, String name, float size, IdentValue weight, IdentValue style, IdentValue variant)
public FSFont resolveFont(SharedContext renderingContext, FontSpecification spec)
resolveFont 在接口中 FontResolverCopyright © 2004–2025. All rights reserved.