public enum FontName extends Enum<FontName>
| Enum Constant and Description |
|---|
FangSong
仿宋
|
KaiTi
楷体
|
MSYahei
微软雅黑
|
SimHei
黑体
|
SimSun
宋体
|
TimesNewRoman
Times New Roman
|
| Modifier and Type | Field and Description |
|---|---|
static double[] |
NOTO_PRINTABLE_ASCII_WIDTH_MAP
可打印的ASCII表字母宽度所占用百分比
|
static double[] |
TIMES_NEW_ROMAN_PRINTABLE_ASCII_MAP
Time New Roman 字体宽度比例
|
| Modifier and Type | Method and Description |
|---|---|
Font |
font()
获取字体对象
|
static FontName |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FontName[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FontName SimSun
public static final FontName SimHei
public static final FontName MSYahei
public static final FontName KaiTi
public static final FontName FangSong
public static final FontName TimesNewRoman
注意该字体只支持英文
public static final double[] NOTO_PRINTABLE_ASCII_WIDTH_MAP
ASCII区间: [32,126]
其中空格特殊处理,默认为半个字符宽度也就是 0.5
public static final double[] TIMES_NEW_ROMAN_PRINTABLE_ASCII_MAP
public static FontName[] values()
for (FontName c : FontName.values()) System.out.println(c);
public static FontName valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Font font()
Copyright © 2026. All rights reserved.