The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix kerning classes

These changes was commited to the Birdfont repository Mon, 19 Sep 2016 18:57:36 +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>
Mon, 19 Sep 2016 18:57:36 +0000 (20:57 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Mon, 19 Sep 2016 18:57:36 +0000 (20:57 +0200)
commit 0722c92ce4f6bea5807ea8989ce15acd9ee0d233
tree 1cad5d2d70c346a765f6fd00f77cf8b313df1f38
parent 0d5f902b1b981cd5cb03bdad91822471d10de899
Fix kerning classes

libbirdfont/GlyphRange.vala
libbirdfont/KerningRange.vala
libbirdfont/KerningTools.vala
--- a/libbirdfont/GlyphRange.vala +++ b/libbirdfont/GlyphRange.vala @@ -182,7 +182,11 @@ } if (w.char_count () == 1) { - add_single (w.get_char ()); + unichar c = w.get_char_validated (); + + if (c > 0) { + add_single (c); + } } else if (w == "space") { add_single (' '); } else if (w == "divis") {
--- a/libbirdfont/KerningRange.vala +++ b/libbirdfont/KerningRange.vala @@ -113,7 +113,8 @@ TextListener listener = new TextListener (t_("Kerning class"), ranges, t_("Set")); listener.signal_text_input.connect ((text) => { set_ranges (text); - Toolbox.redraw_tool_box (); + KerningTools.classes.clear_cache (); + KerningTools.classes.redraw (); }); listener.signal_submit.connect (() => {
--- a/libbirdfont/KerningTools.vala +++ b/libbirdfont/KerningTools.vala @@ -54,7 +54,12 @@ active_otf_features = new OtfTags (); Expander kerning_tools = new Expander (t_("Kerning Tools")); - classes = new Expander (); + + if (is_null (classes)) { + classes = new Expander (); + update_kerning_classes (); + } + expanders = new Gee.ArrayList<Expander> (); Expander font_name = new Expander (); @@ -86,6 +91,7 @@ KerningRange kr = new KerningRange (f, @"$label $(++next_class)"); classes.add_tool (kr); self.set_selected (false); + classes.clear_cache (); classes.redraw (); }); kerning_tools.add_tool (new_kerning_class); @@ -176,8 +182,8 @@ expanders.add (font_name); expanders.add (zoom_expander); expanders.add (kerning_tools); + expanders.add (otf_features); expanders.add (classes); - expanders.add (otf_features); } public static void add_otf_label (string tag) { @@ -266,6 +272,9 @@ add_unique_class (kr); } } + + classes.clear_cache (); + classes.redraw (); } private static void remove_all_kerning_classes () {