use of meteordevelopment.meteorclient.renderer.text.CustomTextRenderer in project meteor-client by MeteorDevelopment.
the class Fonts method load.
@Init(stage = InitStage.Post)
public static void load() {
if (lastFont.equals(Config.get().font.get()))
return;
File file = new File(FOLDER, Config.get().font + ".ttf");
if (!file.exists()) {
Config.get().font.set(DEFAULT_FONT);
file = new File(FOLDER, Config.get().font + ".ttf");
}
try {
CUSTOM_FONT = new CustomTextRenderer(file);
} catch (Exception ignored) {
Config.get().font.set(DEFAULT_FONT);
file = new File(FOLDER, Config.get().font + ".ttf");
CUSTOM_FONT = new CustomTextRenderer(file);
}
if (mc.currentScreen instanceof WidgetScreen && Config.get().customFont.get()) {
((WidgetScreen) mc.currentScreen).invalidate();
}
lastFont = Config.get().font.get();
}
use of meteordevelopment.meteorclient.renderer.text.CustomTextRenderer in project meteor-client by MeteorDevelopment.
the class Fonts method init.
@Init(stage = InitStage.Pre)
public static void init() {
FOLDER.mkdirs();
// Copy built in fonts if they not exist
for (String font : BUILTIN_FONTS) {
File file = new File(FOLDER, font);
if (!file.exists()) {
StreamUtils.copy(Fonts.class.getResourceAsStream("/assets/" + MeteorClient.MOD_ID + "/fonts/" + font), file);
}
}
// Load default font
CUSTOM_FONT = new CustomTextRenderer(new File(FOLDER, DEFAULT_FONT + ".ttf"));
lastFont = DEFAULT_FONT;
}
Aggregations