The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Support visibility property in SVG files and reorganize menu

These changes was commited to the Birdfont repository Mon, 18 May 2015 10:59:01 +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, 18 May 2015 10:59:01 +0000 (12:59 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Mon, 18 May 2015 10:59:36 +0000 (12:59 +0200)
commit c7947bb21cfa86d3c877b756c98882d1b41b898b
tree 75b1e2d32f09258e5971e96b2e544bd823a2e7a6
parent cb246310a6a5b5d7bade892e81eff4fb0dd710ef
Support visibility property in SVG files and reorganize menu

libbirdfont/GuideTab.vala
libbirdfont/MainWindow.vala
libbirdfont/Menu.vala
libbirdfont/SvgParser.vala
--- a/libbirdfont/GuideTab.vala +++ b/libbirdfont/GuideTab.vala @@ -42,6 +42,8 @@ int i = 0; rows.clear (); + + rows.add (new Row.headline (t_("Guides"))); foreach (Line guide in BirdFont.get_current_font ().custom_guides) { rows.add (new Row.columns_1 (guide.label, i));
--- a/libbirdfont/MainWindow.vala +++ b/libbirdfont/MainWindow.vala @@ -103,7 +103,7 @@ return menu; } - /** Set the number of picels per millimeter for the current screen. */ + /** Set the number of pixels per millimeter for the current screen. */ public static void set_units_per_pixel (double u) { MainWindow.units = u; }
--- a/libbirdfont/Menu.vala +++ b/libbirdfont/Menu.vala @@ -56,6 +56,7 @@ SubMenu menu = new SubMenu (); SubMenu file_menu = new SubMenu (); SubMenu edit_menu = new SubMenu (); + SubMenu export_menu = new SubMenu (); SubMenu tab_menu = new SubMenu (); SubMenu kerning_menu = new SubMenu (); SubMenu ligature_menu = new SubMenu (); @@ -67,7 +68,7 @@ set_menu (file_menu); }); menu.items.add (file); - + MenuItem new_file = add_menu_item (t_("New"), "new"); new_file.action.connect (() => { MenuTab.new_file (); @@ -102,27 +103,6 @@ show_menu = false; }); file_menu.items.add (save_as); - - MenuItem export = add_menu_item (t_("Export"), "export"); - export.action.connect (() => { - MenuTab.export_fonts_in_background (); - show_menu = false; - }); - file_menu.items.add (export); - - MenuItem export_settings = add_menu_item (t_("Export Settings"), "export settings"); - export_settings.action.connect (() => { - MenuTab.show_export_settings_tab (); - show_menu = false; - }); - file_menu.items.add (export_settings); - - MenuItem preview = add_menu_item (t_("Preview"), "preview"); - preview.action.connect (() => { - MenuTab.preview (); - show_menu = false; - }); - file_menu.items.add (preview); MenuItem select_character_set = add_menu_item (t_("Select Character Set"), "select character set"); select_character_set.action.connect (() => { @@ -200,34 +180,6 @@ show_menu = false; }); edit_menu.items.add (search); - - MenuItem export_glyph = add_menu_item (t_("Export Glyph as SVG"), "export glyph as svg", "Glyph"); - export_glyph.action.connect (() => { - ExportTool.export_current_glyph (); - show_menu = false; - }); - edit_menu.items.add (export_glyph); - - MenuItem import_svg = add_menu_item (t_("Import SVG file"), "import svg file", "Glyph"); - import_svg.action.connect (() => { - SvgParser.import (); - show_menu = false; - }); - edit_menu.items.add (import_svg); - - MenuItem import_svg_folder = add_menu_item (t_("Import SVG folder"), "import svg folder", ""); - import_svg_folder.action.connect (() => { - SvgParser.import_folder (); - show_menu = false; - }); - edit_menu.items.add (import_svg_folder); - - MenuItem import_background_image = add_menu_item (t_("Import Background Image"), "import background image"); - import_background_image.action.connect (() => { - MenuTab.show_background_tab (); - show_menu = false; - }); - edit_menu.items.add (import_background_image); MenuItem simplify_path = add_menu_item (t_("Simplify Path"), "simplify path", "Glyph"); simplify_path.action.connect (() => { @@ -306,6 +258,62 @@ }); edit_menu.items.add (select_point_below); + // import and export + MenuItem export = add_menu_item (t_("Import and Export")); + export.action.connect (() => { + set_menu (export_menu); + }); + menu.items.add (export); + + MenuItem export_fonts = add_menu_item (t_("Export Fonts"), "export"); + export_fonts.action.connect (() => { + MenuTab.export_fonts_in_background (); + show_menu = false; + }); + export_menu.items.add (export_fonts); + + MenuItem export_glyph = add_menu_item (t_("Export Glyph as SVG"), "export glyph as svg", "Glyph"); + export_glyph.action.connect (() => { + ExportTool.export_current_glyph (); + show_menu = false; + }); + export_menu.items.add (export_glyph); + + MenuItem import_svg = add_menu_item (t_("Import SVG file"), "import svg file", "Glyph"); + import_svg.action.connect (() => { + SvgParser.import (); + show_menu = false; + }); + export_menu.items.add (import_svg); + + MenuItem import_svg_folder = add_menu_item (t_("Import SVG folder"), "import svg folder", ""); + import_svg_folder.action.connect (() => { + SvgParser.import_folder (); + show_menu = false; + }); + export_menu.items.add (import_svg_folder); + + MenuItem import_background_image = add_menu_item (t_("Import Background Image"), "import background image"); + import_background_image.action.connect (() => { + MenuTab.show_background_tab (); + show_menu = false; + }); + export_menu.items.add (import_background_image); + + MenuItem export_settings = add_menu_item (t_("Export Settings"), "export settings"); + export_settings.action.connect (() => { + MenuTab.show_export_settings_tab (); + show_menu = false; + }); + export_menu.items.add (export_settings); + + MenuItem preview = add_menu_item (t_("Preview"), "preview"); + preview.action.connect (() => { + MenuTab.preview (); + show_menu = false; + }); + export_menu.items.add (preview); + // tab menu MenuItem tab = add_menu_item (t_("Tab")); tab.action.connect (() => {
--- a/libbirdfont/SvgParser.vala +++ b/libbirdfont/SvgParser.vala @@ -500,6 +500,12 @@ } if (attr.get_name () == "display" && attr.get_content () == "none") { + hidden = true; + } + + if (attr.get_name () == "visibility" + && (attr.get_content () == "hidden" + || attr.get_content () == "collapse")) { hidden = true; } }