From 88d861f38052cbc2f4f80659259ffa73b5eb5e7e Mon Sep 17 00:00:00 2001 From: Thorsten Vitt Date: Mon, 22 May 2017 16:44:53 +0200 Subject: [PATCH] Install a profile with our fonts as default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Possible workaround for #13, but attn! installs our fonts to the user's profile! (or at least tries to …) --- pom.xml | 19 +++++++++++++++++++ .../gen/DiplomaticConversion.java | 2 ++ src/main/profile/prefs.js | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 src/main/profile/prefs.js diff --git a/pom.xml b/pom.xml index 37f6acd..15f18f6 100644 --- a/pom.xml +++ b/pom.xml @@ -340,6 +340,11 @@ false ${project.build.directory}/www + + src/main/profile + false + ${project.build.directory}/profile + @@ -433,6 +438,20 @@ + + install-fonts + true + + + + src/main/web/webfonts + ${user.home}/.fonts + *.ttf + + + + + exist diff --git a/src/main/java/net/faustedition/gen/DiplomaticConversion.java b/src/main/java/net/faustedition/gen/DiplomaticConversion.java index 625ca7d..c8f08ea 100644 --- a/src/main/java/net/faustedition/gen/DiplomaticConversion.java +++ b/src/main/java/net/faustedition/gen/DiplomaticConversion.java @@ -55,6 +55,7 @@ public class DiplomaticConversion { public static Path root = Paths.get("data/xml/"); public static Path target = Paths.get("target"); + public static Path profile = target.resolve("profile"); public static final Path diplomatic_path = target.resolve("www").resolve("transcript").resolve("diplomatic"); private static String serverURL; @@ -219,6 +220,7 @@ public static void main(final String[] args) throws IOException { logger.info(MessageFormat.format("Web server runs on {0}", serverURL)); baseCmdLine = ImmutableList.of( System.getProperty("phantomjs.binary", "/usr/local/bin/phantomjs"), + "--profile", profile, debugPhantomJS? "--debug=true" : "", "rendersvgs.js", serverURL); diff --git a/src/main/profile/prefs.js b/src/main/profile/prefs.js new file mode 100644 index 0000000..bac5375 --- /dev/null +++ b/src/main/profile/prefs.js @@ -0,0 +1,6 @@ +user_pref("font.name.monospace.x-unicode", "Ubuntu Mono"); +user_pref("font.name.monospace.x-western", "Ubuntu Mono"); +user_pref("font.name.sans-serif.x-unicode", "Ubuntu Faust"); +user_pref("font.name.sans-serif.x-western", "Ubuntu Faust"); +user_pref("font.name.serif.x-unicode", "Gentium Plus"); +user_pref("font.name.serif.x-western", "Gentium Plus");