From 288e753eea066ef1fbf08c199ac1a688ce3103c2 Mon Sep 17 00:00:00 2001
From: Brad Davis <bdavis@saintandreas.org>
Date: Mon, 22 Jan 2018 16:48:00 -0800
Subject: [PATCH] Fix font loading from non-QRC html

---
 interface/CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index 16c57e2ea2..383c50ed44 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -305,6 +305,14 @@ else()
     COMMAND "${CMAKE_COMMAND}" -E copy_if_different 
     "${RESOURCES_RCC}" 
     "$<TARGET_FILE_DIR:interface>"
+    # FIXME, the edit script code loads HTML from the scripts folder
+    # which in turn relies on CSS that refers to the fonts.  In theory
+    # we should be able to modify the CSS to reference the QRC path to 
+    # the ttf files, but doing so generates a CORS policy violation, 
+    # so we have to retain a copy of the fonts outside of the resources binary
+    COMMAND "${CMAKE_COMMAND}" -E copy_directory
+    "${PROJECT_SOURCE_DIR}/resources/fonts"
+    "$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/fonts"
     COMMAND "${CMAKE_COMMAND}" -E copy_directory
     "${CMAKE_SOURCE_DIR}/scripts"
     "$<TARGET_FILE_DIR:${TARGET_NAME}>/scripts"