The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Merge branch 'master' of gitorious.org:birdfont/birdfont

These changes was commited to the Birdfont repository Sun, 21 Sep 2014 14:39:00 +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, 21 Sep 2014 14:39:00 +0000 (16:39 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 21 Sep 2014 14:39:00 +0000 (16:39 +0200)
commit 443b4c0d538d661614c55b5ff943ef3f800bace5
tree ebd0742c91fb1e120f445a29ea718decad7a0286
parent 37f13ecf94e8c0a7e2626d4a2c9a6a862456b43d
parent 009ec54d7adf74925e52734d5bd0ea3a47c540a3
Merge branch 'master' of gitorious.org:birdfont/birdfont

NEWS
birdfont/GtkWindow.vala
libbirdfont/BirdFont.vala
libbirdfont/MainWindow.vala
libbirdfont/OpenFontFormat/HheaTable.vala
libbirdfont/PenTool.vala
libbirdfont/SearchPaths.vala
po/cs.po
scripts/mac_build.py
scripts/version.py
diff --git a/NEWS b/NEWS
--- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ + birdfont (1.4) stable; + + * Bug fixes + * A complete Czech translation + + -- Johan Mattsson <johan.mattsson.m@gmail.com> Sun Sep 21 13:19:55 CEST 2014 + birdfont (1.3) stable; * A bug fix
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -582,48 +582,26 @@ Gtk.MenuItem next_tab_item = new Gtk.MenuItem.with_mnemonic (t_("_Next Tab")); tab_menu.append (next_tab_item); next_tab_item.activate.connect (() => { - TabBar tb = MainWindow.get_tab_bar (); - int n = tb.get_selected () + 1; - - if (!(0 <= n < tb.get_length ())) { - return; - } - - tb.select_tab (n); + MainWindow.next_tab (); }); Gtk.MenuItem prevoius_tab_item = new Gtk.MenuItem.with_mnemonic (t_("_Previous Tab")); tab_menu.append (prevoius_tab_item); - prevoius_tab_item.activate.connect (() => { - TabBar tb = MainWindow.get_tab_bar (); - int n = tb.get_selected () - 1; - - if (!(0 <= n < tb.get_length ())) { - return; - } - - tb.select_tab (n); + prevoius_tab_item.activate.connect (() => { + MainWindow.previous_tab (); }); - Gtk.MenuItem close_tab_item = new Gtk.MenuItem.with_mnemonic (t_("_Close tab")); + Gtk.MenuItem close_tab_item = new Gtk.MenuItem.with_mnemonic (t_("_Close Tab")); tab_menu.append (close_tab_item); close_tab_item.activate.connect (() => { - TabBar tb = MainWindow.get_tab_bar (); - int n = tb.get_selected (); - - if (!(0 <= n < tb.get_length ())) { - return; - } - - tb.close_tab (n); + MainWindow.close_tab (); }); close_tab_item.add_accelerator ("activate", accel_group, 'W', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); Gtk.MenuItem close_all_tabs_item = new Gtk.MenuItem.with_mnemonic (t_("Close _All Tabs")); tab_menu.append (close_all_tabs_item); close_all_tabs_item.activate.connect (() => { - TabBar tb = MainWindow.get_tab_bar (); - tb.close_all_tabs (); + MainWindow.close_all_tabs (); }); // Tool @@ -654,7 +632,7 @@ }); move_item.add_accelerator ("activate", accel_group, 'M', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); - Gtk.MenuItem full_unicode_item = new Gtk.MenuItem.with_mnemonic (t_("Show _full unicode characters set")); + Gtk.MenuItem full_unicode_item = new Gtk.MenuItem.with_mnemonic (t_("Show _Full Unicode Characters Set")); tool_menu.append (full_unicode_item); full_unicode_item.activate.connect (() => { Toolbox.select_tool_by_name ("utf_8"); @@ -1373,7 +1351,7 @@ }); box.pack_start (bold, false, false, 0); - italic = new CheckButton.with_label (_("Italic")); + italic = new CheckButton.with_label (t_("Italic")); italic.toggled.connect (() => { Font f = BirdFont.get_current_font (); f.italic = italic.active;;
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -669,6 +669,12 @@ /** Translate string */ public string t_ (string t) { return _(t); + } + + /** Translate mac menu items */ + public static string translate_mac (string t) { + string s = t_(t); + return s.replace ("_", ""); } /** Print a warning if Birdfont was started with the --test argument. */
--- a/libbirdfont/MainWindow.vala +++ b/libbirdfont/MainWindow.vala @@ -210,8 +210,41 @@ public static LigatureList get_ligature_display () { return ligature_display; + } + + public static void next_tab () { + TabBar tb = MainWindow.get_tab_bar (); + int n = tb.get_selected () + 1; + + if (!(0 <= n < tb.get_length ())) { + return; + } + + tb.select_tab (n); + } + + public static void previous_tab () { + TabBar tb = MainWindow.get_tab_bar (); + int n = tb.get_selected () - 1; + + if (!(0 <= n < tb.get_length ())) { + return; + } + + tb.select_tab (n); + } + + public static void close_tab () { + TabBar tb = MainWindow.get_tab_bar (); + int n = tb.get_selected (); + + if (!(0 <= n < tb.get_length ())) { + return; + } + + tb.close_tab (n); } } }
--- a/libbirdfont/OpenFontFormat/HheaTable.vala +++ b/libbirdfont/OpenFontFormat/HheaTable.vala @@ -11,6 +11,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ + + using Math; namespace BirdFont { @@ -84,11 +86,12 @@ int16 ascender, descender; FontData fd = new FontData (); Fixed version = 1 << 16; + Font font = BirdFont.get_current_font (); fd.add_fixed (version); // table version - ascender = glyf_table.ymax; - descender = glyf_table.ymin; // FIXME: look up, should it be -descender or descender? + ascender = (int16) rint (font.top_limit * HeadTable.UNITS); + descender = (int16) rint (font.bottom_limit * HeadTable.UNITS); fd.add_16 (ascender); // Ascender fd.add_16 (descender); // Descender
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -268,6 +268,8 @@ public static void delete_selected_points () { Glyph g = MainWindow.get_current_glyph (); + + print ("Break path."); foreach (PointSelection p in selected_points) { p.point.deleted = true;
--- a/libbirdfont/SearchPaths.vala +++ b/libbirdfont/SearchPaths.vala @@ -115,7 +115,7 @@ f = PREFIX + "/share/locale/sv/LC_MESSAGES/birdfont.mo"; if (exists (f)) { - return f; + return PREFIX + "/share/locale/"; } f = "/usr/share/locale/sv/LC_MESSAGES/birdfont.mo"; @@ -127,7 +127,12 @@ if (exists (f)) { return BirdFont.exec_path + "/Contents/Resources/locale"; } - + + f = BirdFont.bundle_path + "/Contents/Resources/locale"; + if (exists (f)) { + return BirdFont.bundle_path + "/Contents/Resources/locale"; + } + warning ("translations not found"); return "/usr/share/locale"; }
diff --git a/po/cs.po b/po/cs.po
--- a/po/cs.po +++ b/po/cs.po @@ -965,7 +965,7 @@ #: birdfont-autotrace/AutoTrace.vala:71 msgid "print this message" - msgstr "Vytisknout tuto zprávu\n" + msgstr "Vytisknout tuto zprávu" #: birdfont-autotrace/AutoTrace.vala:72 msgid "use quadratic control points"
--- a/scripts/mac_build.py +++ b/scripts/mac_build.py @@ -56,6 +56,7 @@ configfile.write_config (prefix) compile_translations() build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, library, False) + build.birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, library, False) build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library, False) build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, library, False)
--- a/scripts/version.py +++ b/scripts/version.py @@ -16,8 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ - VERSION = '1.3' - SO_VERSION_MAJOR = '25' + VERSION = '1.4' + SO_VERSION_MAJOR = '26' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR