Commit 8293735
Use only absolute paths on windows
Changed files (4)
modifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/Preview.valamodifiedlibbirdfont/TestCases.vala
Diff
@@ -444,7 +444,7 @@ os.put_string ( fo.write_ttf_font (f); fo.close (); } catch (Error e) {- warning ("Can't write TTF font.");+ warning (@"Can't write TTF font to $ttf"); critical (@"$(e.message)"); } }@@ -455,7 +455,7 @@ os.put_string ( try { fo.write (); } catch (Error e) {- warning ("EOF conversion falied.");+ warning (@"EOF conversion falied, $ttf -> $eot"); critical (@"$(e.message)"); } }@@ -160,8 +160,13 @@ public class Font : GLib.Object { if (font_file != null) { fn = (!) font_file;- file = File.new_for_path (fn);- return (!) file.resolve_relative_path ("").get_path ();+ + if (fn.index_of ("\\") != -1) { // assume only absolute paths are used on windows+ return fn;+ } else {+ file = File.new_for_path (fn);+ return (!) file.resolve_relative_path ("").get_path ();+ } } StringBuilder sb = new StringBuilder ();@@ -194,6 +199,7 @@ public class Font : GLib.Object { } public File get_folder () {+ File file; string p = get_path (); int i = p.last_index_of ("/"); @@ -207,6 +213,11 @@ public class Font : GLib.Object { p = p.substring (0, i); + if (p.index_of ("\\") == -1) { // not on windows+ file = File.new_for_path (p);+ p = (!) file.resolve_relative_path ("").get_path ();+ }+ return File.new_for_path (p); } @@ -36,9 +36,9 @@ public class Preview : FontDisplay { public static File get_file () { Font font = BirdFont.get_current_font ();- string path = get_html_file_name ();+ string fn = get_html_file_name (); File dir = font.get_folder ();- File file = dir.get_child (path);+ File file = dir.get_child (fn); if (!file.query_exists ()) { ExportTool.generate_html_document ((!)file.get_path (), font); @@ -47,7 +47,7 @@ class TestCases { add (test_codepages, "Codepages"); add (test_double_quadratic, "Double quadratic"); add (test_raster_path, "Raster path");- + add_bechmark (benchmark_stroke, "Stroke"); }