Clone in a terminal:
Commit d61dd70
Johan Mattsson - 2012-08-08T12:47:38+00:00
d61dd708e20e84bdbf4b34548da454b5d8a11813johan.mattsson.m@gmail.com

webkit preview

Changed files (1)

Diff

diff --git a/src/Preview.vala b/src/Preview.valanew file mode 100644index 0000000..f9d23b5--- /dev/null+++ b/src/Preview.vala@@ -0,0 +1,53 @@+/*+    Copyright (C) 2012 Johan Mattsson++    This program is free software: you can redistribute it and/or modify+    it under the terms of the GNU General Public License as published by+    the Free Software Foundation, either version 3 of the License, or+    (at your option) any later version.++    This program is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+    GNU General Public License for more details.++    You should have received a copy of the GNU General Public License+    along with this program.  If not, see <http://www.gnu.org/licenses/>.+*/++using WebKit;++namespace Supplement {++class Preview : FontDisplay {	+	+	public Preview () {+	}+	+	public override string get_name () {+		return "Preview";+	}+	+	public override bool is_html_canvas () {+		return true;+	}++	public override void selected_canvas () {+		ExportTool.export_all ();+		MainWindow.get_webview ().load_uri (get_uri ());+	}++	public override string get_uri () {+		Font font = Supplement.get_current_font ();+		string path = @"$(font.get_name ()).html";+		File dir = font.get_folder ();+		File file = dir.get_child (path);+		+		if (!file.query_exists ()) {+			ExportTool.generate_html_document ((!)file.get_path (), font);				+		}++		return @"file://$((!)file.get_path ())";+	}+}+}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112