Clone in a terminal:
Commit e172893
Johan Mattsson - 2014-08-01T01:04:47+00:00
e172893ef36f151f2bd1939bf321206b3d967a68johan.mattsson.m@gmail.com

A tool for adding last edited glyph in the kerning tab

Changed files (4)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex 21f9b2b..770e101 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -668,12 +668,6 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		list_all_kerning_pairs.activate.connect (() => {  			 MenuTab.list_all_kerning_pairs (); 		});-		-		Gtk.MenuItem remove_all_kerning_pairs = new Gtk.MenuItem.with_mnemonic (t_("_Remove All Kerning Pairs"));-		kerning_menu.append (remove_all_kerning_pairs);-		remove_all_kerning_pairs.activate.connect (() => { -			 MenuTab.remove_all_kerning_pairs ();-		});  		kerning_menu.append (new SeparatorMenuItem ()); diff --git a/icons/insert_last_glyph.png b/icons/insert_last_glyph.pngnew file mode 100644index 0000000..de2ea8dBinary files /dev/null and b/icons/insert_last_glyph.png differdiff --git a/libbirdfont/KerningDisplay.vala b/libbirdfont/KerningDisplay.valaindex 6f558b4..67badc9 100644--- a/libbirdfont/KerningDisplay.vala+++ b/libbirdfont/KerningDisplay.vala@@ -604,22 +604,28 @@ public class KerningDisplay : FontDisplay { 	void add_character (unichar c) { 		Glyph? g; 		string name;-		Font f = BirdFont.get_current_font ();+		Font f;  		if (MenuTab.suppress_event) { 			return; 		} 		+		f = BirdFont.get_current_font ();+		 		if (!is_modifier_key (c) && c.validate ()) { 			name = f.get_name_for_character (c); 			g = f.get_glyph_by_name (name);-			if (g != null) {-				row.get (0).glyph.add (g);-				row.get (0).ranges.add (null);-				-				selected_handle = (int) row.get (0).glyph.size - 1;-				set_active_handle_index (selected_handle);-			}+			inser_glyph (g);+		}+	}+	+	public void inser_glyph (Glyph? g) {+		if (g != null) {+			row.get (0).glyph.add (g);+			row.get (0).ranges.add (null);+			+			selected_handle = (int) row.get (0).glyph.size - 1;+			set_active_handle_index (selected_handle); 		} 	} 	diff --git a/libbirdfont/KerningTools.vala b/libbirdfont/KerningTools.valaindex b2c78d4..d8424fa 100644--- a/libbirdfont/KerningTools.vala+++ b/libbirdfont/KerningTools.vala@@ -93,9 +93,16 @@ public class KerningTools : ToolCollection  { 			KerningTools.font_size = font_size2.get_value (); 			g.update_view (); 		});-		 		kerning_tools.add_tool (font_size2);-		++		Tool insert_last = new Tool ("insert_last_glyph", t_("Insert last edited glyph"));+		insert_last.select_action.connect ((self) => {+			KerningDisplay d = MainWindow.get_kerning_display ();+			d.inser_glyph (MainWindow.get_current_glyph ());+			GlyphCanvas.redraw ();+		});+		kerning_tools.add_tool (insert_last);+ 		kerning_tools.set_persistent (false); 		kerning_tools.set_unique (false); 

Contact

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