Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny-Hui committed Nov 3, 2024
1 parent 5a6a9a3 commit e84a82c
Showing 1 changed file with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,35 @@ public static String readString(Identifier identifier) {
private static Font NOTO_SERIF_CACHE;

public static Font getSystemFont(String fontName) {
switch (fontName) {
case "Noto Sans" -> {
if (NOTO_SANS_MAYBE_CJK == null) {
if (hasNotoSansCjk) {
try {
NOTO_SANS_MAYBE_CJK = readFont(NOTO_SANS_CJK_LOCATION);
} catch (Exception ex) {
JCMLogger.warn("Failed loading font", ex);
}
} else {
try {
NOTO_SANS_MAYBE_CJK = readFont(NOTO_SANS_LOCATION);
} catch (Exception ex) {
JCMLogger.warn("Failed loading font", ex);;
}
}
}
return NOTO_SANS_MAYBE_CJK;
}
case "Noto Serif" -> {
if(NOTO_SERIF_CACHE == null) {
if(fontName.equals("Noto Sans")) {
if (NOTO_SANS_MAYBE_CJK == null) {
if (hasNotoSansCjk) {
try {
NOTO_SERIF_CACHE = readFont(NOTO_SERIF_LOCATION);
NOTO_SANS_MAYBE_CJK = readFont(NOTO_SANS_CJK_LOCATION);
} catch (Exception ex) {
JCMLogger.warn("Failed loading font", ex);
return null;
}
} else {
try {
NOTO_SANS_MAYBE_CJK = readFont(NOTO_SANS_LOCATION);
} catch (Exception ex) {
JCMLogger.warn("Failed loading font", ex);;
}
}
return NOTO_SERIF_CACHE;
}
default -> {
return new Font(fontName, Font.PLAIN, 1);
return NOTO_SANS_MAYBE_CJK;
} else if(fontName.equals("Noto Serif")) {
if(NOTO_SERIF_CACHE == null) {
try {
NOTO_SERIF_CACHE = readFont(NOTO_SERIF_LOCATION);
} catch (Exception ex) {
JCMLogger.warn("Failed loading font", ex);
return null;
}
}
return NOTO_SERIF_CACHE;
} else {
return new Font(fontName, Font.PLAIN, 1);
}
}

Expand Down

0 comments on commit e84a82c

Please sign in to comment.