The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Merge ../birdfont-2.x

These changes was commited to the Birdfont repository Sun, 12 Jun 2016 18:10:19 +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>
Sun, 12 Jun 2016 18:10:19 +0000 (20:10 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 12 Jun 2016 18:10:19 +0000 (20:10 +0200)
commit f015bd0187d52ac32123bb399f14a0cb27014d64
tree 257573a0947e44d16e51b48882903a6135e738bb
parent 9665c72a4928996b8d8115ce0390710230c15d0b
parent 524f21428261174bf9f5d38bf928a5358f227368
Merge ../birdfont-2.x

NEWS
libbirdfont/MainWindow.vala
libbirdfont/OverviewTools.vala
libbirdfont/TabBar.vala
diff --git a/NEWS b/NEWS
--- a/NEWS +++ b/NEWS @@ -1,16 +1,24 @@ + birdfont (2.16.0) stable; + + * New freehand tool + * Rotate objects and point handles with 45 degree steps + * Bug fixes + + -- Johan Mattsson <johan.mattsson.m@gmail.com> Sun Jun 12 19:53:43 CEST 2016 + birdfont (2.15.6) stable; * Editable .notdef character * Bug fixes in the SVG parser - -- Johan Mattsson <johan.mattsson.m@gmail.com Fri Jan 22 13:10:07 CET 2016 + -- Johan Mattsson <johan.mattsson.m@gmail.com> Fri Jan 22 13:10:07 CET 2016 birdfont (2.15.0) stable; * Speed optimizations * Bug fixes - -- Johan Mattsson <johan.mattsson.m@gmail.com Fri Dec 11 22:26:42 CET 2015 + -- Johan Mattsson <johan.mattsson.m@gmail.com> Fri Dec 11 22:26:42 CET 2015 birdfont (2.14.0) stable; @@ -18,7 +26,7 @@ * Sandbox support on Mac OS * Bug fixes - -- Johan Mattsson <johan.mattsson.m@gmail.com Thu Nov 12 20:45:02 CET 2015 + -- Johan Mattsson <johan.mattsson.m@gmail.com> Thu Nov 12 20:45:02 CET 2015 birdfont (2.13.0) stable; @@ -29,7 +37,7 @@ * Swashes (OpenType feature tag: swsh) * Parse circles, ellipses and lines in SVG files - -- Johan Mattsson <johan.mattsson.m@gmail.com Mon Oct 26 11:33:09 CET 2015 + -- Johan Mattsson <johan.mattsson.m@gmail.com> Mon Oct 26 11:33:09 CET 2015 birdfont (2.12.0) stable;
--- a/libbirdfont/MainWindow.vala +++ b/libbirdfont/MainWindow.vala @@ -326,9 +326,15 @@ } public static OverView get_overview () { + foreach (Tab t in tabs.tabs) { + if (t.get_display () is OverView) { + return (OverView) t.get_display (); + } + } + return overview; } } }
--- a/libbirdfont/OverviewTools.vala +++ b/libbirdfont/OverviewTools.vala @@ -15,6 +15,11 @@ using Cairo; namespace BirdFont { + + public enum Transform { + SLANT, + SIZE + } public class OverviewTools : ToolCollection { @@ -38,7 +43,8 @@ Expander font_name = new Expander (); Expander character_sets = new Expander (t_("Character Sets")); Expander zoom_expander = new Expander (t_("Zoom")); - Expander transform_expander = new Expander (t_("Transform")); + Expander transform_slant_expander = new Expander (t_("Transform")); + Expander transform_size_expander = new Expander (); Expander glyph_expander = new Expander (t_("Glyph")); Expander multi_master = new Expander (t_("Multi-Master")); @@ -93,44 +99,72 @@ skew = new SpinButton ("skew_overview", t_("Skew")); skew.set_big_number (true); skew.set_int_value ("0.000"); + + FontSettings settings = BirdFont.get_current_font ().settings; + string? skew_value = settings.get_setting ("skew_overview"); + + if (skew_value != null) { + skew.set_int_value ((!) skew_value); + } + skew.set_int_step (1); skew.set_min (-100); skew.set_max (100); skew.show_icon (true); skew.set_persistent (false); - skew.new_value_action.connect ((self) => { - resize.set_value_round (100, false, false); + transform_slant_expander.add_tool (skew); + + Tool transform_slant = new Tool ("transform_slant", t_("Transform")); + transform_slant.set_icon ("transform"); + transform_slant.select_action.connect ((self) => { + FontSettings fs = BirdFont.get_current_font ().settings; + fs.set_setting ("skew_overview", @"$(skew.get_value ())"); + transform_slant.selected = false; + + process_transform (Transform.SLANT); + + BirdFont.get_current_font ().touch (); }); - transform_expander.add_tool (skew); + transform_slant.selected = false; + transform_slant.set_persistent (false); + transform_slant_expander.add_tool (transform_slant); resize = new SpinButton ("resize_overview", t_("Resize")); resize.set_big_number (true); - resize.set_int_value ("0.000"); + resize.set_int_value ("100.0"); + + string? resize_value = settings.get_setting ("resize_overview"); + + if (resize_value != null) { + resize.set_int_value ((!) resize_value); + + if (resize.get_value () <= 0) { + resize.set_int_value ("100.0"); + } + } + resize.set_int_step (1); resize.set_min (0); resize.set_max (300); resize.show_icon (true); resize.set_persistent (false); - resize.new_value_action.connect ((self) => { - skew.set_value_round (0, false, false); - }); - transform_expander.add_tool (resize); + transform_size_expander.add_tool (resize); + + Tool transform_size = new Tool ("transform_size", t_("Transform")); + transform_size.set_icon ("transform"); + transform_size.select_action.connect ((self) => { + FontSettings fs = BirdFont.get_current_font ().settings; + fs.set_setting ("resize_overview", @"$(resize.get_value ())"); + transform_size.selected = false; - Tool transform = new Tool ("transform", t_("Transform")); - transform.select_action.connect ((self) => { - FontSettings fs = BirdFont.get_current_font ().settings; - - fs.set_setting ("skew_overview", @"$(skew.get_value ())"); - transform.selected = false; - - process_transform (); + process_transform (Transform.SIZE); BirdFont.get_current_font ().touch (); }); - transform.selected = false; - transform.set_persistent (false); - transform_expander.add_tool (transform); - + transform_size.selected = false; + transform_size.set_persistent (false); + transform_size_expander.add_tool (transform_size); + Tool alternate = new Tool ("alternate", t_("Create alternate")); alternate.select_action.connect (add_new_alternate); glyph_expander.add_tool (alternate); @@ -179,7 +213,8 @@ expanders.add (font_name); expanders.add (zoom_expander); expanders.add (character_sets); - expanders.add (transform_expander); + expanders.add (transform_slant_expander); + expanders.add (transform_size_expander); expanders.add (glyph_expander); if (BirdFont.has_argument ("--test")) { @@ -256,7 +291,7 @@ MainWindow.tabs.add_tab (new OtfFeatureTable (gc)); } - public void process_transform () { + public void process_transform (Transform transform) { OverView o; Glyph g; OverView.OverViewUndoItem ui; @@ -273,13 +308,17 @@ ui.glyphs.add (gc.copy_deep ()); g.add_help_lines (); - if (skew.get_value () != 0) { - DrawingTools.resize_tool.skew_glyph (g, -skew.get_value (), 0, false); + if (transform == Transform.SLANT) { + if (skew.get_value () != 0) { + DrawingTools.resize_tool.skew_glyph (g, -skew.get_value (), 0, false); + } } - if (resize.get_value () != 100) { - double scale = resize.get_value () / 100; - DrawingTools.resize_tool.resize_glyph (g, scale, scale, false); + if (transform == Transform.SIZE) { + if (resize.get_value () != 100) { + double scale = resize.get_value () / 100; + DrawingTools.resize_tool.resize_glyph (g, scale, scale, false); + } } } }
--- a/libbirdfont/TabBar.vala +++ b/libbirdfont/TabBar.vala @@ -21,7 +21,7 @@ public int width = 0; public int height = 0; - private Gee.ArrayList<Tab> tabs; + public Gee.ArrayList<Tab> tabs; static const int NO_TAB = -1; static const int NEXT_TAB = -2;