Commit b5c9163
platform specific preview
Changed files (4)
modifiedsrc/EotWriter.valamodifiedsrc/ExportTool.valamodifiedsrc/GtkWindow.valamodifiedwin32/birdfont.ico
Diff
@@ -19,7 +19,7 @@ using Math; namespace Supplement { -class EotWriter {+class EotWriter : GLib.Object { string ttf_file_name; string eot_file_name;@@ -364,9 +364,6 @@ os.put_string ( async = false; } - // the font be created before html is loaded into webkit, see the hack in GtkWindow- async = false;- try { // create a copy of current font and use it in a separate // export thread@@ -448,11 +445,10 @@ os.put_string ( return true; } - public class ExportThread : GLib.Object {- private string ffi;- private string ttf;- private string eot;+ private static string ffi;+ private static string ttf;+ private static string eot; public ExportThread (string ffi, string ttf, string eot) { this.ffi = ffi.dup ();@@ -501,7 +497,7 @@ os.put_string ( } void write_eof () {-/* EotWriter fo;+ EotWriter fo; return_if_fail (!is_null (this)); return_if_fail (!is_null (ttf));@@ -510,14 +506,15 @@ os.put_string ( fo = new EotWriter (ttf, eot); return_if_fail (!is_null (fo));- + try { fo.write (); } catch (Error e) { warning ("EOF convertion falied."); critical (@"$(e.message)");- }*/+ } }+ } private static void status (string s) {@@ -92,13 +92,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { if (fd.get_html () == "") { if (fd.get_name () == "Preview") {- // hack: force webkit to ignore cache in preview- //ExportTool.export_all ();-- html_canvas.reload_bypass_cache ();- html_canvas.load_html_string ("<html></html>", "file:///"); - html_canvas.reload_bypass_cache ();- + // hack: force webkit to ignore cache in preview html_box.set_visible (false); glyph_canvas_area.set_visible (true); @@ -116,24 +110,28 @@ public class GtkWindow : Gtk.Window, NativeWindow { File f_eot = font.get_folder ().get_child (@"$(font.get_name ()).eot"); File f_svg = font.get_folder ().get_child (@"$(font.get_name ()).svg"); - if (f_ttf.query_exists ())+ if (f_ttf.query_exists ()) { f_ttf.delete ();+ } - if (f_eot.query_exists ())+ if (f_eot.query_exists ()) { f_eot.delete ();- - if (f_svg.query_exists ())+ }+ + if (f_svg.query_exists ()) { f_svg.delete ();-- ExportTool.export_ttf_font ();+ }+ + ExportTool.export_ttf_font (); ExportTool.export_svg_font (); File r_ttf = preview_directory.get_child (@"$(font.get_name ())$rid.ttf");- //File r_eot = preview_directory.get_child (@"$(font.get_name ())$rid.eot"); File r_svg = preview_directory.get_child (@"$(font.get_name ())$rid.svg"); - f_ttf.copy (r_ttf, FileCopyFlags.NONE);- //f_eot.copy (r_eot, FileCopyFlags.NONE);+ if (Supplement.win32) {+ f_ttf.copy (r_ttf, FileCopyFlags.NONE);+ }+ f_svg.copy (r_svg, FileCopyFlags.NONE); while ((line = dis.read_line (null)) != null) {Binary files a/win32/birdfont.ico and b/win32/birdfont.ico differ