Commit a031f6c
Tools for inserting glyphs in the spacing tab
Changed files (3)
modifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/LabelTool.valamodifiedlibbirdfont/SpacingTools.vala
Diff
@@ -198,7 +198,7 @@ class BirdFontFile : GLib.Object { foreach (string alt in alternate.alternates) { os.put_string (@"<alternate "); os.put_string (@"glyph=\"$glyph_name\" ");- os.put_string (@"alternate=\"$alt\" ");+ os.put_string (@"replacement=\"$alt\" "); os.put_string (@"tag=\"$(tag)\" />\n"); } }@@ -841,7 +841,7 @@ class BirdFontFile : GLib.Object { glyph_name = unserialize (attribute.get_content ()); } - if (attribute.get_name () == "alternate") {+ if (attribute.get_name () == "replacement") { alt = unserialize (attribute.get_content ()); } @@ -43,12 +43,13 @@ public class LabelTool : Tool { double text_height; base ();-- this.label = label;- this.number = "-"; label_text = new Text (); label_text.set_text (label);+ + this.label = label;+ this.number = "-";+ text_height = 17 * Toolbox.get_scale (); label_text.set_font_size (text_height); @@ -48,6 +48,30 @@ public class SpacingTools : ToolCollection { zoom_expander.add_tool (zoom_bar); Expander spacing_tools_expander = new Expander ();+ + Tool insert_last = new Tool ("insert_glyph_from_overview", t_("Insert glyph from overview"));+ insert_last.select_action.connect ((self) => {+ SpacingTab d = MainWindow.get_spacing_tab ();+ GlyphSelection gs = new GlyphSelection ();+ + gs.selected_glyph.connect ((gc) => {+ d.inser_glyph (gc.get_current ());+ MainWindow.get_tab_bar ().select_tab_name ("Spacing");+ });+ + GlyphCanvas.set_display (gs);+ self.set_selected (false);+ });+ spacing_tools_expander.add_tool (insert_last);++ Tool insert_unicode = new Tool ("insert_unichar", t_("Insert character by unicode value"));+ insert_unicode.select_action.connect ((self) => {+ SpacingTab d = MainWindow.get_spacing_tab ();+ d.insert_unichar ();+ self.set_selected (false);+ });+ spacing_tools_expander.add_tool (insert_unicode);+ spacing_tools_expander.add_tool (KerningTools.previous_kerning_string); spacing_tools_expander.add_tool (KerningTools.next_kerning_string);