// Path: src/main/java/org/flamierawieo/x00FA9A/client/settings/Settings.java
// public class Settings {
// 
//     private static Settings instance = new Settings();
// 
//     public static Settings getInstance() {
//         return instance;
//     }
// 
//     public static final String userSettingsJsonPath = "custom/user_settings.json";
// 
//     private VideoMode videoMode;
// 
//     private Settings() {
//         JSONParser jsonParser = new JSONParser();
//         try {
//             JSONObject userSettingsJson = (JSONObject) jsonParser.parse(new FileReader(userSettingsJsonPath));
//             videoMode = VideoMode.getVideoModeById((String) userSettingsJson.get("video_mode"));
//         } catch (IOException | ParseException e) {
//             // file does not exists or is invalid
//             // generatin' new one, m8
//             save();
//         }
//     }
// 
//     public VideoMode getVideoMode() {
//         return videoMode;
//     }
// 
//     public void setVideoMode(VideoMode videoMode) {
//         this.videoMode = videoMode;
//     }
// 
//     public void save() {
//         try {
//             FileWriter fileWriter = new FileWriter(userSettingsJsonPath);
//             fileWriter.write(getJson().toJSONString());
//             fileWriter.flush();
//             fileWriter.close();
//         } catch(IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public JSONObject getJson() {
//         JSONObject jsonObject = new JSONObject();
//         if(videoMode != null) {
//             jsonObject.put("video_mode", videoMode.getId());
//         }
//         return jsonObject;
//     }
// 
// }


import org.flamierawieo.x00FA9A.client.settings.Settings;
import org.lwjgl.BufferUtils;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.nio.ByteBuffer;
import static org.lwjgl.opengl.GL11.*;

    public Font getFont() {
        return font;
    }

    public void setFont(Font font) {
        this.font = font;
        updateTexture();
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
        updateTexture();
    }

    public float getWidth() {
        return width;
    }

    public float getHeight() {
        return height;
    }

    private void updateTexture() {
        BufferedImage bufferedImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
        Graphics2D graphics2D = bufferedImage.createGraphics();
// Path: src/main/java/org/flamierawieo/x00FA9A/client/settings/Settings.java
// public class Settings {
// 
//     private static Settings instance = new Settings();
// 
//     public static Settings getInstance() {
//         return instance;
//     }
// 
//     public static final String userSettingsJsonPath = "custom/user_settings.json";
// 
//     private VideoMode videoMode;
// 
//     private Settings() {
//         JSONParser jsonParser = new JSONParser();
//         try {
//             JSONObject userSettingsJson = (JSONObject) jsonParser.parse(new FileReader(userSettingsJsonPath));
//             videoMode = VideoMode.getVideoModeById((String) userSettingsJson.get("video_mode"));
//         } catch (IOException | ParseException e) {
//             // file does not exists or is invalid
//             // generatin' new one, m8
//             save();
//         }
//     }
// 
//     public VideoMode getVideoMode() {
//         return videoMode;
//     }
// 
//     public void setVideoMode(VideoMode videoMode) {
//         this.videoMode = videoMode;
//     }
// 
//     public void save() {
//         try {
//             FileWriter fileWriter = new FileWriter(userSettingsJsonPath);
//             fileWriter.write(getJson().toJSONString());
//             fileWriter.flush();
//             fileWriter.close();
//         } catch(IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public JSONObject getJson() {
//         JSONObject jsonObject = new JSONObject();
//         if(videoMode != null) {
//             jsonObject.put("video_mode", videoMode.getId());
//         }
//         return jsonObject;
//     }
// 
// }


// Path: src/main/java/org/flamierawieo/x00FA9A/client/graphics/Text.java
import org.flamierawieo.x00FA9A.client.settings.Settings;
import org.lwjgl.BufferUtils;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.nio.ByteBuffer;
import static org.lwjgl.opengl.GL11.*;


    public Font getFont() {
        return font;
    }

    public void setFont(Font font) {
        this.font = font;
        updateTexture();
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
        updateTexture();
    }

    public float getWidth() {
        return width;
    }

    public float getHeight() {
        return height;
    }

    private void updateTexture() {
        BufferedImage bufferedImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
        Graphics2D graphics2D = bufferedImage.createGraphics();
        Font scaledFont = font.deriveFont(Settings.getInstance().getVideoMode().getHeight() * this.height); // TODO: redesign project's WHOLE FUCKING ARCHITECTURE