The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Store font size in kerning display

These changes was commited to the Birdfont repository Sun, 30 Aug 2015 08:35: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
[Sun, 30 Aug 2015 08:35:19 +0000]

Updated Files

libbirdfont/KerningTools.vala
libbirdfont/MenuTab.vala
libbirdfont/ZoomBar.vala
--- a/libbirdfont/KerningTools.vala +++ b/libbirdfont/KerningTools.vala @@ -44,11 +44,16 @@ zoom_bar = new ZoomBar (); zoom_bar.new_zoom.connect ((z) => { + Font f; + font_size = 3 * z; if (font_size < 0.1) { font_size = 0.1; } + + f = BirdFont.get_current_font (); + f.settings.set_setting ("kerning_zoom", @"$z"); GlyphCanvas.redraw (); });
--- a/libbirdfont/MenuTab.vala +++ b/libbirdfont/MenuTab.vala @@ -281,6 +281,15 @@ DrawingTools.auto_trace_simplify.set_value_round (asi); } + string kerning_zoom = f.settings.get_setting ("kerning_zoom"); + if (kerning_zoom != "") { + double k = double.parse (kerning_zoom); + if (!is_null (KerningTools.zoom_bar)) { + KerningTools.zoom_bar.zoom_level = k; + KerningTools.zoom_bar.new_zoom (k); + } + } + MainWindow.get_toolbox ().update_expanders (); MainWindow.get_toolbox ().update_all_expanders (); Toolbox.redraw_tool_box ();
--- a/libbirdfont/ZoomBar.vala +++ b/libbirdfont/ZoomBar.vala @@ -19,8 +19,8 @@ public class ZoomBar : Tool { - double zoom_level = 1 / 3.0; - bool update_zoom = false; + public double zoom_level = 1 / 3.0; + public bool update_zoom = false; public signal void new_zoom (double zoom_level);