Clone in a terminal:
Commit bafffac
Johan Mattsson - 2013-02-12T12:33:30+00:00
bafffacbc4348f34e608f2abf8977dbcefaa6babjohan.mattsson.m@gmail.com

rename supplement namespace to birdfont

Changed files (69)

Diff

diff --git a/birdfont-export/BirdfontExport.vala b/birdfont-export/BirdfontExport.valaindex c434bd8..f77cd4e 100644--- a/birdfont-export/BirdfontExport.vala+++ b/birdfont-export/BirdfontExport.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -using Birdfont;+using BirdFont;  /** Stand alone command line utility for exporting fonts. */ public static int main (string[] arg) {				diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex f17274e..3680a81 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -18,10 +18,10 @@ using Cairo; using Gtk; using Gdk;-using Supplement;+using BirdFont; using WebKit; -namespace Supplement {+namespace BirdFont {  public class GtkWindow : Gtk.Window, NativeWindow { @@ -43,7 +43,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	string inkscape_clipboard = ""; 	 	public GtkWindow (string title) {-		((Gtk.Window)this).set_title ("Birdfont");+		((Gtk.Window)this).set_title ("BirdFont"); 	} 	 	public void init () {@@ -104,9 +104,9 @@ public class GtkWindow : Gtk.Window, NativeWindow { 							string? line; 							StringBuilder sb = new StringBuilder (); 							uint rid = Random.next_int ();-							Font font = Supplement.get_current_font ();+							Font font = BirdFont.get_current_font (); 							-							File preview_directory = Supplement.get_preview_directory ();+							File preview_directory = BirdFont.get_preview_directory (); 							 							File f_ttf = font.get_folder ().get_child (@"$(font.get_name ()).ttf"); 							File f_eot = font.get_folder ().get_child (@"$(font.get_name ()).eot");@@ -130,7 +130,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 							File r_ttf = preview_directory.get_child (@"$(font.get_name ())$rid.ttf"); 							File r_svg = preview_directory.get_child (@"$(font.get_name ())$rid.svg"); 							-							if (Supplement.win32) {+							if (BirdFont.win32) { 								f_ttf.copy (r_ttf, FileCopyFlags.NONE); 							} 							@@ -276,7 +276,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	} 	 	public string get_clipboard_data () {-		if (Supplement.mac) {+		if (BirdFont.mac) { 			string? t; 			t = clipboard.wait_for_text (); 			return (t == null) ? "" : (!) t;@@ -297,7 +297,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	 	public void set_inkscape_clipboard (string inkscape_clipboard_data) { 		// FIXME: clipboard seems to be rather broken on Mac -		if (Supplement.mac) {+		if (BirdFont.mac) { 			clipboard.set_text (inkscape_clipboard_data, -1); 		} else { 			TargetEntry t = { "image/x-inkscape-svg", 0, 0 };@@ -636,10 +636,10 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	 	public bool quit () { 		bool added;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		SaveDialog save_tab = new SaveDialog (); 		-		if (Supplement.get_current_font ().is_modified ()) {+		if (BirdFont.get_current_font ().is_modified ()) { 			added = MainWindow.get_tab_bar ().add_unique_tab (save_tab, 50); 		} else { 			added = false;@@ -669,7 +669,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	public string? file_chooser (string title, FileChooserAction action, string label) { 		string? fn = null; 		FileChooserDialog file_chooser = new FileChooserDialog (title, this, action, Stock.CANCEL, ResponseType.CANCEL, label, ResponseType.ACCEPT);-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		 		try { 			file_chooser.set_current_folder_file (font.get_folder ());@@ -834,7 +834,7 @@ public class GlyphCanvasArea : DrawingArea  { 					warning (@"\nGlyph canvas is not divisible by two.\nWidth: $(allocation.width)\nHeight: $(allocation.height)"); 				} 				-				Supplement.current_glyph.resized ();+				BirdFont.current_glyph.resized (); 			} 			 			alloc = allocation;@@ -897,7 +897,7 @@ public class GlyphCanvasArea : DrawingArea  { 		// MOD5 is logo button on Linux 		// MOD2 is logo button on Mac OS X -		if (Supplement.mac) {+		if (BirdFont.mac) { 			if (has_flag (k, ModifierType.MOD2_MASK)) { 				KeyBindings.set_modifier (LOGO); 			}diff --git a/birdfont/Main.vala b/birdfont/Main.valaindex ab811ca..e163136 100644--- a/birdfont/Main.vala+++ b/birdfont/Main.vala@@ -15,8 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -using Birdfont;-using Supplement;+using BirdFont;  const string GETTEXT_PACKAGE = "birdfont";  @@ -29,7 +28,7 @@ public static int main (string[] arg) { 	GtkWindow native_window; 	MainWindow window; 	string file;-	Supplement.Supplement supplement = new Supplement.Supplement ();+	BirdFont.BirdFont supplement = new BirdFont.BirdFont (); 	supplement.init (arg);  	Gtk.init (ref arg);@@ -41,7 +40,7 @@ public static int main (string[] arg) { 	window.set_native (native_window); 	native_window.init (); -	file = Supplement.Supplement.args.get_file ();+	file = BirdFont.BirdFont.args.get_file (); 	if (file != "") { 		MainWindow.menu_tab.load_font (file); 	}diff --git a/configure b/configureindex 0c1dc65..66f43c0 100755--- a/configure+++ b/configure@@ -25,8 +25,8 @@ def write_config (): 		)  	f = open('./libbirdfont/Config.vala', 'w+')-	f.write("// Don't edit this file -- it's generated by the build script\n")-	f.write("namespace Supplement {\n")+	f.write("// Don't edit this file -- it is generated by the build script\n")+	f.write("namespace BirdFont {\n")  	var_line = '	internal static const string %s = "%s";\n' 	for name, value in vars:diff --git a/libbirdfont/Allocation.vala b/libbirdfont/Allocation.valaindex efcc36d..baa9cbe 100644--- a/libbirdfont/Allocation.vala+++ b/libbirdfont/Allocation.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public struct Allocation { 	public int width;diff --git a/libbirdfont/Argument.vala b/libbirdfont/Argument.valaindex ab6b108..365a895 100644--- a/libbirdfont/Argument.vala+++ b/libbirdfont/Argument.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont { 	 public class Argument : GLib.Object { 	diff --git a/libbirdfont/BackgroundSelection.vala b/libbirdfont/BackgroundSelection.valaindex ac705be..d9dccca 100644--- a/libbirdfont/BackgroundSelection.vala+++ b/libbirdfont/BackgroundSelection.vala@@ -18,7 +18,7 @@ using Cairo; using Gdk; -namespace Supplement {+namespace BirdFont {  class BackgroundSelection : FontDisplay { @@ -64,7 +64,7 @@ class BackgroundSelection : FontDisplay { 		y = 20; 		zoom = 0.04; 		-		font = Supplement.get_current_font ();+		font = BirdFont.get_current_font (); 		foreach (string file in background_images) { 			box_index++; @@ -85,7 +85,7 @@ class BackgroundSelection : FontDisplay { 	private ImageSurface create_thumbnail (string file) throws GLib.Error { 		Pixbuf pixbuf; 		-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		File folder = font.get_backgrounds_folder (); 		string fn = Checksum.compute_for_string (ChecksumType.SHA1, file); 		File original = File.new_for_path (file);@@ -158,7 +158,7 @@ class BackgroundSelection : FontDisplay { 		file = MainWindow.file_chooser_open ("Add image");  		if (file != null) {-			Supplement.get_current_font ().add_background_image ((!) file);+			BirdFont.get_current_font ().add_background_image ((!) file); 		} 		 		MainWindow.get_glyph_canvas ().redraw ();				@@ -173,7 +173,7 @@ class BackgroundSelection : FontDisplay { 		TabBar tb; 		Tool zoom_background; -		font = Supplement.get_current_font ();+		font = BirdFont.get_current_font (); 				 		if (!(0 <= active_box - 1 < background_images.length ())) { 			return;@@ -207,7 +207,7 @@ class BackgroundSelection : FontDisplay { 	}  	public override void selected_canvas () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		File folder = font.get_backgrounds_folder (); 		 		if (!folder.query_exists ()) {@@ -224,7 +224,7 @@ class BackgroundSelection : FontDisplay { 	}  	void collect_background_images () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		File directory = font.get_folder (); 		FileEnumerator enumerator; 		FileInfo? file_info;diff --git a/libbirdfont/BackgroundTool.vala b/libbirdfont/BackgroundTool.valaindex 2e505e9..548300e 100644--- a/libbirdfont/BackgroundTool.vala+++ b/libbirdfont/BackgroundTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class BackgroundTool : Tool { diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valanew file mode 100644index 0000000..d154bbf--- /dev/null+++ b/libbirdfont/BirdFont.vala@@ -0,0 +1,378 @@+/*+    Copyright (C) 2012 Johan Mattsson++    This program is free software: you can redistribute it and/or modify+    it under the terms of the GNU General Public License as published by+    the Free Software Foundation, either version 3 of the License, or+    (at your option) any later version.++    This program is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+    GNU General Public License for more details.++    You should have received a copy of the GNU General Public License+    along with this program.  If not, see <http://www.gnu.org/licenses/>.+*/+using BirdFont;+const string GETTEXT_PACKAGE = "birdfont"; ++namespace BirdFont {++static void print_export_help (string[] arg) {+	stdout.printf (_("Usage:"));+	stdout.printf (arg[0]);+	stdout.printf (" [OPTION ...] FILE\n");+	stdout.printf ("-h, --help                      " + _("print this message\n"));+	stdout.printf ("-o, --output [DIRECTORY]        " + _("write files to this directory\n"));+	stdout.printf ("-s, --svg                       " + _("write svg file\n"));+	stdout.printf ("-t, --ttf                       " + _("write ttf and eot files\n"));+	stdout.printf ("\n");+}++public static int run_export (string[] arg) {+	string output_directory = ".";+	string file_name = "";+	bool specific_formats = false;	+	bool write_ttf = false;+	bool write_svg = false;+	+	File directory;+		+	if (arg.length < 2) {+		print_export_help (arg);+	}+	+	for (int i = 1; i < arg.length; i++) {++		if (arg[i] == "-f" || arg[i] == "--fatal-warnings") {+			BirdFont.fatal_wanings = true;+			return 0;+		}++		if (arg[i] == "-h" || arg[i] == "--help") {+			print_export_help (arg);+			return 0;+		}+		+		if ((arg[i] == "-o" || arg[i] == "--output") && i + 1 < arg.length) {+			output_directory = arg[i + 1];+			i++;+			continue;+		}++		if (arg[i] == "-s" || arg[i] == "--svg") {+			write_svg = true;+			specific_formats = true;+			continue;+		}+		+		if (arg[i] == "-t" || arg[i] == "--ttf") {+			write_ttf = true;+			specific_formats = true;+			continue;+		}+		+		if (arg[i].has_prefix ("-")) {+			print_export_help (arg);+			return 1;+		}+		+		if (!arg[i].has_prefix ("-")) {+			file_name = arg[i];+						+			if (i != arg.length - 1) {+				print_export_help (arg);+				return 1;+			}+			+			break;+		}+	}++	if (BirdFont.fatal_wanings) {+		LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING;+		Log.set_handler (null, levels, BirdFont.fatal_warning);		+	}+	+	Preferences.load ();+			+	BirdFont.args = new Argument ("");+	BirdFont.current_font = new Font ();+	BirdFont.current_glyph = new Glyph ("");+	+	if (!BirdFont.get_current_font ().load (file_name, false)) {+		stderr.printf (@"Failed to load font $file_name.\n");+		+		if (!file_name.has_suffix (".ffi")) {+			stderr.printf (@"Is it a .ffi file?\n");+		}+		+		return 1;+	}++	directory = File.new_for_path (output_directory);+	+	if (!directory.query_exists ()) {+		stderr.printf (_("Can't find output directory") + @"$((!)directory.get_path ())\n");+		return 1;+	}++	if (!specific_formats || write_svg) {+		print (_("Writing") + @" $(BirdFont.current_font.get_name ()).svg to $output_directory\n");+		ExportTool.export_svg_font_path (File.new_for_path (output_directory));+	}++	if (!specific_formats || write_ttf) {+		print (_("Writing") + @" $(BirdFont.current_font.get_name ()).ttf to $output_directory\n");+		ExportTool.export_ttf_font_path (File.new_for_path (output_directory), false);+	}+	+	return 0;+}++public static string wine_to_unix_path (string exec_path) {+	bool drive_c, drive_z;+	int i;+	string p, q;++	p = exec_path;+	p = p.replace ("\\", "/");+	+	drive_c = exec_path.index_of ("C:") == 0;+	drive_z = exec_path.index_of ("Z:") == 0;+	+	i = p.index_of (":");+	+	if (i != -1) {+		p = p.substring (i + 2);+	}++	if (drive_c) {+		q = @"/home/$(Environment.get_user_name ())/.wine/drive_c/" + p;+		+		if (File.new_for_path (q).query_exists ()) {+			return q;+		} else {+			return p;+		}+	}+	+	if (drive_z) {+		return ("/" + p).dup ();+	}++	return exec_path.dup ();+}++public bool is_null (void* n) {+	return n == null;+}++public bool has_flag (uint32 flag, uint32 mask) {+	return (flag & mask) > 0;+}++public class BirdFont {+	public static Argument args;+	public static bool experimental = false;+	internal static bool show_coordinates = false;+	internal static bool fatal_wanings = false;+	public static bool win32 = false;+	public static bool mac = false;+	internal static string exec_path = "";++	internal static Font current_font;+	public static Glyph current_glyph;+	+	public void init (string[] arg) {+		int err_arg;+		int i;+		File font_file;+		string exec_path;++		stdout.printf ("birdfont version %s\n", VERSION);+		stdout.printf ("built on %s\n", BUILD_TIMESTAMP);++		init_gettext ();		+		+		args = new Argument.command_line (arg);++		if (args.has_argument ("--help")) {+			args.print_help ();+			Process.exit (0);+		}++		err_arg = args.validate ();+		if (err_arg != 0) {+			stdout.printf (@"Unknown parameter $(arg [err_arg])\n\n");+			args.print_help ();+			Process.exit (0);+		}++		Preferences.load ();+		+		current_font = new Font ();+		current_font.set_name ("");+		current_font.initialised = false;+		current_glyph = new Glyph ("");++		experimental = args.has_argument ("--test");+		show_coordinates = args.has_argument ("--show-coordinates");+		fatal_wanings = args.has_argument ("--fatal-warning");+		win32 = (arg[0].index_of (".exe") > -1) || arg[0] == "wine";++#if MAC+		mac = true;+#else+		mac = args.has_argument ("--mac");+#endif+		+		exec_path = "";++		if (win32) {+			// wine hack to get "." folder in win32 environment+			i = arg[0].last_index_of ("\\");+			+			if (i != -1) {	+				exec_path = arg[0];+				exec_path = exec_path.substring (0, i);+				exec_path = wine_to_unix_path (exec_path);			+			}+		} else {+			exec_path = "./";+		}++		if (args.get_file () != "") {+			font_file = File.new_for_path (args.get_file ());+			+			if (!font_file.query_exists ()) {+				stderr.printf (@"File $(args.get_file ()) not found.");+				Process.exit (-1);+			}+		}++		if (fatal_wanings) {+			LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING;+			Log.set_handler (null, levels, fatal_warning);+		}+		+		Preferences.set_last_file (get_current_font ().get_path ());+	}++	static void init_gettext () {+		File f;++		Intl.setlocale (LocaleCategory.MESSAGES, "");+		Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "utf-8");++		f = File.new_for_path ("./build/locale/sv/LC_MESSAGES/birdfont.mo");+		if (f.query_exists ()) {+			Intl.bindtextdomain (GETTEXT_PACKAGE, "./build/locale");+			return;+		}++		f = File.new_for_path (".\\locale\\sv\\LC_MESSAGES\\birdfont.mo");+		if (f.query_exists ()) {+			Intl.bindtextdomain (GETTEXT_PACKAGE, ".\\locale");+			return;+		}++		f = File.new_for_path (PREFIX + "/share/locale/sv/LC_MESSAGES/birdfont.mo");+		if (f.query_exists ()) {+			Intl.bindtextdomain (GETTEXT_PACKAGE, PREFIX + "/share/locale");+			return;+		}+						+		f = File.new_for_path ("/usr/local/share/locale/sv/LC_MESSAGES/birdfont.mo");+		if (f.query_exists ()) {+			Intl.bindtextdomain (GETTEXT_PACKAGE, "/usr/local/share/locale");+			return;+		}		++		f = File.new_for_path ("/usr/share/locale/sv/LC_MESSAGES/birdfont.mo");+		if (f.query_exists ()) {+			Intl.bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");+			return;+		}+		+		warning ("translations not found");+	}+	+	public static Font get_current_font () {+		return current_font;+	}++	internal static void fatal_warning (string? log_domain, LogLevelFlags log_levels, string message) {		+		bool fatal = true;+		+		if (log_domain != null) {+			stderr.printf ("%s: \n", (!) log_domain);+		}+		+		stderr.printf ("\n%s\n\n", message);+		assert (!fatal);+	}+	+	internal static void new_font () {+		current_font = new Font ();+	}++	public static File get_preview_directory () {+		File settings = get_settings_directory ();+		File backup = settings.get_child ("preview");+		+		if (!backup.query_exists ()) {+			DirUtils.create ((!) backup.get_path (), 0xFFFFFF);+		}+			+		return backup;+	}++	internal static File get_thumbnail_directory () {+		File thumbnails = get_settings_directory ().get_child ("thumbnails");+		+		if (!thumbnails.query_exists ()) {+			DirUtils.create ((!) thumbnails.get_path (), 0xFFFFFF);+		}+		+		return thumbnails;+	}+		+	internal static File get_settings_directory () {+		File home = File.new_for_path (Environment.get_home_dir ());+		File settings = home.get_child (".birdfont");+		+		if (!settings.query_exists ()) {+			DirUtils.create ((!) settings.get_path (), 0xFFFFFF);+		}+			+		return settings;+	}++	internal static File get_backup_directory () {+		File settings = get_settings_directory ();+		File backup = settings.get_child ("backup");+		+		if (!backup.query_exists ()) {+			DirUtils.create ((!) backup.get_path (), 0xFFFFFF);+		}+			+		return backup;+	}++	internal static bool has_argument (string param) {+		if (is_null (args)) {+			warning ("args is null");+			return false;+		}+		+		return args.has_argument (param);+	}+	+	internal static string? get_argument (string param) {+		return args.get_argument (param);+	}	+}++}diff --git a/libbirdfont/Birdfont.vala b/libbirdfont/Birdfont.valadeleted file mode 100644index f9f96d7..0000000--- a/libbirdfont/Birdfont.vala+++ /dev/null@@ -1,167 +0,0 @@-/*-    Copyright (C) 2012 Johan Mattsson--    This program is free software: you can redistribute it and/or modify-    it under the terms of the GNU General Public License as published by-    the Free Software Foundation, either version 3 of the License, or-    (at your option) any later version.--    This program is distributed in the hope that it will be useful,-    but WITHOUT ANY WARRANTY; without even the implied warranty of-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-    GNU General Public License for more details.--    You should have received a copy of the GNU General Public License-    along with this program.  If not, see <http://www.gnu.org/licenses/>.-*/-using Supplement;--namespace Birdfont {--static void print_export_help (string[] arg) {-	stdout.printf (_("Usage:"));-	stdout.printf (arg[0]);-	stdout.printf (" [OPTION ...] FILE\n");-	stdout.printf ("-h, --help                      " + _("print this message\n"));-	stdout.printf ("-o, --output [DIRECTORY]        " + _("write files to this directory\n"));-	stdout.printf ("-s, --svg                       " + _("write svg file\n"));-	stdout.printf ("-t, --ttf                       " + _("write ttf and eot files\n"));-	stdout.printf ("\n");-}--public static int run_export (string[] arg) {-	string output_directory = ".";-	string file_name = "";-	bool specific_formats = false;	-	bool write_ttf = false;-	bool write_svg = false;-	-	File directory;-		-	if (arg.length < 2) {-		print_export_help (arg);-	}-	-	for (int i = 1; i < arg.length; i++) {--		if (arg[i] == "-f" || arg[i] == "--fatal-warnings") {-			Supplement.Supplement.fatal_wanings = true;-			return 0;-		}--		if (arg[i] == "-h" || arg[i] == "--help") {-			print_export_help (arg);-			return 0;-		}-		-		if ((arg[i] == "-o" || arg[i] == "--output") && i + 1 < arg.length) {-			output_directory = arg[i + 1];-			i++;-			continue;-		}--		if (arg[i] == "-s" || arg[i] == "--svg") {-			write_svg = true;-			specific_formats = true;-			continue;-		}-		-		if (arg[i] == "-t" || arg[i] == "--ttf") {-			write_ttf = true;-			specific_formats = true;-			continue;-		}-		-		if (arg[i].has_prefix ("-")) {-			print_export_help (arg);-			return 1;-		}-		-		if (!arg[i].has_prefix ("-")) {-			file_name = arg[i];-						-			if (i != arg.length - 1) {-				print_export_help (arg);-				return 1;-			}-			-			break;-		}-	}--	if (Supplement.Supplement.fatal_wanings) {-		LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING;-		Log.set_handler (null, levels, Supplement.Supplement.fatal_warning);		-	}-	-	Preferences.load ();-			-	Supplement.Supplement.args = new Argument ("");-	Supplement.Supplement.current_font = new Font ();-	Supplement.Supplement.current_glyph = new Glyph ("");-	-	if (!Supplement.Supplement.get_current_font ().load (file_name, false)) {-		stderr.printf (@"Failed to load font $file_name.\n");-		-		if (!file_name.has_suffix (".ffi")) {-			stderr.printf (@"Is it a .ffi file?\n");-		}-		-		return 1;-	}--	directory = File.new_for_path (output_directory);-	-	if (!directory.query_exists ()) {-		stderr.printf (_("Can't find output directory") + @"$((!)directory.get_path ())\n");-		return 1;-	}--	if (!specific_formats || write_svg) {-		print (_("Writing") + @" $(Supplement.Supplement.current_font.get_name ()).svg to $output_directory\n");-		ExportTool.export_svg_font_path (File.new_for_path (output_directory));-	}--	if (!specific_formats || write_ttf) {-		print (_("Writing") + @" $(Supplement.Supplement.current_font.get_name ()).ttf to $output_directory\n");-		ExportTool.export_ttf_font_path (File.new_for_path (output_directory), false);-	}-	-	return 0;-}--public static string wine_to_unix_path (string exec_path) {-	bool drive_c, drive_z;-	int i;-	string p, q;--	p = exec_path;-	p = p.replace ("\\", "/");-	-	drive_c = exec_path.index_of ("C:") == 0;-	drive_z = exec_path.index_of ("Z:") == 0;-	-	i = p.index_of (":");-	-	if (i != -1) {-		p = p.substring (i + 2);-	}--	if (drive_c) {-		q = @"/home/$(Environment.get_user_name ())/.wine/drive_c/" + p;-		-		if (File.new_for_path (q).query_exists ()) {-			return q;-		} else {-			return p;-		}-	}-	-	if (drive_z) {-		return ("/" + p).dup ();-	}--	return exec_path.dup ();-}--}diff --git a/libbirdfont/CharDatabase.vala b/libbirdfont/CharDatabase.valaindex 54b71ce..d231b38 100644--- a/libbirdfont/CharDatabase.vala+++ b/libbirdfont/CharDatabase.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class CharDatabase { diff --git a/libbirdfont/ClipTool.vala b/libbirdfont/ClipTool.valaindex e723ff7..a54a6a8 100644--- a/libbirdfont/ClipTool.vala+++ b/libbirdfont/ClipTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public class ClipTool : Tool { @@ -38,7 +38,7 @@ public class ClipTool : Tool { 			} 			 			// several clipboards does not work on windows-			if (!Supplement.win32) {+			if (!BirdFont.win32) { 				svg = ExportTool.export_selected_paths_to_string (); 				native_window.set_clipboard (svg); 			}diff --git a/libbirdfont/ColorTool.vala b/libbirdfont/ColorTool.valaindex 8114ea8..fe3f19b 100644--- a/libbirdfont/ColorTool.vala+++ b/libbirdfont/ColorTool.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class ColorTool : Tool { 	diff --git a/libbirdfont/Context.vala b/libbirdfont/Context.valaindex c8ecec0..3adae09 100644--- a/libbirdfont/Context.vala+++ b/libbirdfont/Context.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  /** Kerning context. */ public class ContextDisplay : FontDisplay {@@ -68,7 +68,7 @@ public class ContextDisplay : FontDisplay { 			wi = 0; 			 			foreach (string s in word.glyph) {				-				g = (!) Supplement.get_current_font ().get_glyph (s);	+				g = (!) BirdFont.get_current_font ().get_glyph (s);	 				 				if (s == "") { 					continue;@@ -137,7 +137,7 @@ public class ContextDisplay : FontDisplay { 		int wi = 0; 		double kern; 		-		font = Supplement.get_current_font ();+		font = BirdFont.get_current_font ();  		font.touch (); @@ -168,7 +168,7 @@ public class ContextDisplay : FontDisplay { 	} 	 	private double get_kerning (string a, string b) {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		return font.get_kerning (a, b); 	} 	@@ -207,7 +207,7 @@ public class ContextDisplay : FontDisplay { 	 	public override void key_press (uint keyval) { 		unichar c = (unichar) keyval;-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		string name; 		 		if (KeyBindings.modifier == NONE || KeyBindings.modifier == SHIFT) {@@ -269,7 +269,7 @@ public class ContextDisplay : FontDisplay { 			foreach (string s in word.glyph) { 				 				// draw glyph-				g = (!) Supplement.get_current_font ().get_glyph (s);	+				g = (!) BirdFont.get_current_font ().get_glyph (s);	 				kern = (prev != "") ? get_kerning (prev, s) : 0; 				 				if (g == null) {diff --git a/libbirdfont/CutBackgroundTool.vala b/libbirdfont/CutBackgroundTool.valaindex 2c480ab..ed909c9 100644--- a/libbirdfont/CutBackgroundTool.vala+++ b/libbirdfont/CutBackgroundTool.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  class CutBackgroundTool : Tool { @@ -195,7 +195,7 @@ class CutBackgroundTool : Tool {  	void save_img (Surface sr, Glyph g) { 		GlyphBackgroundImage newbg;-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		File img_dir; 		File img_file; 		File img_file_next;diff --git a/libbirdfont/CutTool.vala b/libbirdfont/CutTool.valaindex 445d444..f312d1a 100644--- a/libbirdfont/CutTool.vala+++ b/libbirdfont/CutTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class CutTool : Tool { diff --git a/libbirdfont/DropMenu.vala b/libbirdfont/DropMenu.valaindex f7387c9..b4f0a7c 100644--- a/libbirdfont/DropMenu.vala+++ b/libbirdfont/DropMenu.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public enum MenuDirection { 	DROP_DOWN,diff --git a/libbirdfont/EditPoint.vala b/libbirdfont/EditPoint.valaindex a75b80a..b502e52 100644--- a/libbirdfont/EditPoint.vala+++ b/libbirdfont/EditPoint.vala@@ -17,7 +17,7 @@  using Math; -namespace Supplement {+namespace BirdFont {  public enum PointType { 	NONE,diff --git a/libbirdfont/EditPointHandle.vala b/libbirdfont/EditPointHandle.valaindex 8a6b322..28cd2c7 100644--- a/libbirdfont/EditPointHandle.vala+++ b/libbirdfont/EditPointHandle.vala@@ -17,7 +17,7 @@  using Math; -namespace Supplement {+namespace BirdFont { 		 public class EditPointHandle  { 	diff --git a/libbirdfont/EotWriter.vala b/libbirdfont/EotWriter.valaindex fe22b8e..839722d 100644--- a/libbirdfont/EotWriter.vala+++ b/libbirdfont/EotWriter.vala@@ -17,7 +17,7 @@  using Math; -namespace Supplement {+namespace BirdFont {  class EotWriter : GLib.Object { 	diff --git a/libbirdfont/Expander.vala b/libbirdfont/Expander.valaindex 7e2bd50..40966f4 100644--- a/libbirdfont/Expander.vala+++ b/libbirdfont/Expander.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public class Expander : GLib.Object { 	diff --git a/libbirdfont/ExportTool.vala b/libbirdfont/ExportTool.valaindex 95b63df..6c0e940 100644--- a/libbirdfont/ExportTool.vala+++ b/libbirdfont/ExportTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public class ExportTool : Tool { 	private static ExportThread export_thread;@@ -49,7 +49,7 @@ public class ExportTool : Tool {  	public static string export_current_glyph_to_string (bool only_selected_paths = false) { 		Glyph glyph = MainWindow.get_current_glyph ();-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		string name; 		StringBuilder s; 		double baseline;@@ -175,7 +175,7 @@ public class ExportTool : Tool { 	  	public static bool export_all () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		bool f; 		 		if (font.get_ttf_export ()) {@@ -383,7 +383,7 @@ os.put_string ( 	}  	public static bool export_ttf_font () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		File file = font.get_folder (); 		return export_ttf_font_path (file); 	}@@ -437,14 +437,14 @@ os.put_string ( 	} 	 	public static bool export_ttf_font_path (File folder, bool async = true) {-		Font current_font = Supplement.get_current_font ();+		Font current_font = BirdFont.get_current_font (); 		File ttf_file; 		File eot_file; 		string temp_file; 		bool done = true; 		string export_command; 		-		if (Supplement.win32) {+		if (BirdFont.win32) { 			async = false; 		} 		@@ -493,12 +493,12 @@ os.put_string ( 	} 	 	public static bool export_svg_font () {-		Font font = Supplement.get_current_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 = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		string file_name = @"$(font.get_name ()).svg"; 		File file; 		SvgFontFormatWriter fo;diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex e196c5d..968fa48 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -18,7 +18,7 @@ using Cairo; using Xml; -namespace Supplement {+namespace BirdFont {  public enum FontFormat { 	FFI,@@ -101,7 +101,7 @@ public class Font : GLib.Object {  	public File get_backgrounds_folder () { 		string fn = @"$(get_name ()) backgrounds";-		File f = Supplement.get_settings_directory ().get_child (fn);+		File f = BirdFont.get_settings_directory ().get_child (fn); 		return f; 	} @@ -452,7 +452,7 @@ public class Font : GLib.Object {  	/** Delete temporary rescue files. */ 	public void delete_backup () {-		File dir = Supplement.get_backup_directory ();+		File dir = BirdFont.get_backup_directory (); 		File? new_file = null; 		File file; 		string backup_file;@@ -473,7 +473,7 @@ public class Font : GLib.Object { 	 	/** Returns path to backup file. */ 	public string save_backup () {-		File dir = Supplement.get_backup_directory ();+		File dir = BirdFont.get_backup_directory (); 		File? temp_file = null; 		string backup_file; 	@@ -493,7 +493,7 @@ public class Font : GLib.Object { 			font_file = path; 			 			// delete backup when font is saved-			font = Supplement.get_current_font ();+			font = BirdFont.get_current_font (); 			font.delete_backup (); 		} 		@@ -789,7 +789,7 @@ public class Font : GLib.Object { 				format = FontFormat.FFI; 			} 			-			if (Supplement.experimental) {+			if (BirdFont.experimental) { 				if (path.has_suffix (".ttf")) { 					font_file = path; 					loaded = parse_otf_file (path);@@ -816,7 +816,7 @@ public class Font : GLib.Object { 	}  	private void add_thumbnail () {-		File f = Supplement.get_thumbnail_directory ().get_child (@"$((!) get_file_name ()).png");+		File f = BirdFont.get_thumbnail_directory ().get_child (@"$((!) get_file_name ()).png"); 		Glyph? gl = get_glyph ("a"); 		Glyph g; 		ImageSurface img;diff --git a/libbirdfont/FontDisplay.vala b/libbirdfont/FontDisplay.valaindex 5851e33..534e2b3 100644--- a/libbirdfont/FontDisplay.vala+++ b/libbirdfont/FontDisplay.vala@@ -16,9 +16,8 @@ */  using Cairo;-using Birdfont; -namespace Supplement {+namespace BirdFont {  /** Javascripts in webkit do use this callback. */ public class PropertyFunction {@@ -48,7 +47,7 @@ public abstract class FontDisplay : GLib.Object { 		string wp; 		 		// wine uri hack-		if (Supplement.win32) {+		if (BirdFont.win32) { 			wp = wine_to_unix_path (uri); 			 			if (find_file (wp, "").query_exists ()) {@@ -193,10 +192,10 @@ public abstract class FontDisplay : GLib.Object { 		File f; 		string d = (dir == null) ? "" : (!) dir; -		f = get_file (Supplement.exec_path + "/", name + "/");+		f = get_file (BirdFont.exec_path + "/", name + "/"); 		if (likely (f.query_exists ())) return f; 		-		f = get_file (Supplement.exec_path + "/" + d + "/", name);+		f = get_file (BirdFont.exec_path + "/" + d + "/", name); 		if (likely (f.query_exists ())) return f; 		 		f = get_file ("./" + d + "/", name);diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex be7c71f..c2fe58d 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public class Glyph : FontDisplay { 	// Background image@@ -243,7 +243,7 @@ public class Glyph : FontDisplay { 		 		background_image = bg; 		-		Supplement.get_current_font ().touch ();+		BirdFont.get_current_font ().touch (); 	} 	 	public GlyphBackgroundImage? get_background_image () {@@ -297,50 +297,50 @@ public class Glyph : FontDisplay { 	public void add_help_lines () { 		remove_lines (); -		assert (!is_null (Supplement.get_current_font ()));+		assert (!is_null (BirdFont.get_current_font ())); -		double bgt = Supplement.get_current_font ().top_limit;+		double bgt = BirdFont.get_current_font ().top_limit; 		Line top_margin_line = new Line ("top margin", bgt, false); 		top_margin_line.set_color (0.7, 0, 0, 0.5); 		top_margin_line.position_updated.connect ((pos) => {-			Supplement.get_current_font ().top_limit = pos;+			BirdFont.get_current_font ().top_limit = pos; 		}); 						-		double thp = Supplement.get_current_font ().top_position;+		double thp = BirdFont.get_current_font ().top_position; 		Line top_line = new Line ("top", thp, false); 		top_line.position_updated.connect ((pos) => {-				Font f = Supplement.get_current_font ();+				Font f = BirdFont.get_current_font (); 				f.top_position = pos; 			}); 		-		double xhp = Supplement.get_current_font ().xheight_position;+		double xhp = BirdFont.get_current_font ().xheight_position; 		Line xheight_line = new Line ("x-height", xhp, false); 		xheight_line.set_color (33 / 255.0, 68 / 255.0, 120 / 255.0, 166 / 255.0); 		xheight_line.position_updated.connect ((pos) => {				-				Font f = Supplement.get_current_font ();+				Font f = BirdFont.get_current_font (); 				f.xheight_position = pos; 			}); -		double xbl = Supplement.get_current_font ().base_line;+		double xbl = BirdFont.get_current_font ().base_line; 		Line base_line = new Line ("baseline", xbl, false); 		base_line.position_updated.connect ((pos) => {-				Font f = Supplement.get_current_font ();+				Font f = BirdFont.get_current_font (); 				f.base_line = pos; 			});  		-		double bp = Supplement.get_current_font ().bottom_position;+		double bp = BirdFont.get_current_font ().bottom_position; 		Line bottom_line = new Line ("bottom", bp, false); 		bottom_line.set_color (33 / 255.0, 68 / 255.0, 120 / 255.0, 166 / 255.0); 		bottom_line.position_updated.connect ((pos) => {-				Supplement.get_current_font ().bottom_position = pos;+				BirdFont.get_current_font ().bottom_position = pos; 			}); -		double bgb = Supplement.get_current_font ().bottom_limit;+		double bgb = BirdFont.get_current_font ().bottom_limit; 		Line bottom_margin_line = new Line ("bottom margin", bgb, false); 		bottom_margin_line.set_color (0.7, 0, 0, 0.5); 		bottom_margin_line.position_updated.connect ((pos) => {-			Supplement.get_current_font ().bottom_limit = pos;+			BirdFont.get_current_font ().bottom_limit = pos; 		}); 							 		Line left_line = new Line ("left", left_limit, true);@@ -525,7 +525,7 @@ public class Glyph : FontDisplay {  		t.move_action (t, (int) x, (int) y); -		if (Supplement.show_coordinates) {+		if (BirdFont.show_coordinates) { 			motion_x = x * ivz () - xc () + view_offset_x; 			motion_y = yc () - y * ivz () - view_offset_y; 		}@@ -905,7 +905,7 @@ public class Glyph : FontDisplay { 		double x, y; 		EditPoint p; 				-		Supplement.get_current_font ().touch ();+		BirdFont.get_current_font ().touch ();  		x = reverse_path_coordinate_x (xt); 		y = reverse_path_coordinate_y (yt);@@ -1348,7 +1348,7 @@ public class Glyph : FontDisplay { 		 		juxtapose (allocation, cr); -		if (Supplement.show_coordinates) {+		if (BirdFont.show_coordinates) { 			draw_coordinate (cmp); 		} @@ -1449,7 +1449,7 @@ public class Glyph : FontDisplay { 	}  	public void reload () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		 		if (f.has_glyph (name)) { 			set_glyph_data ((!) f.get_glyph (name));@@ -1505,7 +1505,7 @@ public class Glyph : FontDisplay { 		Context cr; 		double gx, gy; 		double x1, x2, y1, y2;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font ();  		remove_empty_paths (); 		boundries (out x1, out y1, out x2, out y2);@@ -1633,7 +1633,7 @@ public class Glyph : FontDisplay { 	public void juxtapose (Allocation allocation, Context cr) { 		string glyph_sequence = Preferences.get ("glyph_sequence"); 		unichar c;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		Glyph glyph = MainWindow.get_current_glyph (); 		Glyph juxtaposed; 		StringBuilder current = new StringBuilder ();diff --git a/libbirdfont/GlyphBackgroundImage.vala b/libbirdfont/GlyphBackgroundImage.valaindex 202e73c..a893d46 100644--- a/libbirdfont/GlyphBackgroundImage.vala+++ b/libbirdfont/GlyphBackgroundImage.vala@@ -19,7 +19,7 @@ using Cairo; using Math; using Gdk; -namespace Supplement {+namespace BirdFont { 	 public class GlyphBackgroundImage { 		@@ -210,7 +210,7 @@ public class GlyphBackgroundImage { 	private void create_png () { 		string fn = @"$path.png"; 		-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		File folder = font.get_backgrounds_folder (); 		File original = File.new_for_path (fn); 		File png_image = folder.get_child (@"full_$((!)original.get_basename ())");diff --git a/libbirdfont/GlyphCanvas.vala b/libbirdfont/GlyphCanvas.valaindex 3c02d35..a2cded1 100644--- a/libbirdfont/GlyphCanvas.vala+++ b/libbirdfont/GlyphCanvas.vala@@ -18,7 +18,7 @@ using Cairo;
 using Math;
 
-namespace Supplement {
+namespace BirdFont {
 
 public class GlyphCanvas : GLib.Object {
 
@@ -41,8 +41,8 @@ public class GlyphCanvas : GLib.Object { 		if (fd is Glyph) {
 			Glyph g = (Glyph) fd;
 			
-			Supplement.current_glyph = g;
-			Supplement.current_glyph.resized ();
+			BirdFont.current_glyph = g;
+			BirdFont.current_glyph.resized ();
 
 			g.allocation = allocation;
 			
@@ -65,7 +65,7 @@ public class GlyphCanvas : GLib.Object { 	}
 	
 	public static Glyph get_current_glyph ()  {
-		return Supplement.current_glyph;
+		return BirdFont.current_glyph;
 	}
 	
 	public FontDisplay get_current_display () {
diff --git a/libbirdfont/GlyphCollection.vala b/libbirdfont/GlyphCollection.valaindex c5d2d0b..47dfd10 100644--- a/libbirdfont/GlyphCollection.vala+++ b/libbirdfont/GlyphCollection.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public class GlyphCollection : GLib.Object { 	VersionList versions;diff --git a/libbirdfont/GlyphRange.vala b/libbirdfont/GlyphRange.valaindex f1c35b3..a4cc2c7 100644--- a/libbirdfont/GlyphRange.vala+++ b/libbirdfont/GlyphRange.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public class GlyphRange { 	diff --git a/libbirdfont/GlyphTable.vala b/libbirdfont/GlyphTable.valaindex 24d8bb4..4da935c 100644--- a/libbirdfont/GlyphTable.vala+++ b/libbirdfont/GlyphTable.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  /** A sorted table of glyphs with search index. */ class GlyphTable : GLib.Object {diff --git a/libbirdfont/GridTool.vala b/libbirdfont/GridTool.valaindex 27731e2..0b24c14 100644--- a/libbirdfont/GridTool.vala+++ b/libbirdfont/GridTool.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  class GridTool : Tool { 	diff --git a/libbirdfont/Icons.vala b/libbirdfont/Icons.valaindex 3dc19f3..4f95d71 100644--- a/libbirdfont/Icons.vala+++ b/libbirdfont/Icons.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  using Cairo;	 diff --git a/libbirdfont/ImportSvg.vala b/libbirdfont/ImportSvg.valaindex 179b6ed..02bf355 100644--- a/libbirdfont/ImportSvg.vala+++ b/libbirdfont/ImportSvg.vala@@ -16,7 +16,7 @@ */ using Xml; -namespace Supplement {+namespace BirdFont { 	 public class ImportSvg { 	public ImportSvg () {@@ -36,7 +36,7 @@ public class ImportSvg { 	} 	 	public static void import_svg_data (string xml_data) {-		if (Supplement.win32) {+		if (BirdFont.win32) { 			string svg; 			string xml; 			Glyph glyph = MainWindow.get_current_glyph ();@@ -68,7 +68,7 @@ public class ImportSvg { 	public static void import_svg (string path) { 		// FIXME: libxml2 (2.7.8) refuses to parse svg files created with Adobe Illustrator on  		// windows. This is a way around it.-		if (Supplement.win32) {+		if (BirdFont.win32) { 			try { 				File f = File.new_for_path (path); 				DataInputStream dis = new DataInputStream (f.read ());@@ -214,7 +214,7 @@ public class ImportSvg { 		double[] p; 		int pi = 0; 		string data = add_separators (d);-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font ();  		c = data.split (" "); 		p = new double[2 * c.length];diff --git a/libbirdfont/Intersection.vala b/libbirdfont/Intersection.valaindex c3e3533..6519c70 100644--- a/libbirdfont/Intersection.vala+++ b/libbirdfont/Intersection.vala@@ -17,7 +17,7 @@  using Math; -namespace Supplement {+namespace BirdFont {  class Intersection { 	public double x;diff --git a/libbirdfont/IntersectionList.vala b/libbirdfont/IntersectionList.valaindex 19eaed7..4cc3c82 100644--- a/libbirdfont/IntersectionList.vala+++ b/libbirdfont/IntersectionList.vala@@ -17,7 +17,7 @@  using Math; -namespace Supplement {+namespace BirdFont {  class IntersectionList { 	public List<Intersection> points = new List<Intersection> ();diff --git a/libbirdfont/Kerning.vala b/libbirdfont/Kerning.valaindex 537e57f..39d554e 100644--- a/libbirdfont/Kerning.vala+++ b/libbirdfont/Kerning.vala@@ -18,7 +18,7 @@ using Cairo; using Xml; -namespace Supplement {+namespace BirdFont {  public class Kerning : GLib.Object { 	public string glyph_right;diff --git a/libbirdfont/KeyBindings.vala b/libbirdfont/KeyBindings.valaindex b253c7b..236999f 100644--- a/libbirdfont/KeyBindings.vala+++ b/libbirdfont/KeyBindings.vala@@ -17,7 +17,7 @@  using Gdk; -namespace Supplement {+namespace BirdFont {  // FIXME a lot of these things have been replaced and can safely be removed @@ -247,7 +247,7 @@ public class KeyBindings { 	 	void save () { 		try {-			File settings = Supplement.get_settings_directory ();+			File settings = BirdFont.get_settings_directory (); 			File bindings = settings.get_child ("keybindings"); 			 			if (bindings.query_exists ()) {@@ -260,7 +260,7 @@ public class KeyBindings { 			 			StringBuilder sb = new StringBuilder (); 			-			sb.append_printf ("# Supplement keybindings\n");+			sb.append_printf ("# BirdFont keybindings\n"); 			sb.append_printf ("# Version: 1.0\n"); 			 			short_cuts.foreach ( (k, v) => {diff --git a/libbirdfont/Line.vala b/libbirdfont/Line.valaindex 1e8406a..9ca7682 100644--- a/libbirdfont/Line.vala+++ b/libbirdfont/Line.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  /** Help line */ public class Line : GLib.Object {@@ -161,7 +161,7 @@ public class Line : GLib.Object {  			position_updated (pos); // sinal update -			Supplement.get_current_font ().touch ();+			BirdFont.get_current_font ().touch (); 			 			swap_lines (); 		}diff --git a/libbirdfont/MainWindow.vala b/libbirdfont/MainWindow.valaindex b7c7afe..09a51f4 100644--- a/libbirdfont/MainWindow.vala+++ b/libbirdfont/MainWindow.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-namespace Supplement {
+namespace BirdFont {
 
 public class MainWindow {
 	
@@ -54,12 +54,12 @@ public class MainWindow { 	}
 	
 	public static Glyph get_current_glyph () {
-		if (unlikely (is_null (Supplement.current_glyph))) {
+		if (unlikely (is_null (BirdFont.current_glyph))) {
 			warning ("No default glyph have been set yet.\n");
 			return new Glyph ("no_glyph_created");
 		}
 		
-		return Supplement.current_glyph;
+		return BirdFont.current_glyph;
 	}
 	
 	public static Toolbox get_toolbox () {
diff --git a/libbirdfont/MenuAction.vala b/libbirdfont/MenuAction.valaindex d44e7c4..866478b 100644--- a/libbirdfont/MenuAction.vala+++ b/libbirdfont/MenuAction.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class MenuAction : GLib.Object { 	public string label;diff --git a/libbirdfont/MenuTab.vala b/libbirdfont/MenuTab.valaindex ea454ee..952a34a 100644--- a/libbirdfont/MenuTab.vala+++ b/libbirdfont/MenuTab.vala@@ -17,7 +17,7 @@  using WebKit; -namespace Supplement {+namespace BirdFont {  public class MenuTab : FontDisplay {	 	@@ -26,7 +26,7 @@ public class MenuTab : FontDisplay { 	public MenuTab () { 		// html callbacks: 		add_html_callback ("export_name", (val) => {-			Font f = Supplement.get_current_font ();+			Font f = BirdFont.get_current_font (); 			f.set_name (val); 			f.touch (); 		});@@ -65,7 +65,7 @@ public class MenuTab : FontDisplay { 	}  	public override string get_html () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		StringBuilder c = new StringBuilder (); 		string fn; 		@@ -125,7 +125,7 @@ if (has_backup ()) { 		c.append ("</div>");  		c.append ("<img src=\"");-		c.append (path_to_uri ((!) Supplement.get_thumbnail_directory ().get_path ()));+		c.append (path_to_uri ((!) BirdFont.get_thumbnail_directory ().get_path ())); 		c.append ("/"); 		c.append (fn); 		c.append (@".png?$(Random.next_int ())\" alt=\"\">");@@ -158,7 +158,7 @@ foreach (Font font in recent_fonts) { 	c.append ("</div>");  	c.append ("<img src=\"");-	c.append (path_to_uri ((!) Supplement.get_thumbnail_directory ().get_path ()));+	c.append (path_to_uri ((!) BirdFont.get_thumbnail_directory ().get_path ())); 	c.append ("/"); 	c.append (fn); 	c.append (@".png?$(Random.next_int ())\" alt=\"\">");@@ -198,8 +198,8 @@ c.append (""" 		string file_name; 		FileInfo? file_info; 		List<string> backups = new List<string> ();-		File dir = Supplement.get_backup_directory ();-		Font font = Supplement.get_current_font ();+		File dir = BirdFont.get_backup_directory ();+		Font font = BirdFont.get_current_font ();  		try { 			enumerator = dir.enumerate_children (FileAttribute.STANDARD_NAME, 0);@@ -250,20 +250,20 @@ c.append (""" 	} 	 	public void load_backup (string file_name) {-		File backup_file = Supplement.get_backup_directory ();+		File backup_file = BirdFont.get_backup_directory (); 		backup_file = backup_file.get_child (file_name); 		load_font ((!) backup_file.get_path ()); 	} 	 	public void load_font (string fn) {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 			 		SaveDialog save = new SaveDialog (); 		save.finished.connect (() => { 			Font f; 			bool loaded; 			-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			f.delete_backup (); 			 			MainWindow.clear_glyph_cache ();@@ -296,7 +296,7 @@ c.append (""" 	} 	 	private static void select_overview () {-		if (Supplement.get_current_font ().is_empty ()) {+		if (BirdFont.get_current_font ().is_empty ()) { 			Toolbox.select_tool_by_name ("custom_character_set"); 		} else { 			Toolbox.select_tool_by_name ("available_characters");	@@ -307,7 +307,7 @@ c.append (""" 		string? fn = null; 		string f; 		bool saved = false;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		 		fn = MainWindow.file_chooser_save (_("Save")); 		@@ -327,7 +327,7 @@ c.append (""" 	}  	public static bool save () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		string fn; 		bool saved = false; @@ -356,10 +356,10 @@ c.append (""" 	} 	 	public static void new_file () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		SaveDialog save = new SaveDialog (); 		save.finished.connect (() => {-			Supplement.new_font ();+			BirdFont.new_font (); 			MainWindow.close_all_tabs (); 			 			MainWindow.get_toolbox ().remove_all_grid_buttons ();@@ -378,7 +378,7 @@ c.append (""" 	 	public static void load () { 		SaveDialog save = new SaveDialog ();-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font ();  		save.finished.connect (() => { 			load_new_font ();@@ -393,7 +393,7 @@ c.append ("""  	private static void load_new_font () { 		string? fn = MainWindow.file_chooser_open (_("Open"));-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		 		if (fn != null) { 			f.delete_backup ();@@ -413,7 +413,7 @@ c.append (""" 	 	public static void preview () { 		TabBar tab_bar = MainWindow.get_tab_bar ();-		FontFormat format = Supplement.get_current_font ().format;+		FontFormat format = BirdFont.get_current_font ().format; 		OverwriteDialog overwrite = new OverwriteDialog ();  		overwrite.finished.connect (() => {diff --git a/libbirdfont/MergeTool.vala b/libbirdfont/MergeTool.valaindex 4fd2642..9646b5d 100644--- a/libbirdfont/MergeTool.vala+++ b/libbirdfont/MergeTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class MergeTool : Tool { diff --git a/libbirdfont/MoveTool.vala b/libbirdfont/MoveTool.valaindex 03c57bc..55d19af 100644--- a/libbirdfont/MoveTool.vala+++ b/libbirdfont/MoveTool.vala@@ -18,7 +18,7 @@ using Math; using Cairo; -namespace Supplement {+namespace BirdFont {  class MoveTool : Tool { diff --git a/libbirdfont/NativeWindow.vala b/libbirdfont/NativeWindow.valaindex 879901d..af0d1b2 100644--- a/libbirdfont/NativeWindow.vala+++ b/libbirdfont/NativeWindow.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public interface NativeWindow : GLib.Object { 	public abstract string? file_chooser_save (string title);diff --git a/libbirdfont/OpenFontFormatReader.vala b/libbirdfont/OpenFontFormatReader.valaindex 1c21de9..1fb1fb9 100644--- a/libbirdfont/OpenFontFormatReader.vala+++ b/libbirdfont/OpenFontFormatReader.vala@@ -18,7 +18,7 @@ [CCode (cname = "load_svg_font")] public extern static string? load_svg_font (string file, out bool error); -namespace Supplement {+namespace BirdFont {  [SimpleType] [CCode (has_type_id = false)] // Vala bug@@ -105,7 +105,7 @@ class OpenFontFormatReader : Object { 		Font f = OpenFontFormatWriter.font; 		 		if (is_null (f)) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 		} 		 		f.top_position = -get_ascender ();diff --git a/libbirdfont/OpenFontFormatWriter.vala b/libbirdfont/OpenFontFormatWriter.valaindex af8a32e..f4c3267 100644--- a/libbirdfont/OpenFontFormatWriter.vala+++ b/libbirdfont/OpenFontFormatWriter.vala@@ -17,7 +17,7 @@ 
 using Math;
 
-namespace Supplement {
+namespace BirdFont {
 
 const double UNITS = 10;
 
diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex 73379fc..dd61424 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  /** A display with all glyphs present in this font. */ public class OverView : FontDisplay {@@ -68,7 +68,7 @@ public class OverView : FontDisplay { 			Toolbox tools = MainWindow.get_toolbox (); 			bool selected = tabs.select_char (s); 			unichar new_char = s.get_char (0);-			Font f = Supplement.get_current_font ();+			Font f = BirdFont.get_current_font (); 							 			if (!selected) { 				GlyphCollection? fg = f.get_glyph_collection (s);@@ -112,7 +112,7 @@ public class OverView : FontDisplay { 		Font f; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			scroll_to_position (f.length () - items_per_row * (rows - 1)); 		} else { 			scroll_to_position (glyph_range.length () - items_per_row * (rows - 1));@@ -128,7 +128,7 @@ public class OverView : FontDisplay { 		} 				 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			l = f.length (); 		} else { 			l = glyph_range.length ();@@ -294,7 +294,7 @@ public class OverView : FontDisplay { 		double left_margin, x, caption_y; // for glyph caption 		uint64 index = index_begin; 		int i = row * items_per_row;-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		 		cr.save (); 		cr.set_line_width (1);@@ -356,7 +356,7 @@ public class OverView : FontDisplay { 	} 		 	private void draw_menu (Context cr, string name, double x, double y) {-		GlyphCollection? gl = Supplement.get_current_font ().get_glyph_collection (name);+		GlyphCollection? gl = BirdFont.get_current_font ().get_glyph_collection (name); 		GlyphCollection g; 		DropMenu menu; 		@@ -375,7 +375,7 @@ public class OverView : FontDisplay { 	} 		 	private bool draw_thumbnail (Context cr, string name, double x, double y) {-		Glyph? gl = Supplement.get_current_font ().get_glyph (name);+		Glyph? gl = BirdFont.get_current_font ().get_glyph (name); 		Glyph g; 		 		double gx, gy;@@ -419,7 +419,7 @@ public class OverView : FontDisplay { 		uint64 t; 		int i; 		int n_items;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 					 		while (visible_characters.length () > 9) { 			visible_characters.remove_link (visible_characters.first ());@@ -437,7 +437,7 @@ public class OverView : FontDisplay { 			draw_empty_canvas (allocation, cr); 		} 		-		if (Supplement.experimental) {+		if (BirdFont.experimental) { 			scrollbar.draw (cr, allocation); 		} 		@@ -502,7 +502,7 @@ public class OverView : FontDisplay { 		Font f; 				 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			l = f.length (); 		} else { 			l = glyph_range.length ();@@ -529,7 +529,7 @@ public class OverView : FontDisplay { 		Font f; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			l = f.length (); 		} else { 			l = glyph_range.length ();@@ -559,7 +559,7 @@ public class OverView : FontDisplay { 		Font f; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			l = f.length (); 		} else { 			l = glyph_range.length ();@@ -628,7 +628,7 @@ public class OverView : FontDisplay { 		Font f; 				 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			l = f.length (); 		} else { 			l = glyph_range.length ();@@ -709,7 +709,7 @@ public class OverView : FontDisplay { 		Font f; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			len = f.length (); 		} else { 			len = glyph_range.length ();@@ -744,7 +744,7 @@ public class OverView : FontDisplay { 		Glyph? g; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			g = f.get_glyph_indice (selected); 			return_val_if_fail (g != null, "".dup ()); 			return ((!) g).get_name ();@@ -808,7 +808,7 @@ public class OverView : FontDisplay { 		 	public void delete_glyph (string g) { 		GlyphCollection? gc;-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		 		gc = f.get_glyph_collection (g); @@ -823,7 +823,7 @@ public class OverView : FontDisplay { 	} 	 	public override void undo () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		 		if (deleted_glyphs.length () == 0) { 			return;@@ -881,7 +881,7 @@ public class OverView : FontDisplay { 		redraw_area (0, 0, allocation.width, allocation.height);  		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			len = f.length (); 		} else { 			len = glyph_range.length ();@@ -950,7 +950,7 @@ public class OverView : FontDisplay { 	 	public override void button_press (uint button, double x, double y) { 		if (x > allocation.width - 10) {-			if (Supplement.experimental) {+			if (BirdFont.experimental) { 				scrollbar.button_press (button, x, y); 			} 		} else {@@ -964,7 +964,7 @@ public class OverView : FontDisplay { 		double t = rows * items_per_row + items_per_row + first_visible; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			return t >= f.length (); 		} 		@@ -1057,7 +1057,7 @@ public class OverView : FontDisplay { 		Font f; 		 		if (all_avail) {-			f = Supplement.get_current_font ();+			f = BirdFont.get_current_font (); 			len = f.length (); 		} else { 			len = glyph_range.get_length ();diff --git a/libbirdfont/OverwriteDialog.vala b/libbirdfont/OverwriteDialog.valaindex 45628b7..6932fcb 100644--- a/libbirdfont/OverwriteDialog.vala+++ b/libbirdfont/OverwriteDialog.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class OverwriteDialog : FontDisplay { diff --git a/libbirdfont/Path.vala b/libbirdfont/Path.valaindex ebd47a6..4244e23 100644--- a/libbirdfont/Path.vala+++ b/libbirdfont/Path.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public enum Direction { 	CLOCKWISE,diff --git a/libbirdfont/PenTool.vala b/libbirdfont/PenTool.valaindex 7a2752a..e957c64 100644--- a/libbirdfont/PenTool.vala+++ b/libbirdfont/PenTool.vala@@ -18,7 +18,7 @@ using Math; using Cairo; -namespace Supplement {+namespace BirdFont {  public class PenTool : Tool { @@ -55,7 +55,7 @@ public class PenTool : Tool { 	public PenTool (string name) { 		string click_to_add_points; 		-		if (Supplement.mac) {+		if (BirdFont.mac) { 			click_to_add_points = _("Use left command key (⌘) + click to add new points"); 		} else { 			click_to_add_points = _("Right click to add new points, left click to move points");diff --git a/libbirdfont/Preferences.vala b/libbirdfont/Preferences.valaindex 76ae8e2..ab38b73 100644--- a/libbirdfont/Preferences.vala+++ b/libbirdfont/Preferences.vala@@ -14,7 +14,7 @@     You should have received a copy of the GNU General Public License     along with this program.  If not, see <http://www.gnu.org/licenses/>. */-namespace Supplement {+namespace BirdFont {  public class Preferences { 		@@ -84,7 +84,7 @@ public class Preferences { 	} 	 	public static void load () {-		File app_dir = Supplement.get_settings_directory ();+		File app_dir = BirdFont.get_settings_directory (); 		File settings = app_dir.get_child ("settings");  		data = new HashTable<string, string> (str_hash, str_equal);@@ -135,7 +135,7 @@ public class Preferences { 	 	public static void save () { 		try {-			File app_dir = Supplement.get_settings_directory ();+			File app_dir = BirdFont.get_settings_directory (); 			File settings = app_dir.get_child ("settings");  			return_if_fail (app_dir.query_exists ());@@ -150,7 +150,7 @@ public class Preferences { 			 			StringBuilder sb = new StringBuilder (); 			-			sb.append ("# Supplement settings\n");+			sb.append ("# BirdFont settings\n"); 			sb.append ("# Version: 1.0\n"); 			 			foreach (var k in data.get_keys ()) {diff --git a/libbirdfont/Preview.vala b/libbirdfont/Preview.valaindex 7217b98..548d40a 100644--- a/libbirdfont/Preview.vala+++ b/libbirdfont/Preview.vala@@ -17,7 +17,7 @@  using WebKit; -namespace Supplement {+namespace BirdFont {  public class Preview : FontDisplay {	 	@@ -36,7 +36,7 @@ public class Preview : FontDisplay { 	}  	public new File get_html_file () {-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		string path = @"$(font.get_name ()).html"; 		File dir = font.get_folder (); 		File file = dir.get_child (path);diff --git a/libbirdfont/SaveDialog.vala b/libbirdfont/SaveDialog.valaindex ea13f26..486c9da 100644--- a/libbirdfont/SaveDialog.vala+++ b/libbirdfont/SaveDialog.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class SaveDialog : FontDisplay { @@ -58,7 +58,7 @@ public class SaveDialog : FontDisplay { 	}  	public override string get_html () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		string fn = f.get_file_name (); 		 		if (fn == "") {diff --git a/libbirdfont/Scrollbar.vala b/libbirdfont/Scrollbar.valaindex 8ddd580..ac6a204 100644--- a/libbirdfont/Scrollbar.vala+++ b/libbirdfont/Scrollbar.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  class Scrollbar : GLib.Object { 	Allocation alloc;diff --git a/libbirdfont/SpinButton.vala b/libbirdfont/SpinButton.valaindex 2538c6f..f7cdac0 100644--- a/libbirdfont/SpinButton.vala+++ b/libbirdfont/SpinButton.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class SpinButton : Tool { diff --git a/libbirdfont/Supplement.vala b/libbirdfont/Supplement.valadeleted file mode 100644index c5bc186..0000000--- a/libbirdfont/Supplement.vala+++ /dev/null@@ -1,235 +0,0 @@-/*
-    Copyright (C) 2012 Johan Mattsson
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-using Supplement;
-using Birdfont;
-
-const string GETTEXT_PACKAGE = "birdfont"; 
-
-namespace Supplement {
-
-public class Supplement {
-	public static Argument args;
-	public static bool experimental = false;
-	internal static bool show_coordinates = false;
-	internal static bool fatal_wanings = false;
-	public static bool win32 = false;
-	public static bool mac = false;-	internal static string exec_path = "";
-
-	internal static Font current_font;
-	public static Glyph current_glyph;
-	
-	public void init (string[] arg) {
-		int err_arg;
-		int i;
-		File font_file;
-		string exec_path;
-
-		stdout.printf ("birdfont version %s\n", VERSION);
-		stdout.printf ("built on %s\n", BUILD_TIMESTAMP);
-
-		init_gettext ();		
-		
-		args = new Argument.command_line (arg);
-
-		if (args.has_argument ("--help")) {
-			args.print_help ();
-			Process.exit (0);
-		}
-
-		err_arg = args.validate ();
-		if (err_arg != 0) {
-			stdout.printf (@"Unknown parameter $(arg [err_arg])\n\n");
-			args.print_help ();
-			Process.exit (0);
-		}
-
-		Preferences.load ();
-		
-		current_font = new Font ();
-		current_font.set_name ("");
-		current_font.initialised = false;
-		current_glyph = new Glyph ("");
-
-		experimental = args.has_argument ("--test");
-		show_coordinates = args.has_argument ("--show-coordinates");
-		fatal_wanings = args.has_argument ("--fatal-warning");
-		win32 = (arg[0].index_of (".exe") > -1) || arg[0] == "wine";
-
-#if MAC
-		mac = true;
-#else
-		mac = args.has_argument ("--mac");
-#endif
-		
-		exec_path = "";
-
-		if (win32) {
-			// wine hack to get "." folder in win32 environment
-			i = arg[0].last_index_of ("\\");
-			
-			if (i != -1) {	
-				exec_path = arg[0];
-				exec_path = exec_path.substring (0, i);
-				exec_path = wine_to_unix_path (exec_path);			
-			}
-		} else {
-			exec_path = "./";
-		}
-
-		if (args.get_file () != "") {
-			font_file = File.new_for_path (args.get_file ());
-			
-			if (!font_file.query_exists ()) {
-				stderr.printf (@"File $(args.get_file ()) not found.");
-				Process.exit (-1);
-			}
-		}
-
-		if (fatal_wanings) {
-			LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING;
-			Log.set_handler (null, levels, fatal_warning);
-		}
-		
-		Preferences.set_last_file (get_current_font ().get_path ());
-	}
-
-	static void init_gettext () {
-		File f;
-
-		Intl.setlocale (LocaleCategory.MESSAGES, "");
-		Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "utf-8");
-
-		f = File.new_for_path ("./build/locale/sv/LC_MESSAGES/birdfont.mo");
-		if (f.query_exists ()) {
-			Intl.bindtextdomain (GETTEXT_PACKAGE, "./build/locale");
-			return;
-		}
-
-		f = File.new_for_path (".\\locale\\sv\\LC_MESSAGES\\birdfont.mo");
-		if (f.query_exists ()) {
-			Intl.bindtextdomain (GETTEXT_PACKAGE, ".\\locale");
-			return;
-		}
-
-		f = File.new_for_path (PREFIX + "/share/locale/sv/LC_MESSAGES/birdfont.mo");
-		if (f.query_exists ()) {
-			Intl.bindtextdomain (GETTEXT_PACKAGE, PREFIX + "/share/locale");
-			return;
-		}
-						
-		f = File.new_for_path ("/usr/local/share/locale/sv/LC_MESSAGES/birdfont.mo");
-		if (f.query_exists ()) {
-			Intl.bindtextdomain (GETTEXT_PACKAGE, "/usr/local/share/locale");
-			return;
-		}		
-
-		f = File.new_for_path ("/usr/share/locale/sv/LC_MESSAGES/birdfont.mo");
-		if (f.query_exists ()) {
-			Intl.bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");
-			return;
-		}
-		
-		warning ("translations not found");
-	}
-	
-	public static Font get_current_font () {
-		return current_font;
-	}
-
-	internal static void fatal_warning (string? log_domain, LogLevelFlags log_levels, string message) {		
-		bool fatal = true;
-		
-		if (log_domain != null) {
-			stderr.printf ("%s: \n", (!) log_domain);
-		}
-		
-		stderr.printf ("\n%s\n\n", message);
-		assert (!fatal);
-	}
-	
-	internal static void new_font () {
-		current_font = new Font ();
-	}
-
-	public static File get_preview_directory () {
-		File settings = get_settings_directory ();
-		File backup = settings.get_child ("preview");
-		
-		if (!backup.query_exists ()) {
-			DirUtils.create ((!) backup.get_path (), 0xFFFFFF);
-		}
-			
-		return backup;
-	}
-
-	internal static File get_thumbnail_directory () {
-		File thumbnails = get_settings_directory ().get_child ("thumbnails");
-		
-		if (!thumbnails.query_exists ()) {
-			DirUtils.create ((!) thumbnails.get_path (), 0xFFFFFF);
-		}
-		
-		return thumbnails;
-	}
-		
-	internal static File get_settings_directory () {
-		File home = File.new_for_path (Environment.get_home_dir ());
-		File settings = home.get_child (".birdfont");
-		
-		if (!settings.query_exists ()) {
-			DirUtils.create ((!) settings.get_path (), 0xFFFFFF);
-		}
-			
-		return settings;
-	}
-
-	internal static File get_backup_directory () {
-		File settings = get_settings_directory ();
-		File backup = settings.get_child ("backup");
-		
-		if (!backup.query_exists ()) {
-			DirUtils.create ((!) backup.get_path (), 0xFFFFFF);
-		}
-			
-		return backup;
-	}
-
-	internal static bool has_argument (string param) {
-		if (is_null (args)) {
-			warning ("args is null");
-			return false;
-		}
-		
-		return args.has_argument (param);
-	}
-	
-	internal static string? get_argument (string param) {
-		return args.get_argument (param);
-	}	
-}
-
-public bool is_null (void* n) {
-	return n == null;
-}
-
-public bool has_flag (uint32 flag, uint32 mask) {
-	return (flag & mask) > 0;
-}
-
-}
diff --git a/libbirdfont/Svg.vala b/libbirdfont/Svg.valaindex ad84883..88a9950 100644--- a/libbirdfont/Svg.vala+++ b/libbirdfont/Svg.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  class Svg { @@ -89,8 +89,8 @@ class Svg {  	private static void add_abs_start (EditPoint ep, StringBuilder svg, Glyph g, bool to_glyph) {		 		double left = g.left_limit;-		double baseline = Supplement.get_current_font ().base_line;-		double height = Supplement.get_current_font ().get_height ();+		double baseline = BirdFont.get_current_font ().base_line;+		double height = BirdFont.get_current_font ().get_height (); 		 		svg.append_printf ("M"); @@ -108,14 +108,14 @@ class Svg { 	}	 	 	private static void add_abs_line_to (EditPoint start, EditPoint stop, StringBuilder svg, Glyph g, bool to_glyph) {-		double baseline = Supplement.get_current_font ().base_line;+		double baseline = BirdFont.get_current_font ().base_line; 		double left = g.left_limit; 		 		double xa, ya, xb, yb; 		 		Path.get_line_points (start, stop, out xa, out ya, out xb, out yb); -		double height = Supplement.get_current_font ().get_height (); // no probably not+		double height = BirdFont.get_current_font ().get_height (); // no probably not  		double center_x = Glyph.xc (); 		double center_y = Glyph.yc ();@@ -133,8 +133,8 @@ class Svg { 	 	private static void add_quadratic_abs_path (EditPoint start, EditPoint end, StringBuilder svg, Glyph g,  bool to_glyph) { 		double left = g.left_limit;-		double baseline = Supplement.get_current_font ().base_line;-		double height = Supplement.get_current_font ().get_height (); // no probably not+		double baseline = BirdFont.get_current_font ().base_line;+		double height = BirdFont.get_current_font ().get_height (); // no probably not 		 		double xa, ya, xb, yb, xc, yc, xd, yd; 		@@ -168,8 +168,8 @@ class Svg { 			 	private static void add_cubic_abs_path (EditPoint start, EditPoint end, StringBuilder svg, Glyph g,  bool to_glyph) { 		double left = g.left_limit;-		double baseline = Supplement.get_current_font ().base_line;-		double height = Supplement.get_current_font ().get_height (); // no probably not+		double baseline = BirdFont.get_current_font ().base_line;+		double height = BirdFont.get_current_font ().get_height (); // no probably not 		 		double xa, ya, xb, yb, xc, yc, xd, yd; 		diff --git a/libbirdfont/SvgFont.vala b/libbirdfont/SvgFont.valaindex 6ba3ce9..82c06a6 100644--- a/libbirdfont/SvgFont.vala+++ b/libbirdfont/SvgFont.vala@@ -17,7 +17,7 @@  using Xml; -namespace Supplement {+namespace BirdFont {  class SvgFont : GLib.Object { 	Font font;diff --git a/libbirdfont/SvgFontFormatWriter.vala b/libbirdfont/SvgFontFormatWriter.valaindex 75d9292..1f708ac 100644--- a/libbirdfont/SvgFontFormatWriter.vala+++ b/libbirdfont/SvgFontFormatWriter.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class SvgFontFormatWriter : Object  { @@ -99,7 +99,7 @@ class SvgFontFormatWriter : Object  { 			 			foreach (Kerning k in glyph.kerning) { 				string l, r;-				Font f = Supplement.get_current_font ();+				Font f = BirdFont.get_current_font (); 				Glyph? gr = f.get_glyph (k.glyph_right); 				Glyph glyph_right; 				diff --git a/libbirdfont/Tab.vala b/libbirdfont/Tab.valaindex 4458543..6467598 100644--- a/libbirdfont/Tab.vala+++ b/libbirdfont/Tab.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  public class Tab : GLib.Object { diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex 4779f7c..d727ce1 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class TabBar : GLib.Object { 	diff --git a/libbirdfont/TestCases.vala b/libbirdfont/TestCases.valaindex 65bd7db..3e86500 100644--- a/libbirdfont/TestCases.vala+++ b/libbirdfont/TestCases.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  /** All the things we want to test listed is here. */ class TestCases {@@ -171,7 +171,7 @@ class TestCases { 			DataOutputStream d; 			FileOutputStream? os; 			-			temp_file = Supplement.get_settings_directory ().get_child ("illustrator_test.svg");+			temp_file = BirdFont.get_settings_directory ().get_child ("illustrator_test.svg"); 			 			if (temp_file.query_exists ()) { 				temp_file.delete ();@@ -260,7 +260,7 @@ class TestCases { 			DataOutputStream d; 			FileOutputStream? os; 			-			temp_file = Supplement.get_settings_directory ().get_child ("inkscape_test.svg");+			temp_file = BirdFont.get_settings_directory ().get_child ("inkscape_test.svg"); 			 			if (temp_file.query_exists ()) { 				temp_file.delete ();@@ -480,7 +480,7 @@ class TestCases { 	}  	public static void test_notdef () {-		Font f = Supplement.get_current_font ();+		Font f = BirdFont.get_current_font (); 		Glyph n = f.get_not_def_character (); 		Glyph g; 		Path pn;diff --git a/libbirdfont/TestSupplement.vala b/libbirdfont/TestSupplement.valaindex bdb230a..6380b9c 100644--- a/libbirdfont/TestSupplement.vala+++ b/libbirdfont/TestSupplement.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-namespace Supplement {
+namespace BirdFont {
 
 class Test : Object {
 	public Callback callback;
@@ -28,7 +28,7 @@ class Test : Object { }
 
 /** Class for executing tests cases. */
-class TestSupplement : GLib.Object {
+class TestBirdFont : GLib.Object {
 
 	const int NOT_STARTED = 0;
 	const int RUNNING = 1;
@@ -46,7 +46,7 @@ class TestSupplement : GLib.Object { 	unowned List<Test> failed;
 	unowned List<Test> skipped;
 
-	static TestSupplement? singleton = null;
+	static TestBirdFont? singleton = null;
 
 	bool has_failed = false;
 	bool has_skipped = false;
@@ -55,7 +55,7 @@ class TestSupplement : GLib.Object { 	
 	string test_cases_to_run; // name of specific test case or all to run all test cases
 	
-	public TestSupplement () {
+	public TestBirdFont () {
 		assert (singleton == null);
 		tests = new TestCases ();
 		test_cases = tests.get_test_functions ();
@@ -73,9 +73,9 @@ class TestSupplement : GLib.Object { 		slow_test = s;
 	}
 	
-	public static TestSupplement get_singleton () {
+	public static TestBirdFont get_singleton () {
 		if (singleton == null) {
-			singleton = new TestSupplement ();
+			singleton = new TestBirdFont ();
 		}
 		
 		return (!) singleton;
@@ -96,7 +96,7 @@ class TestSupplement : GLib.Object { 
 	/** Run only test specified on the command line. */
 	private void from_command_line () {
-		string? stn = Supplement.get_argument ("--test");
+		string? stn = BirdFont.get_argument ("--test");
 	
 		if (stn != null) {
 			string st = (!) stn;
@@ -135,7 +135,7 @@ class TestSupplement : GLib.Object { 		
 		get_singleton ().has_failed = true;
 		
-		assert (!Supplement.fatal_wanings);
+		assert (!BirdFont.fatal_wanings);
 	}
 
 	public static void @continue () {
@@ -144,7 +144,7 @@ class TestSupplement : GLib.Object { 			singleton = null;
 		}
 
-		TestSupplement t = get_singleton ();
+		TestBirdFont t = get_singleton ();
 		
 		LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING;
 		Log.set_handler (null, levels, log);
@@ -224,7 +224,7 @@ class TestSupplement : GLib.Object { 			if (has_failed) {
 				failed.append ((!) test);
 				
-				if (Supplement.has_argument ("--exit")) {
+				if (BirdFont.has_argument ("--exit")) {
 					print_result ();
 					Process.exit (1);
 				}
@@ -243,7 +243,7 @@ class TestSupplement : GLib.Object { 
 				print_result ();
 				
-				if (Supplement.has_argument ("--exit")) {
+				if (BirdFont.has_argument ("--exit")) {
 					print_result ();
 					Process.exit ((failed.length () == 0) ? 0 : 1);
 				}
diff --git a/libbirdfont/Tool.vala b/libbirdfont/Tool.valaindex b7c1448..21704d0 100644--- a/libbirdfont/Tool.vala+++ b/libbirdfont/Tool.vala@@ -17,7 +17,7 @@  using Cairo; -namespace Supplement {+namespace BirdFont {  public class Tool : GLib.Object { 	@@ -309,7 +309,7 @@ public class Tool : GLib.Object { 		var time = new TimeoutSource(500); 		bool timeout; -		if (TestSupplement.is_slow_test ()) {+		if (TestBirdFont.is_slow_test ()) { 			timeout = false; 			 			time.set_callback(() => {@@ -330,11 +330,11 @@ public class Tool : GLib.Object { 			return; 		} -		while (c.pending () || TestSupplement.is_slow_test ()) {+		while (c.pending () || TestBirdFont.is_slow_test ()) { 			c.iteration (true); 			t++; -			if (!c.pending () && TestSupplement.is_slow_test ()) {+			if (!c.pending () && TestBirdFont.is_slow_test ()) { 				if (timeout) break; 			} 						diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex c7e30ae..af902d8 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public class Toolbox : GLib.Object  { 	GlyphCanvas glyph_canvas;@@ -163,7 +163,7 @@ public class Toolbox : GLib.Object  { 				OverView o = MainWindow.get_overview (); 				GlyphRange gr = new GlyphRange (); 				-				if (!Supplement.get_current_font ().initialised) {+				if (!BirdFont.get_current_font ().initialised) { 					MenuTab.new_file (); 				} 				@@ -179,7 +179,7 @@ public class Toolbox : GLib.Object  { 			OverView o = MainWindow.get_overview (); 			GlyphRange gr = new GlyphRange (); -			if (!Supplement.get_current_font ().initialised) {+			if (!BirdFont.get_current_font ().initialised) { 				MenuTab.new_file (); 			} 			@@ -194,7 +194,7 @@ public class Toolbox : GLib.Object  { 			MainWindow.get_tab_bar ().add_unique_tab (new OverView (), 100, false); 			OverView o = MainWindow.get_overview (); 			-			if (!Supplement.get_current_font ().initialised) {+			if (!BirdFont.get_current_font ().initialised) { 				MenuTab.new_file (); 			} 			@@ -215,14 +215,14 @@ public class Toolbox : GLib.Object  { 		}); 		characterset_tools.add_tool (delete_glyph); -		if (Supplement.has_argument ("--test")) {+		if (BirdFont.has_argument ("--test")) { 			Tool test_case = new Tool ("test_case"); 			test_case.select_action.connect((self) => { 					if (self.is_selected ()) {-						if (TestSupplement.is_running ()) {-							TestSupplement.pause ();+						if (TestBirdFont.is_running ()) {+							TestBirdFont.pause (); 						} else {-							TestSupplement.continue ();+							TestBirdFont.continue (); 						} 					} 				});@@ -230,16 +230,16 @@ public class Toolbox : GLib.Object  {  			Tool slow_test = new Tool ("slow_test"); 			slow_test.select_action.connect((self) => {-					bool s = TestSupplement.is_slow_test ();-					TestSupplement.set_slow_test (!s);-					s = TestSupplement.is_slow_test ();+					bool s = TestBirdFont.is_slow_test ();+					TestBirdFont.set_slow_test (!s);+					s = TestBirdFont.is_slow_test (); 					self.set_selected (s); 				}); 		 			test_tools.add_tool (slow_test); 					 			// Run from commad line-			string? st = Supplement.get_argument ("--test");+			string? st = BirdFont.get_argument ("--test"); 			if (st != null && ((!)st).char_count () > 0) { 				IdleSource idle = new IdleSource (); @@ -251,7 +251,7 @@ public class Toolbox : GLib.Object  { 				idle.attach (null); 			} 			-			if (Supplement.has_argument ("--slow")) {+			if (BirdFont.has_argument ("--slow")) { 				select_tool (slow_test); 			} 			diff --git a/libbirdfont/TooltipArea.vala b/libbirdfont/TooltipArea.valaindex 6e380fd..7481155 100644--- a/libbirdfont/TooltipArea.vala+++ b/libbirdfont/TooltipArea.vala@@ -18,7 +18,7 @@ using Cairo; using Gdk; -namespace Supplement {+namespace BirdFont {  public class TooltipArea : GLib.Object { diff --git a/libbirdfont/UniRange.vala b/libbirdfont/UniRange.valaindex 2d55601..47f8320 100644--- a/libbirdfont/UniRange.vala+++ b/libbirdfont/UniRange.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont { 	 public class UniRange : GLib.Object { 	diff --git a/libbirdfont/VersionList.vala b/libbirdfont/VersionList.valaindex 6655a21..ea9c018 100644--- a/libbirdfont/VersionList.vala+++ b/libbirdfont/VersionList.vala@@ -18,7 +18,7 @@ using Cairo; using Math; -namespace Supplement {+namespace BirdFont {  public class VersionList : DropMenu { 	int versions = 1;@@ -34,7 +34,7 @@ public class VersionList : DropMenu { 			return_if_fail (self.parent != null); 			return_if_fail (glyphs.length () > 0); 			-			Supplement.get_current_font ().touch ();+			BirdFont.get_current_font ().touch (); 			 			add_new_version (); 			current_version = (int) glyphs.length () - 1;@@ -85,7 +85,7 @@ public class VersionList : DropMenu { 		Glyph glyph; 		Glyph updated_glyph; 		Glyph? ug;-		Font font = Supplement.get_current_font ();+		Font font = BirdFont.get_current_font (); 		StringBuilder uni = new StringBuilder (); 		 		if (is_null (MainWindow.get_tab_bar ())) {@@ -139,7 +139,7 @@ public class VersionList : DropMenu { 		ma.action = (self) => { 			Font font; 			-			font = Supplement.get_current_font ();+			font = BirdFont.get_current_font (); 			set_selected_item (self); 			font.touch (); 		};diff --git a/libbirdfont/ZoomTool.vala b/libbirdfont/ZoomTool.valaindex 55f0d8b..4f4cd1b 100644--- a/libbirdfont/ZoomTool.vala+++ b/libbirdfont/ZoomTool.vala@@ -15,7 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ -namespace Supplement {+namespace BirdFont {  class ZoomTool : Tool { 

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112