Clone in a terminal:
Commit 25c84a2
Johan Mattsson - 2013-09-11T16:46:11+00:00
25c84a2ee8868a7baeb138359818c8f53e4493d3johan.mattsson.m@gmail.com

Merge branch 'master' of gitorious.org:birdfont/birdfont

Changed files (16)

Diff

diff --git a/NEWS b/NEWSindex fce3dbd..a90ab8c 100644--- a/NEWS+++ b/NEWS@@ -1,3 +1,14 @@+birdfont (0.29) stable;++  * Groups of paths and control points+  * Speed optimizations+  * Bold and italic styles+  * Bug fixes+  * TTF units+  * Paste in place and paste at cursor++ -- Johan Mattsson <johan.mattsson.m@gmail.com>  Tue Sep 10 12:51:33 CEST 2013+ birdfont (0.28) stable;    * Kerning classesdiff --git a/README b/READMEindex 8e76d8d..bbf02a5 100644--- a/README+++ b/README@@ -39,6 +39,14 @@ doit sudo ./install.py
 
 
+The default prefix is /usr/local on Fedora should BirdFont be compiled with
+/usr as prefix.
+
+./configure --prefix=/usr
+./scripts/linux_build.py --prefix=/usr
+sudo ./install.py
+
+
 ---------------------
 Building Mac binaries
 ---------------------
@@ -55,9 +63,7 @@ Packages 
 Windows binaries are avalilable at http://birdfont.org
 
-A Ubuntu package is avalilable at https://launchpad.net
-You can apt-get install birdfont form Olivier Bertens or
-Dariusz Dumas repository.
+A Ubuntu packages are avalilable at https://launchpad.net
 
 A Machintosh binary image is available at http://birdfont.org and
 a GTK version for Mac can be installed with MacPorts.
diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex c98cfa7..0a4c15c 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -508,7 +508,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 				 		Gtk.MenuItem export_item = new Gtk.MenuItem.with_mnemonic (_("_Export")); 		file_menu.append (export_item);-		export_item.activate.connect (() => { ExportTool.export_all (); });+		export_item.activate.connect (() => { MenuTab.export_font (); }); 		export_item.add_accelerator ("activate", accel_group, 'E', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE);  		if (!BirdFont.mac) {@@ -829,7 +829,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		} 		 		if (file_chooser.run () == ResponseType.ACCEPT) {	-			MainWindow.get_glyph_canvas ().redraw ();+			GlyphCanvas.redraw (); 			fn = file_chooser.get_filename (); 		} diff --git a/birdfont/Main.vala b/birdfont/Main.valaindex 3f1a0ac..03fadb5 100644--- a/birdfont/Main.vala+++ b/birdfont/Main.vala@@ -32,7 +32,7 @@ public static int main (string[] arg) { 	CharDatabaseParser db = new CharDatabaseParser (); 	unowned Thread<int> db_thread; 	Mutex database_mutex = Mutex ();-	Cond main_loop_idle = new Cond ();+	Cond main_loop_idle = Cond (); 	bool in_idle = false;  	birdfont.init (arg, null);diff --git a/configure b/configureindex d7f6722..7152cb2 100755--- a/configure+++ b/configure@@ -54,7 +54,7 @@ def configure (): 	libs = [ 			'cairo',  			'gdk-pixbuf-2.0', -			'gee-0.8',+			'gee-1.0', 			'gio-2.0',  			'glib-2.0',  			'gtk+-2.0',diff --git a/dodo.py b/dodo.pyindex c48c4c2..d20e4ed 100644--- a/dodo.py+++ b/dodo.py@@ -45,7 +45,7 @@ LIBS = [     'cairo',     'gdk-pixbuf-2.0',     'webkit-1.0',-    'gee-0.8'+    'gee-1.0'     ]  def task_build ():diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex 13a15c0..a1bcf37 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -43,7 +43,8 @@ public static int run_export (string[] arg) { 		return -1; 	} 	-	init_logfile ();+	// FIXME: create a option for this and structure the log messages+	// init_logfile (); 	 	for (int i = 1; i < arg.length; i++) { @@ -104,10 +105,10 @@ public static int run_export (string[] arg) { 	BirdFont.current_glyph = new Glyph (""); 	 	if (!BirdFont.get_current_font ().load (file_name, false)) {-		stderr.printf (@"Failed to load font $file_name.\n");+		warning (@"Failed to load font $file_name.\n"); 		 		if (!file_name.has_suffix (".bf")) {-			stderr.printf (@"Is it a .bf file?\n");+			warning (@"Is it a .bf file?\n"); 		} 		 		return 1;diff --git a/libbirdfont/ExportTool.vala b/libbirdfont/ExportTool.valaindex 060818c..48cddfb 100644--- a/libbirdfont/ExportTool.vala+++ b/libbirdfont/ExportTool.vala@@ -154,13 +154,12 @@ public class ExportTool : GLib.Object { 		} 	} -	public static void export_all () {+	/** Font must be saves before export. */+	internal static void export_all () { 		Font font = BirdFont.get_current_font (); 		 		if (font.font_file == null) {-			if (MenuTab.save ()) {-				do_export ();-			}+			warning ("Font is not saved."); 		} else { 			do_export (); 		}@@ -470,7 +469,13 @@ os.put_string ( 		try { 			// create a copy of current font and use it in a separate  			// export thread-			temp_file = current_font.save_backup ();+			+			if (async) {+				temp_file = current_font.save_backup ();+			} else {+				temp_file = current_font.get_path (); +			}+			 			ttf_file = folder.get_child (current_font.get_full_name () + ".ttf"); 			eot_file = folder.get_child (current_font.get_full_name () + ".eot"); @@ -486,7 +491,7 @@ os.put_string ( 			assert (!is_null (ttf_file.get_path ())); 			assert (!is_null (eot_file.get_path ())); -			export_thread = new ExportThread (temp_file, (!) ttf_file.get_path (), (!) eot_file.get_path ());+			export_thread = new ExportThread (temp_file, (!) ttf_file.get_path (), (!) eot_file.get_path (), async);  			if (async) { 				spawn_export (folder, temp_file);@@ -556,11 +561,13 @@ os.put_string ( 		private static string ffi; 		private static string ttf; 		private static string eot;+		private bool async = false; -		public ExportThread (string nffi, string nttf, string neot) {+		public ExportThread (string nffi, string nttf, string neot, bool async) { 			ffi = nffi.dup (); 			ttf = nttf.dup (); 			eot = neot.dup ();+			this.async = async; 		} 		 		public void* run () {@@ -576,18 +583,24 @@ os.put_string ( 		 		void write_ttf () { 			OpenFontFormatWriter fo = new OpenFontFormatWriter ();-			Font f = new Font ();+			Font f; 			File file = (!) File.new_for_path (ttf);  			return_if_fail (!is_null (ffi));			 			return_if_fail (!is_null (ttf)); 			return_if_fail (!is_null (file));-			return_if_fail (!is_null (f)); 			return_if_fail (!is_null (fo)); 			 			try {-				if (!f.load (ffi, false)) {-					warning (@"Can't read $ffi");+				if (async) {+					printd ("Loading the intermediate file.\n");+					f = new Font ();+					if (!f.load (ffi, false)) {+						warning (@"Can't read $ffi");+					}+				} else {+					f = BirdFont.get_current_font ();+					printd ("File is already loaded.\n"); 				} 				 				fo.open (file);diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex 7d2be8b..4657c8d 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -487,8 +487,13 @@ public class Font : GLib.Object { 		temp_file = dir.get_child (@"$(name).bf"); 		backup_file = (!) ((!) temp_file).get_path (); 		backup_file = backup_file.replace (" ", "_");-		birdfont_file.write_font_file (backup_file, true); 		+		if (get_path () == backup_file) {+			warning ("Refusing to write backup of a backup.");+			return backup_file;+		}+		+		birdfont_file.write_font_file (backup_file, true); 		return backup_file; 	} 	diff --git a/libbirdfont/MainWindow.vala b/libbirdfont/MainWindow.valaindex 7538cab..6a78791 100644--- a/libbirdfont/MainWindow.vala+++ b/libbirdfont/MainWindow.vala@@ -178,14 +178,7 @@ public class MainWindow { 	}
 		
 	public static void close_all_tabs () {
-		uint i = 0;
-		uint len = get_tab_bar ().get_length ();
-		
-		while (i < len) {
-			if (!get_tab_bar ().close_tab ((int) i)) {
-				i++;
-			}
-		}
+		get_tab_bar ().close_all_tabs ();
 	}
 
 	public static string translate (string s) {
diff --git a/libbirdfont/MenuTab.vala b/libbirdfont/MenuTab.valaindex d8d07eb..f586bbd 100644--- a/libbirdfont/MenuTab.vala+++ b/libbirdfont/MenuTab.vala@@ -22,6 +22,17 @@ public class MenuTab : FontDisplay { 	public MenuTab () { 	} 	+	public static void export_font ()  {+		Font font = BirdFont.get_current_font ();		+		if (font.font_file == null) {+			if (MenuTab.save ()) {+				ExportTool.export_all ();+			}+		} else {+			ExportTool.export_all ();+		}+	}+	 	public static void set_suppress_event (bool e) { 		suppress_event = e; 	}@@ -232,7 +243,18 @@ public class MenuTab : FontDisplay { 		MainWindow.get_tab_bar ().add_unique_tab (kd, 85, false); 	} 	-	public static void preview () {+	public static void preview ()  {+		Font font = BirdFont.get_current_font ();		+		if (font.font_file == null) {+			if (MenuTab.save ()) {+				show_preview_tab ();+			}+		} else {+			show_preview_tab ();+		}+	}+	+	public static void show_preview_tab () { 		OverWriteDialogListener dialog = new OverWriteDialogListener (); 		TabBar tab_bar = MainWindow.get_tab_bar (); 		FontFormat format = BirdFont.get_current_font ().format;diff --git a/libbirdfont/OpenFontFormat/Os2Table.vala b/libbirdfont/OpenFontFormat/Os2Table.valaindex f4dffcd..ab7e91a 100644--- a/libbirdfont/OpenFontFormat/Os2Table.vala+++ b/libbirdfont/OpenFontFormat/Os2Table.vala@@ -60,7 +60,7 @@ class Os2Table : Table { 		fd.add_16 (40); // ySuperscriptYOffset 		fd.add_16 (40); // yStrikeoutSize 		fd.add_16 (200); // yStrikeoutPosition-		fd.add_16 (40); // sFamilyClass+		fd.add_16 (0); // sFamilyClass  		// FIXME: PANOSE 		fd.add (0); diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex 2299d6d..19a66d7 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -658,6 +658,11 @@ public class OverView : FontDisplay { 		 		index = -1; 		+		if (items_per_row <= 0) {+			warning ("No items.");+			return;+		}+		 		if (is_modifier_key (c)) { 			return; 		}@@ -672,6 +677,12 @@ public class OverView : FontDisplay { 				selected = i; 				return; 			}+			+			if (i > 1000) {+				warning ("selected character not found");+				return;+			}+			 			i++; 		} 		diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex a41fd11..c37af80 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -177,13 +177,13 @@ public class TabBar : GLib.Object {  	public void close_all_tabs () { 		for (int i = 0; i < get_length (); i++) {-			if (close_tab (i)) {+			if (close_tab (i, false, true)) { 				close_all_tabs (); 			} 		} 	} -	public bool close_tab (int index, bool background_tab = false) {	+	public bool close_tab (int index, bool background_tab = false, bool select_new_tab = true) {	 		unowned List<Tab?>? lt; 		Tab t; 		EmptyTab empty_tab_canvas;@@ -215,14 +215,16 @@ public class TabBar : GLib.Object { 		if (t.has_close_button ()) { 			tabs.delete_link (tabs.nth(index)); 			-			if (!background_tab) {+			if (!background_tab && select_new_tab) { 				select_previous_tab (); 			} 			 			return true; 		} 		-		select_tab (index);+		if (select_new_tab) {+			select_tab (index);+		} 		 		return false; 	}diff --git a/scripts/linux_build.py b/scripts/linux_build.pyindex 25f95ef..1ae0d0e 100755--- a/scripts/linux_build.py+++ b/scripts/linux_build.py@@ -31,7 +31,7 @@ parser.add_option("-v", "--valac", dest="valac", help="select vala compiler", me (options, args) = parser.parse_args()  if not options.prefix:-	options.prefix = "/usr"+	options.prefix = "/usr/local" if not options.cc: 	options.cc = "gcc" if not options.cflags:diff --git a/scripts/version.py b/scripts/version.pyindex f79eb20..e01e4ea 100644--- a/scripts/version.py+++ b/scripts/version.py@@ -16,5 +16,5 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -VERSION = '0.29-beta1'-SO_VERSION = '6'+VERSION = '0.30'+SO_VERSION = '7'

Contact

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