public class DrawFontManagerDefault extends java.lang.Object implements DrawFontManager
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
knownSymbolFonts |
Constructor and Description |
---|
DrawFontManagerDefault() |
Modifier and Type | Method and Description |
---|---|
java.awt.Font |
createAWTFont(java.awt.Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic)
Create an AWT font object with the given attributes
(创建具有给定属性的 AWT 字体对象)
|
FontInfo |
getFallbackFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
In case the original font doesn't contain a glyph, use the returned fallback font as an alternative
(如果原始字体不包含字形,请使用返回的备用字体作为替代)
|
FontInfo |
getMappedFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
select a font to be used to paint text
(选择用于绘制文本的字体)
|
java.lang.String |
mapFontCharset(java.awt.Graphics2D graphics, FontInfo fontInfo, java.lang.String text)
Symbol fonts like "Wingdings" or "Symbol" have glyphs mapped to a Unicode private use range via the Java font loader, although a system font viewer might show you the glyphs in the ASCII range.
(“Wingdings”或“Symbol”等符号字体通过 Java 字体加载器将字形映射到 Unicode 专用范围,尽管系统字体查看器可能会向您显示 ASCII 范围内的字形。)
|
public FontInfo getMappedFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
DrawFontManager
getMappedFont
in interface
DrawFontManager
(接口 DrawFontManager 中的 getMappedFont)
graphics
- the graphics context to request additional rendering hints
(graphics - 请求额外渲染提示的图形上下文)
fontInfo
- the font info object corresponding to the text run font
(fontInfo - 文本运行字体对应的字体信息对象)
public FontInfo getFallbackFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
DrawFontManager
getFallbackFont
in interface
DrawFontManager
(接口 DrawFontManager 中的 getFallbackFont)
graphics
- the graphics context to request additional rendering hints
(graphics - 请求额外渲染提示的图形上下文)
fontInfo
- the font info object corresponding to the text run font
(fontInfo - 文本运行字体对应的字体信息对象)
public java.lang.String mapFontCharset(java.awt.Graphics2D graphics, FontInfo fontInfo, java.lang.String text)
mapFontCharset
in interface
DrawFontManager
(接口 DrawFontManager 中的 mapFontCharset)
graphics
- the used graphics context
(graphics - 使用的图形上下文)
fontInfo
- the font info
(fontInfo - 字体信息)
text
- the input string
(text - 输入字符串)
StringUtil.mapMsCodepointString(String)
public java.awt.Font createAWTFont(java.awt.Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic)
DrawFontManager
createAWTFont
in interface
DrawFontManager
(在接口 DrawFontManager 中创建AWTFont)
graphics
- the graphics context to request additional rendering hints
(graphics - 请求额外渲染提示的图形上下文)
fontInfo
- the font info object corresponding to the text run font
(fontInfo - 文本运行字体对应的字体信息对象)
fontSize
- the font size in points
(fontSize - 以磅为单位的字体大小)
bold
-
true
if the font is bold
(粗体 - 如果字体为粗体则为真)
italic
-
true
if the font is italic
(italic - 如果字体是斜体则为真)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.