The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Tools for inserting glyphs in the spacing tab

These changes was commited to the Birdfont repository Fri, 02 Oct 2015 13:45:40 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 02 Oct 2015 13:45:40 +0000 (15:45 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 02 Oct 2015 13:51:43 +0000 (15:51 +0200)
commit a031f6c5db1a3622fc82d71d0488cb2de2c42243
tree 0684da31ff18bcf5a01746de1f45ae67f2a34753
parent 8a0af95871e76b011364728a92a7d0b7222f6c87
Tools for inserting glyphs in the spacing tab

libbirdfont/BirdFontFile.vala
libbirdfont/LabelTool.vala
libbirdfont/SpacingTools.vala
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -198,7 +198,7 @@ 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 @@ glyph_name = unserialize (attribute.get_content ()); } - if (attribute.get_name () == "alternate") { + if (attribute.get_name () == "replacement") { alt = unserialize (attribute.get_content ()); }
--- a/libbirdfont/LabelTool.vala +++ b/libbirdfont/LabelTool.vala @@ -43,12 +43,13 @@ 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);
--- a/libbirdfont/SpacingTools.vala +++ b/libbirdfont/SpacingTools.vala @@ -48,6 +48,30 @@ 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);