Clone in a terminal:
Commit 1d7f3e1
Johan Mattsson - 2014-07-09T13:45:09+00:00
1d7f3e12e28a0d8d9104712416047bd7f6868cddjohan.mattsson.m@gmail.com

Various bug fixes for Mac

Changed files (6)

Diff

diff --git a/libbirdfont/GlyphCanvas.vala b/libbirdfont/GlyphCanvas.valaindex 83b2eba..eb8ac1e 100644--- a/libbirdfont/GlyphCanvas.vala+++ b/libbirdfont/GlyphCanvas.vala@@ -19,7 +19,7 @@ namespace BirdFont { public class GlyphCanvas : GLib.Object {
 
 	/** Tab content. */
-	internal static FontDisplay current_display;
+	public static FontDisplay current_display;
 	
 	public signal void signal_redraw_area (int x, int y, int w, int h);
 	public static WidgetAllocation allocation;
@@ -41,7 +41,14 @@ public class GlyphCanvas : GLib.Object { 	}
 	
 	public void key_press (uint e) {
-		current_display.key_press (e);
+		Toolbox tb;+		+		current_display.key_press (e);+		+		if (current_display is Glyph) {+			tb = MainWindow.get_toolbox ();+			tb.key_press (e);+		}
 	}
 	
 	public void set_current_glyph (FontDisplay fd) {
diff --git a/libbirdfont/OpenFontFormat/CodePageBits.vala b/libbirdfont/OpenFontFormat/CodePageBits.valaindex fd4042e..4d93120 100644--- a/libbirdfont/OpenFontFormat/CodePageBits.vala+++ b/libbirdfont/OpenFontFormat/CodePageBits.vala@@ -52,12 +52,12 @@ public class CodePageBits : GLib.Object { 	}  	void set_bits_for_glyph (Glyph g, ref uint32 p0, ref uint32 p1) {-		List<int> bits;+		Gee.ArrayList<int> bits; 		 		if (!g.is_unassigned ()) { 			bits = get_bits (g.get_unichar ()); 			-			if (unlikely (bits.length () == 0)) {+			if (unlikely (bits.size == 0)) { 				warning (@"Unknown codepage for glyph $(g.get_name ()) ($(Font.to_hex (g.get_unichar ())))"); 			} 			@@ -67,11 +67,11 @@ public class CodePageBits : GLib.Object { 		} 	} 	-	public List<int> get_bits (unichar c) {-		List<int> bits = new List<int> ();+	public Gee.ArrayList<int> get_bits (unichar c) {+		Gee.ArrayList<int> bits = new Gee.ArrayList<int> (); 		foreach (PageBit pb in codepages) { 			if (pb.has_char (c)) {-				bits.append (pb.bit); +				bits.add (pb.bit);  			} 		} 		return bits;diff --git a/libbirdfont/Tab.vala b/libbirdfont/Tab.valaindex 74e49f5..c2bd982 100644--- a/libbirdfont/Tab.vala+++ b/libbirdfont/Tab.vala@@ -19,11 +19,13 @@ public class Tab : GLib.Object { 	bool always_open; 	double width;  	FontDisplay display;+	string label;  	public Tab (FontDisplay glyph, double tab_width, bool always_open) { 		width = tab_width;-		this.display = glyph;+		display = glyph; 		this.always_open = always_open;+		label = display.get_label (); 	}  	public bool has_close_button () {@@ -41,6 +43,10 @@ public class Tab : GLib.Object { 	public double get_width () { 		return width; 	}+	+	public string get_label () {+		return label;+	} }  }diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex 613049b..62abe87 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -742,7 +742,7 @@ public class TabBar : GLib.Object { 			cr.set_source_rgba (0, 0, 0, 1); 			cr.set_font_size (14 / scale); 			cr.move_to (8 / scale, h - 6 / scale);-			cr.show_text (t.get_display ().get_label ());+			cr.show_text (t.get_label ()); 			cr.stroke (); 			 			// edgesdiff --git a/libbirdfont/TabContent.vala b/libbirdfont/TabContent.valaindex dbda914..970e868 100644--- a/libbirdfont/TabContent.vala+++ b/libbirdfont/TabContent.vala@@ -126,7 +126,7 @@ public class TabContent : GLib.Object { 			return; 		} 		-		GlyphCanvas.current_display.undo (x, y);+		GlyphCanvas.current_display.undo (); 	} 	 	public static string path_to_uri (string path) {diff --git a/libbirdfont/TestCases.vala b/libbirdfont/TestCases.valaindex 831bc02..6d5f327 100644--- a/libbirdfont/TestCases.vala+++ b/libbirdfont/TestCases.vala@@ -81,19 +81,19 @@ class TestCases { 	public static void test_codepages () { 		CodePageBits pages = new CodePageBits (); 		-		if (pages.get_bits ('ó').length () == 0) {+		if (pages.get_bits ('ó').size == 0) { 			warning ("Codepage for Hungarian is not set."); 		} 		-		if (pages.get_bits ('ö').length () == 0) {+		if (pages.get_bits ('ö').size == 0) { 			warning ("Codepage for Swedish is not set."); 		} -		if (pages.get_bits ('ツ').length () == 0) {+		if (pages.get_bits ('ツ').size == 0) { 			warning ("Codepage for Japanese is not set."); 		} -		if (pages.get_bits ('马').length () == 0) {+		if (pages.get_bits ('马').size == 0) { 			warning ("Codepage for Chinese is not set."); 		} 	}

Contact

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