mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-08 08:45:09 +00:00
Enable back detecting installed fonts. (FFDec must be restarted to refresh such list)
This commit is contained in:
@@ -56,11 +56,11 @@ public class FontHelper {
|
||||
* @return Map<FamilyName,Map<FontNAme,Font>>
|
||||
*/
|
||||
public static Map<String, Map<String, Font>> getInstalledFonts() {
|
||||
return new HashMap<>();
|
||||
/*NOT AVAILABLE SINCE JAVA9+
|
||||
|
||||
Map<String, Map<String, Font>> ret = new HashMap<>();
|
||||
Font[] fonts = null;
|
||||
|
||||
/*Refreshing list of installed fonts - reflection access NOT AVAILABLE SINCE JAVA9+
|
||||
try {
|
||||
|
||||
Object fm = getFontManager();
|
||||
@@ -88,7 +88,7 @@ public class FontHelper {
|
||||
} catch (Throwable ex) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
*/
|
||||
if (fonts == null) {
|
||||
fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class FontHelper {
|
||||
ret.get(fam).put(f.getFontName(Locale.ENGLISH), f);
|
||||
}
|
||||
|
||||
return ret;*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static String fontToString(Font font) {
|
||||
|
||||
@@ -285,9 +285,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag {
|
||||
} else if (installedFontsByFamily.containsKey("Arial")) {
|
||||
defaultFontName = "Arial";
|
||||
} else {
|
||||
//NOT AVAILABLE SINCE JAVA9+
|
||||
//defaultFontName = installedFontsByFamily.keySet().iterator().next();
|
||||
defaultFontName = "Dialog";
|
||||
defaultFontName = installedFontsByFamily.keySet().iterator().next();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,11 +301,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag {
|
||||
return "Arial";
|
||||
}
|
||||
|
||||
//NOT AVAILABLE SINCE JAVA9+
|
||||
//First font
|
||||
//return installedFontsByFamily.keySet().iterator().next();
|
||||
|
||||
return "Dialog";
|
||||
return installedFontsByFamily.keySet().iterator().next();
|
||||
}
|
||||
|
||||
public static String isFontFamilyInstalled(String fontFamily) {
|
||||
|
||||
Reference in New Issue
Block a user