""" + t_("Alphabet") + """
""" + t_("a b c d e f g h i j k l m n o p q r s t u v w x y z") + """
""" + t_("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z") + """
0 1 2 3 4 5 6 7 8 9
""");
} catch (GLib.Error e) {
warning (e.message);
}
}
public static bool export_ttf_font () {
Font font = BirdFont.get_current_font ();
File f = font.get_folder ();
printd (@"export_ttf_font:\n");
printd (@"font.get_path (): $(font.get_path ())\n");
printd (@"font.get_folder_path (): $(font.get_folder_path ())\n");
printd (@"font.get_folder (): $((!) f.get_path ())\n");
return export_ttf_font_path (f);
}
public static bool export_ttf_font_path (File folder, bool use_export_settings = true) {
Font current_font = BirdFont.get_current_font ();
File ttf_file;
File eot_file;
bool done = true;
try {
ttf_file = get_child (folder, ExportSettings.get_file_name (current_font) + ".ttf");
eot_file = get_child (folder, ExportSettings.get_file_name (current_font) + ".eot");
printd (@"Writing TTF fonts to $((!) ttf_file.get_path ())\n");
if (ttf_file.query_exists ()) {
ttf_file.delete ();
}
if (eot_file.query_exists ()) {
eot_file.delete ();
}
write_ttf ((!) ttf_file.get_path ());
if (!use_export_settings || ExportSettings.export_eot_setting (current_font)) {
write_eot ((!) ttf_file.get_path (), (!) eot_file.get_path ());
}
if (use_export_settings && !ExportSettings.export_ttf_setting (current_font)) {
if (ttf_file.query_exists ()) {
ttf_file.delete ();
}
}
} catch (Error e) {
critical (@"$(e.message)");
done = false;
}
return done;
}
public static bool export_svg_font () {
Font font = BirdFont.get_current_font ();
return export_svg_font_path (font.get_folder ());
}
public static bool export_svg_font_path (File folder) {
Font font = BirdFont.get_current_font ();
string file_name = @"$(ExportSettings.get_file_name (font)).svg";
File file;
SvgFontFormatWriter fo;
try {
file = get_child (folder, file_name);
if (file.query_exists ()) {
file.delete ();
}
fo = new SvgFontFormatWriter ();
fo.open (file);
fo.write_font_file (font);
fo.close ();
} catch (Error e) {
critical (@"$(e.message)");
return false;
}
return true;
}
static void write_ttf (string ttf) {
OpenFontFormatWriter fo = new OpenFontFormatWriter ();
Font f = BirdFont.get_current_font ();
File file = (!) File.new_for_path (ttf);
try {
fo.open (file);
fo.write_ttf_font (f);
fo.close ();
} catch (Error e) {
warning (@"Can't write TTF font to $ttf");
critical (@"$(e.message)");
}
}
static void write_eot (string ttf, string eot) {
EotWriter fo = new EotWriter (ttf, eot);
try {
fo.write ();
} catch (Error e) {
warning (@"EOF conversion falied, $ttf -> $eot");
critical (@"$(e.message)");
}
}
}
}