Skip to content

Commit

Permalink
Filter out Aakar font from Java font family names
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleet01 committed Dec 26, 2024
1 parent b26ce6d commit 2bc915a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions megamek/src/megamek/client/ui/swing/util/FontHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ private void initializeFonts() {

logger.info("Loading fonts from Java's GraphicsEnvironment");
for (String fontName : GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()) {
allFontNames.add(fontName);
Font font = Font.decode(fontName);
if (font.canDisplayUpTo(SYMBOL_TEST_STRING) == -1) {
nonSymbolFontNames.add(fontName);
// Skip Aakar specifically; it causes graphical artefacts when present and selected as the default font.
if (!fontName.toLowerCase().contains("aakar")) {
allFontNames.add(fontName);
Font font = Font.decode(fontName);
if (font.canDisplayUpTo(SYMBOL_TEST_STRING) == -1) {
nonSymbolFontNames.add(fontName);
}
}
}
initialized = true;
Expand Down Expand Up @@ -167,4 +170,4 @@ private static void ensureInitialization() {
initialize();
}
}
}
}

0 comments on commit 2bc915a

Please sign in to comment.