Commit 3412eb0
version 0.28
Changed files (7)
modifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/OpenFontFormat/OpenFontFormatWriter.valamodifiedlibbirdfont/SvgFont.valamodifiedlibbirdfont/SvgFontFormatWriter.valamodifiedscripts/version.py
Diff
@@ -90,6 +90,8 @@ class BirdFontFile { try { File file = File.new_for_path (path); uint num_kerning_pairs;+ uint progress;+ uint num_glyphs; if (file.query_file_type (0) == FileType.DIRECTORY) { warning (@"Can not save font. $path is a directory.");@@ -201,6 +203,8 @@ class BirdFontFile { }); num_kerning_pairs = KerningClasses.get_instance ().classes_first.length ();+ progress = num_kerning_pairs;+ ProgressBar.set_progress (1); for (uint i = 0; i < num_kerning_pairs; i++) { os.put_string ("<kerning "); os.put_string ("left=\"");@@ -214,6 +218,9 @@ class BirdFontFile { os.put_string ("hadjustment=\""); os.put_string (float_point (KerningClasses.get_instance ().classes_kerning.nth (i).data.val)); os.put_string ("\" />\n");+ + ProgressBar.set_progress (--progress / (double) num_kerning_pairs);+ Tool.yield (); } KerningClasses.get_instance ().get_single_position_pairs ((l, r, k) => {@@ -230,6 +237,9 @@ class BirdFontFile { os.put_string ("hadjustment=\""); os.put_string (float_point (k)); os.put_string ("\" />\n");+ + ProgressBar.set_progress (++progress / (double) num_kerning_pairs);+ Tool.yield (); } catch (GLib.Error e) { warning (@"$(e.message) \n"); }@@ -558,6 +568,8 @@ class BirdFontFile { if (attr_name == "hadjustment") { hadjustment = double.parse (attr_content); }+ + ProgressBar.set_progress (0); } if (range_left.get_length () > 1) {@@ -502,6 +502,8 @@ os.put_string ( string[] spawn_args = get_birdfont_export (folder, temp_file); string c = ""; + MainWindow.set_status (_("Writing TTF and EOT files."));+ foreach (string s in spawn_args) { c += s + " "; }@@ -514,6 +516,7 @@ os.put_string ( public static bool export_svg_font () { Font font = BirdFont.get_current_font ();+ MainWindow.set_status (_("Writing SVG file.")); return export_svg_font_path (font.get_folder ()); } @@ -169,6 +169,13 @@ public class MainWindow { public static string translate (string s) { return _(s); } + + public static void set_status (string s) { + if (!is_null (tool_tip)) { + tool_tip.show_text (s); + Tool.yield (); + } + } } } @@ -46,7 +46,7 @@ class OpenFontFormatWriter : Object { unowned List<Table> tables; FontData fd; uint l;- + font = nfont; directory_table.process (); @@ -126,7 +126,7 @@ class SvgFont : GLib.Object { KerningClasses.get_instance ().set_kerning (grl, grr, -kerning); } catch (MarkupError e) { warning (e.message);- } + } } } }@@ -86,7 +86,6 @@ class SvgFontFormatWriter : Object { } // FIXME: ligatures- KerningClasses.get_instance ().all_pairs ((left, right, k) => { string l, r; Font f = BirdFont.get_current_font ();@@ -111,6 +110,9 @@ class SvgFontFormatWriter : Object { } catch (GLib.Error e) { warning (e.message); }+ + ProgressBar.set_progress (0);+ Tool.yield (); }); put ("</font>");@@ -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.27'-SO_VERSION = '4'+VERSION = '0.28'+SO_VERSION = '5'