<commit_before>package org.jrgss.api;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.jrgss.FileUtil;
import org.jrgss.JRGSSGame;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by matty on 6/27/14.
 */
@Data
public class Font {
    final static Map<FontCacheKey, BitmapFont> fontCache = new HashMap<>();
    int size;
    Color color = new Color(255, 255, 255, 255);
    boolean outline = true;
    Color out_color = new Color(0, 0, 0, 128);
    @Getter
    BitmapFont bitmapFont;
    boolean bold = false;
    boolean italic = false;
    boolean shadow = false;
    @Getter
    static int default_size = 24;
    String[] name;


    private static String getOSFontDir() {
        String osName = System.getProperty("os.name");
        if(osName.toLowerCase().contains("mac")) {
            return "/Library/Fonts";
        }
        return null;
    }

    private static String getOSFont(String name, boolean bold, boolean italic) {
        String ret = getOSFontDir()+File.separator+name;
        if(bold) {
            ret = ret+" Bold";
        }
        if(italic) {
            ret = ret+" Italic";
        }
        return ret+".ttf";
    }

    public Font() {
        this(default_name());
    }

    public Font(String[] name) {
        this(name, default_size);
    }

    public Font(final String[] name, final int size) {
        this.size = size;
        this.name = name;
        update();

    }

    public static void setDefault_size(int size) {
        Gdx.app.log("Font", "Setting default size to "+size);
        default_size = size;
    }

    public void setName(String[] name) {
        this.name = name;
    }
    public void setName(String name) {
        this.name = new String[]{name};
    }

    public Color getColor() {
        return color;
    }



    public static String[] default_name() {
        return new String[]{"VL Gothic", "Verdana", "Arial", "Courier New"};
    }

    public static boolean default_bold() {
        return false;
    }

    public static boolean default_italic() {
        return false;
    }<commit_msg>Removed VL Gothic from default font list: RPGMaker games will set this themselves<commit_after>package org.jrgss.api;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.jrgss.FileUtil;
import org.jrgss.JRGSSGame;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by matty on 6/27/14.
 */
@Data
public class Font {
    final static Map<FontCacheKey, BitmapFont> fontCache = new HashMap<>();
    int size;
    Color color = new Color(255, 255, 255, 255);
    boolean outline = true;
    Color out_color = new Color(0, 0, 0, 128);
    @Getter
    BitmapFont bitmapFont;
    boolean bold = false;
    boolean italic = false;
    boolean shadow = false;
    @Getter
    static int default_size = 24;
    String[] name;


    private static String getOSFontDir() {
        String osName = System.getProperty("os.name");
        if(osName.toLowerCase().contains("mac")) {
            return "/Library/Fonts";
        }
        return null;
    }

    private static String getOSFont(String name, boolean bold, boolean italic) {
        String ret = getOSFontDir()+File.separator+name;
        if(bold) {
            ret = ret+" Bold";
        }
        if(italic) {
            ret = ret+" Italic";
        }
        return ret+".ttf";
    }

    public Font() {
        this(default_name());
    }

    public Font(String[] name) {
        this(name, default_size);
    }

    public Font(final String[] name, final int size) {
        this.size = size;
        this.name = name;
        update();

    }

    public static void setDefault_size(int size) {
        Gdx.app.log("Font", "Setting default size to "+size);
        default_size = size;
    }

    public void setName(String[] name) {
        this.name = name;
    }
    public void setName(String name) {
        this.name = new String[]{name};
    }

    public Color getColor() {
        return color;
    }



    public static String[] default_name() {
        return new String[]{"Verdana", "Arial", "Courier New"};
    }

    public static boolean default_bold() {
        return false;
    }

    public static boolean default_italic() {
        return false;
    }
{'fraction_non_alphanumeric': 0.11652588260775396, 'fraction_numerical': 0.011695906432748537, 'mean_word_length': 2.4030950626381724, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4325869', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1423, 'n_words': 384}