The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

SpacingTools.vala in libbirdfont

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of libbirdfont/SpacingTools.vala.
Ignore case in key bindings
1 /* 2 Copyright (C) 2015 Johan Mattsson 3 4 This library is free software; you can redistribute it and/or modify 5 it under the terms of the GNU Lesser General Public License as 6 published by the Free Software Foundation; either version 3 of the 7 License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, but 10 WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 */ 14 15 using Cairo; 16 using Math; 17 18 namespace BirdFont { 19 20 public class SpacingTools : ToolCollection { 21 public static Gee.ArrayList<Expander> expanders; 22 23 public static ZoomBar zoom_bar; 24 25 public SpacingTools () { 26 expanders = new Gee.ArrayList<Expander> (); 27 28 Expander font_name = new Expander (); 29 font_name.add_tool (new FontName ()); 30 31 Expander zoom_expander = new Expander (t_("Font Size")); 32 33 zoom_bar = new ZoomBar (); 34 zoom_bar.new_zoom.connect ((z) => { 35 KerningTools.font_size = 3 * z; 36 37 if (KerningTools.font_size < 0.1) { 38 KerningTools.font_size = 0.1; 39 } 40 41 GlyphCanvas.redraw (); 42 }); 43 zoom_expander.add_tool (zoom_bar); 44 45 Expander spacing_tools_expander = new Expander (); 46 spacing_tools_expander.add_tool (KerningTools.previous_kerning_string); 47 spacing_tools_expander.add_tool (KerningTools.next_kerning_string); 48 49 expanders.add (font_name); 50 expanders.add (zoom_expander); 51 expanders.add (spacing_tools_expander); 52 } 53 54 public override Gee.ArrayList<string> get_displays () { 55 Gee.ArrayList<string> d = new Gee.ArrayList<string> (); 56 d.add ("Spacing"); 57 return d; 58 } 59 60 public override Gee.ArrayList<Expander> get_expanders () { 61 return expanders; 62 } 63 } 64 65 } 66