支持使用环境变量指定字体 (#3181)

This commit is contained in:
Glavo 2024-07-15 12:33:53 +08:00 committed by GitHub
parent 85b68ad135
commit c81e510bfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -148,7 +148,10 @@ public class Theme {
public String[] getStylesheets(String overrideFontFamily) {
String css = "/assets/css/blue.css";
String fontFamily = System.getProperty("hmcl.font.override", overrideFontFamily);
String fontFamily = overrideFontFamily == null
? System.getProperty("hmcl.font.override", System.getenv("HMCL_FONT"))
: overrideFontFamily;
String fontStyle = null;
if (fontFamily == null) {
Optional<Font> font = tryLoadFont();