mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 11:26:38 -04:00
修复部分 Linux 环境中未正确选择默认字体的问题 (#4036)
This commit is contained in:
parent
03c95cd726
commit
432465ab46
@ -163,6 +163,16 @@ public final class FontManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (family.indexOf(',') >= 0) {
|
||||||
|
for (String candidateFamily : family.split(",")) {
|
||||||
|
for (Font font : fonts) {
|
||||||
|
if (font.getFamily().equalsIgnoreCase(candidateFamily)) {
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LOG.warning(String.format("Family '%s' not found in font file '%s'", family, path));
|
LOG.warning(String.format("Family '%s' not found in font file '%s'", family, path));
|
||||||
return fonts[0];
|
return fonts[0];
|
||||||
} catch (NoSuchMethodException | IllegalAccessException ignored) {
|
} catch (NoSuchMethodException | IllegalAccessException ignored) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user