Commit 382bf5f
Tool for adjusting kerning values in tool box
Changed files (4)
modifiedgraphics/tools_and_buttons.svgaddedicons/kerning_text_input.pngmodifiedlibbirdfont/KerningDisplay.valamodifiedlibbirdfont/KerningTools.vala
Diff
@@ -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>new file mode 100644Binary files /dev/null and b/icons/kerning_text_input.png differ@@ -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) {@@ -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); }