import java.io.File;
import java.util.Properties;
+import saccubus.worker.classic.profile.NgSetting;
/**
- * \95Ï\8a·\90Ý\92è.
+ * 変換設定.
* @author yuki
*/
public class ConvertSetting {
}
public static ConvertSetting load(Properties prop) {
+ String defaultFont = "";
String win_dir = System.getenv("windir");
- if (!win_dir.endsWith("\\")) {
- win_dir = win_dir + "\\";
+ if (win_dir != null) {
+ //windows の場合のデフォルトフォントパス
+ defaultFont = new File(win_dir, "Fonts" + File.separator + "msgothic.ttc").getPath();
}
int maxComment = Integer.parseInt(prop.getProperty(PROP_SHOW_COMMENT, "30"));
- String font = prop.getProperty(PROP_FONT_PATH, win_dir + "Fonts\\msgothic.ttc");
+ String font = prop.getProperty(PROP_FONT_PATH, defaultFont);
int fontIndex = Integer.parseInt(prop.getProperty(PROP_FONT_INDEX, "1"));
boolean showConv = Boolean.parseBoolean(prop.getProperty(PROP_SHOW_VIDEO, "true"));
String ngWord = prop.getProperty(PROP_NG_WORD, "");
return new ConvertSetting(vhookDisabled, maxComment, new File(font), fontIndex, shadowIndex, showConv,
adjustFont, opaque, new NgSetting(ngWord, ngId));
}
-
- public static class NgSetting {
-
- private final String word;
- private final String id;
-
- public NgSetting(String word, String id) {
- this.word = word;
- this.id = id;
- }
-
- public String getWord() {
- return word;
- }
-
- public String getId() {
- return id;
- }
- }
}