Clone in a terminal:
Commit 382bf5f
Johan Mattsson - 2014-02-19T14:36:48+00:00
382bf5fbdeeacae13f1b62c6d244c6148629e57cjohan.mattsson.m@gmail.com

Tool for adjusting kerning values in tool box

Changed files (4)

Diff

diff --git a/graphics/tools_and_buttons.svg b/graphics/tools_and_buttons.svgindex b0d2031..e7dc332 100644--- a/graphics/tools_and_buttons.svg+++ b/graphics/tools_and_buttons.svg@@ -413,16 +413,16 @@      borderopacity="1.0"      inkscape:pageopacity="0.0"      inkscape:pageshadow="2"-     inkscape:zoom="1"-     inkscape:cx="-152"-     inkscape:cy="796.5"+     inkscape:zoom="10.181818"+     inkscape:cx="53.5"+     inkscape:cy="367.54911"      inkscape:current-layer="layer1"      inkscape:document-units="px"      showgrid="false"-     inkscape:window-width="1215"-     inkscape:window-height="776"-     inkscape:window-x="65"-     inkscape:window-y="24"+     inkscape:window-width="1280"+     inkscape:window-height="969"+     inkscape:window-x="-2"+     inkscape:window-y="-3"      inkscape:window-maximized="1"      showguides="true"      inkscape:guide-bbox="true"@@ -1847,5 +1847,44 @@        inkscape:export-filename="/home/johan/birdfont/icons/delay_circle.png"        inkscape:export-xdpi="319.88824"        inkscape:export-ydpi="319.88824" />+    <text+       inkscape:export-ydpi="319.88824"+       inkscape:export-xdpi="319.88824"+       inkscape:export-filename="/home/johan/birdfont/icons/kerning_text_input.png"+       sodipodi:linespacing="125%"+       id="text3532"+       y="389.10025"+       x="50.371204"+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#515151;font-family:KacstDigital;-inkscape-font-specification:KacstDigital Medium"+       xml:space="preserve"><tspan+         y="389.10025"+         x="50.371204"+         id="tspan3534"+         sodipodi:role="line">T</tspan></text>+    <rect+       style="fill:#e6e6e6;fill-opacity:1;stroke:#858585;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"+       id="rect4322"+       width="11.70859"+       height="11.229433"+       x="126.64785"+       y="319.47968"+       inkscape:export-filename="/home/johan/birdfont/icons/insert_background.png"+       inkscape:export-xdpi="319.88824"+       inkscape:export-ydpi="319.88824" />+    <text+       inkscape:export-ydpi="319.88824"+       inkscape:export-xdpi="319.88824"+       inkscape:export-filename="/home/johan/birdfont/icons/insert_background.png"+       inkscape:transform-center-y="2.5075108"+       sodipodi:linespacing="125%"+       id="text4324"+       y="328.78897"+       x="128.93886"+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#858585;fill-opacity:1;stroke:none;font-family:KacstDigital;-inkscape-font-specification:KacstDigital Medium"+       xml:space="preserve"><tspan+         id="tspan4326"+         y="328.78897"+         x="128.93886"+         sodipodi:role="line">B</tspan></text>   </g> </svg>diff --git a/icons/kerning_text_input.png b/icons/kerning_text_input.pngnew file mode 100644index 0000000..1fcf5e6Binary files /dev/null and b/icons/kerning_text_input.png differdiff --git a/libbirdfont/KerningDisplay.vala b/libbirdfont/KerningDisplay.valaindex de83037..34cd311 100644--- a/libbirdfont/KerningDisplay.vala+++ b/libbirdfont/KerningDisplay.vala@@ -640,11 +640,15 @@ public class KerningDisplay : FontDisplay { 		} 	} 	-	private void set_kerning_by_text () {+	public void set_kerning_by_text () { 		TextListener listener; 		string kerning = @"$(get_kerning_for_handle (selected_handle))"; 		-		listener = new TextListener (t_("Kerning"), kerning, t_("Apply"));+		if (selected_handle == -1) {+			selected_handle = 0;+		}+		+		listener = new TextListener (t_("Kerning"), kerning, t_("Close")); 		 		listener.signal_text_input.connect ((text) => { 			string submitted_value = text.replace (",", ".");@@ -661,7 +665,9 @@ public class KerningDisplay : FontDisplay { 		 		suppress_input = true; 		text_input = true;-		MainWindow.native_window.set_text_listener (listener);		+		MainWindow.native_window.set_text_listener (listener);+		+		GlyphCanvas.redraw ();		 	} 	 	public override void button_press (uint button, double ex, double ey) {diff --git a/libbirdfont/KerningTools.vala b/libbirdfont/KerningTools.valaindex 5c0032d..c63163e 100644--- a/libbirdfont/KerningTools.vala+++ b/libbirdfont/KerningTools.vala@@ -27,25 +27,32 @@ public class KerningTools : ToolCollection  { 	} 	 	public static void init () {-		Expander class_tools = new Expander ();+		Expander kerning_tools = new Expander (); 		classes = new Expander (); 		-		Tool new_kerning_class = new Tool ("kerning_class", t_("Create new kerning class"));+		Tool new_kerning_class = new Tool ("kerning_class", t_("Create new kerning class.")); 		new_kerning_class.select_action.connect ((self) => { 			classes.add_tool (new KerningRange (@"Kerning class $(++next_class)")); 			Toolbox.redraw_tool_box (); 		});-		class_tools.add_tool (new_kerning_class);+		kerning_tools.add_tool (new_kerning_class); -		class_tools.set_persistent (false);-		class_tools.set_unique (false);-		class_tools.set_open (true);+		Tool text_kerning = new Tool ("kerning_text_input", t_("Use text input to enter kerning values."));+		text_kerning.select_action.connect ((self) => {+			KerningDisplay d = MainWindow.get_kerning_display ();+			d.set_kerning_by_text ();+		});+		kerning_tools.add_tool (text_kerning);+		+		kerning_tools.set_persistent (false);+		kerning_tools.set_unique (false);+		kerning_tools.set_open (true);  		classes.set_persistent (true); 		classes.set_unique (true); 		classes.set_open (true); 		-		expanders.append (class_tools);+		expanders.append (kerning_tools); 		expanders.append (classes); 	} 	

Contact

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