Clone in a terminal:
Commit 3b78e91
Johan Mattsson - 2015-03-24T19:17:45+00:00
3b78e91ea820ab673c96251bbfd27eaeb457921cjohan.mattsson.m@gmail.com

Select rsb and lsb with keyboard in spacing tab

Changed files (2)

Diff

diff --git a/libbirdfont/KerningDisplay.vala b/libbirdfont/KerningDisplay.valaindex 41c8943..12899a2 100644--- a/libbirdfont/KerningDisplay.vala+++ b/libbirdfont/KerningDisplay.vala@@ -43,7 +43,7 @@ public class KerningDisplay : FontDisplay { 	Text kerning_label = new Text (); 	 	public bool adjust_side_bearings = false;-	bool right_side_bearing = true;+	public bool right_side_bearing = true; 	 	public KerningDisplay () { 		GlyphSequence w = new GlyphSequence ();@@ -538,13 +538,45 @@ public class KerningDisplay : FontDisplay { 	}  	public static void previous_pair () {-		KerningDisplay d = MainWindow.get_kerning_display ();-		d.set_selected_handle (d.selected_handle - 1);+		KerningDisplay kd;+		FontDisplay fd;+		SpacingTab st;+		+		fd = MainWindow.get_current_display ();+		+		if (fd is SpacingTab) {+			st = (SpacingTab) fd;+			if (!st.right_side_bearing) {+				st.right_side_bearing = true;+			} else {+				st.right_side_bearing = false;+				st.set_selected_handle (st.selected_handle - 1);+			}+		} else if (fd is KerningDisplay) {+			kd = (KerningDisplay) fd;+			kd.set_selected_handle (kd.selected_handle - 1);	+		} 	} 	 	public static void next_pair () {-		KerningDisplay d = MainWindow.get_kerning_display ();-		d.set_selected_handle (d.selected_handle + 1);+		KerningDisplay kd;+		FontDisplay fd;+		SpacingTab st;+		+		fd = MainWindow.get_current_display ();+		+		if (fd is SpacingTab) {+			st = (SpacingTab) fd;+			if (st.right_side_bearing) {+				st.right_side_bearing = false;+			} else {+				st.right_side_bearing = true;+				st.set_selected_handle (st.selected_handle + 1);+			}+		} else if (fd is KerningDisplay) {+			kd = (KerningDisplay) fd;+			kd.set_selected_handle (kd.selected_handle + 1);	+		} 	}  	private static string round (double d) {@@ -590,16 +622,14 @@ public class KerningDisplay : FontDisplay {  			if (KeyBindings.modifier == CTRL && (keyval == Key.LEFT || keyval == Key.RIGHT)) { 				if (keyval == Key.LEFT) { -					selected_handle--;+					previous_pair (); 				} 				 				if (keyval == Key.RIGHT) {-					selected_handle++;-				}-				-				set_selected_handle (selected_handle);+					next_pair ();+				}	 			}-			+ 			if (KeyBindings.modifier == NONE  				|| KeyBindings.modifier == SHIFT  				|| KeyBindings.modifier == ALT) {		diff --git a/resources/key_bindings.xml b/resources/key_bindings.xmlindex be6cfa5..836e010 100644--- a/resources/key_bindings.xml+++ b/resources/key_bindings.xml@@ -39,10 +39,13 @@ 	<action key="k" ctrl="true" alt="false" command="false" shift="false" action="show kerning tab" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="list kerning pairs" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="show spacing classes" />-	<action key="" ctrl="false" alt="false" command="false" shift="false" action="select next kerning pair" />-	<action key="" ctrl="false" alt="false" command="false" shift="false" action="select previous kerning pair" />+	<action key="s" ctrl="true" alt="false" command="false" shift="false" action="select next kerning pair" />+	<action key="q" ctrl="true" alt="false" command="false" shift="false" action="select previous kerning pair" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="load kerning strings" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="reloadload kerning strings" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="show ligature tab" /> 	<action key="L" ctrl="true" alt="false" command="false" shift="true" action="add ligature" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="save as .bfp" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="settings" /> 	<action key="d" ctrl="true" alt="false" command="false" shift="false" action="name and description" /> 	<action key="b" ctrl="false" alt="false" command="false" shift="false" action="foresight" />@@ -65,6 +68,7 @@ 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="skew" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="width" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="height" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="object_stroke" /> 	<action key="w" ctrl="false" alt="false" command="false" shift="false" action="tie_point" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="symmetric" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="create_line" />@@ -94,10 +98,14 @@ 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="next" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="circle" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="rectangle" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="test_case" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="slow_test" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_class" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_text_input" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="insert_glyph_from_overview" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="insert_unichar" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="previous_kerning_string" />+	<action key="" ctrl="false" alt="false" command="false" shift="false" action="next_kerning_string" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="update_webview" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="export_fonts" /> 	<action key="" ctrl="false" alt="false" command="false" shift="false" action="generate_html_document" />

Contact

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