Commit 25c84a2
Merge branch 'master' of gitorious.org:birdfont/birdfont
Changed files (16)
modifiedNEWSmodifiedREADMEmodifiedbirdfont/GtkWindow.valamodifiedbirdfont/Main.valamodifiedconfiguremodifieddodo.pymodifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/MenuTab.valamodifiedlibbirdfont/OpenFontFormat/Os2Table.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/TabBar.valamodifiedscripts/linux_build.pymodifiedscripts/version.py
Diff
@@ -1,3 +1,14 @@+birdfont (0.29) stable;++ * Groups of paths and control points+ * Speed optimizations+ * Bold and italic styles+ * Bug fixes+ * TTF units+ * Paste in place and paste at cursor++ -- Johan Mattsson <johan.mattsson.m@gmail.com> Tue Sep 10 12:51:33 CEST 2013+ birdfont (0.28) stable; * Kerning classes@@ -39,6 +39,14 @@ doit sudo ./install.py +The default prefix is /usr/local on Fedora should BirdFont be compiled with +/usr as prefix. + +./configure --prefix=/usr +./scripts/linux_build.py --prefix=/usr +sudo ./install.py + + --------------------- Building Mac binaries --------------------- @@ -55,9 +63,7 @@ Packages Windows binaries are avalilable at http://birdfont.org -A Ubuntu package is avalilable at https://launchpad.net -You can apt-get install birdfont form Olivier Bertens or -Dariusz Dumas repository. +A Ubuntu packages are avalilable at https://launchpad.net A Machintosh binary image is available at http://birdfont.org and a GTK version for Mac can be installed with MacPorts. @@ -508,7 +508,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { Gtk.MenuItem export_item = new Gtk.MenuItem.with_mnemonic (_("_Export")); file_menu.append (export_item);- export_item.activate.connect (() => { ExportTool.export_all (); });+ export_item.activate.connect (() => { MenuTab.export_font (); }); export_item.add_accelerator ("activate", accel_group, 'E', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); if (!BirdFont.mac) {@@ -829,7 +829,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { } if (file_chooser.run () == ResponseType.ACCEPT) { - MainWindow.get_glyph_canvas ().redraw ();+ GlyphCanvas.redraw (); fn = file_chooser.get_filename (); } @@ -32,7 +32,7 @@ public static int main (string[] arg) { CharDatabaseParser db = new CharDatabaseParser (); unowned Thread<int> db_thread; Mutex database_mutex = Mutex ();- Cond main_loop_idle = new Cond ();+ Cond main_loop_idle = Cond (); bool in_idle = false; birdfont.init (arg, null);@@ -54,7 +54,7 @@ def configure (): libs = [ 'cairo', 'gdk-pixbuf-2.0', - 'gee-0.8',+ 'gee-1.0', 'gio-2.0', 'glib-2.0', 'gtk+-2.0',@@ -45,7 +45,7 @@ LIBS = [ 'cairo', 'gdk-pixbuf-2.0', 'webkit-1.0',- 'gee-0.8'+ 'gee-1.0' ] def task_build ():@@ -43,7 +43,8 @@ public static int run_export (string[] arg) { return -1; } - init_logfile ();+ // FIXME: create a option for this and structure the log messages+ // init_logfile (); for (int i = 1; i < arg.length; i++) { @@ -104,10 +105,10 @@ public static int run_export (string[] arg) { BirdFont.current_glyph = new Glyph (""); if (!BirdFont.get_current_font ().load (file_name, false)) {- stderr.printf (@"Failed to load font $file_name.\n");+ warning (@"Failed to load font $file_name.\n"); if (!file_name.has_suffix (".bf")) {- stderr.printf (@"Is it a .bf file?\n");+ warning (@"Is it a .bf file?\n"); } return 1;@@ -154,13 +154,12 @@ public class ExportTool : GLib.Object { } } - public static void export_all () {+ /** Font must be saves before export. */+ internal static void export_all () { Font font = BirdFont.get_current_font (); if (font.font_file == null) {- if (MenuTab.save ()) {- do_export ();- }+ warning ("Font is not saved."); } else { do_export (); }@@ -470,7 +469,13 @@ os.put_string ( try { // create a copy of current font and use it in a separate // export thread- temp_file = current_font.save_backup ();+ + if (async) {+ temp_file = current_font.save_backup ();+ } else {+ temp_file = current_font.get_path (); + }+ ttf_file = folder.get_child (current_font.get_full_name () + ".ttf"); eot_file = folder.get_child (current_font.get_full_name () + ".eot"); @@ -486,7 +491,7 @@ os.put_string ( assert (!is_null (ttf_file.get_path ())); assert (!is_null (eot_file.get_path ())); - export_thread = new ExportThread (temp_file, (!) ttf_file.get_path (), (!) eot_file.get_path ());+ export_thread = new ExportThread (temp_file, (!) ttf_file.get_path (), (!) eot_file.get_path (), async); if (async) { spawn_export (folder, temp_file);@@ -556,11 +561,13 @@ os.put_string ( private static string ffi; private static string ttf; private static string eot;+ private bool async = false; - public ExportThread (string nffi, string nttf, string neot) {+ public ExportThread (string nffi, string nttf, string neot, bool async) { ffi = nffi.dup (); ttf = nttf.dup (); eot = neot.dup ();+ this.async = async; } public void* run () {@@ -576,18 +583,24 @@ os.put_string ( void write_ttf () { OpenFontFormatWriter fo = new OpenFontFormatWriter ();- Font f = new Font ();+ Font f; File file = (!) File.new_for_path (ttf); return_if_fail (!is_null (ffi)); return_if_fail (!is_null (ttf)); return_if_fail (!is_null (file));- return_if_fail (!is_null (f)); return_if_fail (!is_null (fo)); try {- if (!f.load (ffi, false)) {- warning (@"Can't read $ffi");+ if (async) {+ printd ("Loading the intermediate file.\n");+ f = new Font ();+ if (!f.load (ffi, false)) {+ warning (@"Can't read $ffi");+ }+ } else {+ f = BirdFont.get_current_font ();+ printd ("File is already loaded.\n"); } fo.open (file);@@ -487,8 +487,13 @@ public class Font : GLib.Object { temp_file = dir.get_child (@"$(name).bf"); backup_file = (!) ((!) temp_file).get_path (); backup_file = backup_file.replace (" ", "_");- birdfont_file.write_font_file (backup_file, true); + if (get_path () == backup_file) {+ warning ("Refusing to write backup of a backup.");+ return backup_file;+ }+ + birdfont_file.write_font_file (backup_file, true); return backup_file; } @@ -178,14 +178,7 @@ public class MainWindow { } public static void close_all_tabs () { - uint i = 0; - uint len = get_tab_bar ().get_length (); - - while (i < len) { - if (!get_tab_bar ().close_tab ((int) i)) { - i++; - } - } + get_tab_bar ().close_all_tabs (); } public static string translate (string s) { @@ -22,6 +22,17 @@ public class MenuTab : FontDisplay { public MenuTab () { } + public static void export_font () {+ Font font = BirdFont.get_current_font (); + if (font.font_file == null) {+ if (MenuTab.save ()) {+ ExportTool.export_all ();+ }+ } else {+ ExportTool.export_all ();+ }+ }+ public static void set_suppress_event (bool e) { suppress_event = e; }@@ -232,7 +243,18 @@ public class MenuTab : FontDisplay { MainWindow.get_tab_bar ().add_unique_tab (kd, 85, false); } - public static void preview () {+ public static void preview () {+ Font font = BirdFont.get_current_font (); + if (font.font_file == null) {+ if (MenuTab.save ()) {+ show_preview_tab ();+ }+ } else {+ show_preview_tab ();+ }+ }+ + public static void show_preview_tab () { OverWriteDialogListener dialog = new OverWriteDialogListener (); TabBar tab_bar = MainWindow.get_tab_bar (); FontFormat format = BirdFont.get_current_font ().format;@@ -60,7 +60,7 @@ class Os2Table : Table { fd.add_16 (40); // ySuperscriptYOffset fd.add_16 (40); // yStrikeoutSize fd.add_16 (200); // yStrikeoutPosition- fd.add_16 (40); // sFamilyClass+ fd.add_16 (0); // sFamilyClass // FIXME: PANOSE fd.add (0); @@ -658,6 +658,11 @@ public class OverView : FontDisplay { index = -1; + if (items_per_row <= 0) {+ warning ("No items.");+ return;+ }+ if (is_modifier_key (c)) { return; }@@ -672,6 +677,12 @@ public class OverView : FontDisplay { selected = i; return; }+ + if (i > 1000) {+ warning ("selected character not found");+ return;+ }+ i++; } @@ -177,13 +177,13 @@ public class TabBar : GLib.Object { public void close_all_tabs () { for (int i = 0; i < get_length (); i++) {- if (close_tab (i)) {+ if (close_tab (i, false, true)) { close_all_tabs (); } } } - public bool close_tab (int index, bool background_tab = false) { + public bool close_tab (int index, bool background_tab = false, bool select_new_tab = true) { unowned List<Tab?>? lt; Tab t; EmptyTab empty_tab_canvas;@@ -215,14 +215,16 @@ public class TabBar : GLib.Object { if (t.has_close_button ()) { tabs.delete_link (tabs.nth(index)); - if (!background_tab) {+ if (!background_tab && select_new_tab) { select_previous_tab (); } return true; } - select_tab (index);+ if (select_new_tab) {+ select_tab (index);+ } return false; }@@ -31,7 +31,7 @@ parser.add_option("-v", "--valac", dest="valac", help="select vala compiler", me (options, args) = parser.parse_args() if not options.prefix:- options.prefix = "/usr"+ options.prefix = "/usr/local" if not options.cc: options.cc = "gcc" if not options.cflags:@@ -16,5 +16,5 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -VERSION = '0.29-beta1'-SO_VERSION = '6'+VERSION = '0.30'+SO_VERSION = '7'