public static Font getFontWithSize(String fontName, float size) {
        Font customFont = null;
        try {
                        //create the font to use. Specify the size!
                       customFont = Font.createFont(Font.TRUETYPE_FONT, new File("assets/" + fontName + ".ttf")).deriveFont(size);
                        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
                        //register the font
                        ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("assets/" + fontName + ".ttf")));
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    catch(FontFormatException e)
                    {
                        e.printStackTrace();
                    }
        return customFont;
    }