add methods

This commit is contained in:
Looly
2024-12-22 20:22:58 +08:00
parent 174faae0de
commit ba5826436a

View File

@@ -45,6 +45,17 @@ public class FontUtil {
return e.getAllFonts(); return e.getAllFonts();
} }
/**
* 注册字体到系统<br>
* 此方法用于将字体文件注册到系统,之后即可在字体名称列表中看到此字体
*
* @param font 字体
*/
public static void registerFont(final Font font) {
final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);
}
/** /**
* 创建默认字体 * 创建默认字体
* *