aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorPjotr Prins2019-02-18 10:10:56 +0000
committerBonfaceKilz2020-08-10 19:27:05 +0300
commitc1b1c914b10781715bb6a2e7fc061e6e506fb92f (patch)
treea1e5a973c6f2248ab9df33186d1d8dd2b1b3834b /wqflask
parent3a8409757e2e095cd18c483de07af1eed8719c02 (diff)
downloadgenenetwork2-c1b1c914b10781715bb6a2e7fc061e6e506fb92f.tar.gz
Add fonts for pillow
* wqflask/wqflask/marker_regression/display_mapping_results.py: replace piddle method with PIL.ImageFont * wqflask/wqflask/static/fonts: Add fonts in path
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py15
-rw-r--r--wqflask/wqflask/static/fonts/README1
-rw-r--r--wqflask/wqflask/static/fonts/arial.ttfbin0 -> 151232 bytes
-rw-r--r--wqflask/wqflask/static/fonts/fnt_bs.ttfbin0 -> 20988 bytes
-rw-r--r--wqflask/wqflask/static/fonts/trebucbd.ttfbin0 -> 123828 bytes
-rw-r--r--wqflask/wqflask/static/fonts/verdana.ttfbin0 -> 139640 bytes
6 files changed, 10 insertions, 6 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index 9b406b72..6f50601d 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -72,10 +72,13 @@ MEDIUMPURPLE = ImageColor.getrgb("mediumpurple")
# ---- END: Define common colours ---- #
# ---- FONT FILES ---- #
-VERDANA_FILE = "fonts/ttf/verdana.ttf"
-TREBUC_FILE = "fonts/ttf/trebucbd.ttf"
-FNT_BS_FILE = "fonts/ttf/fnt_bs.ttf"
-ARIAL_FILE = "fonts/ttf/arial.ttf"
+VERDANA_FILE = "./wqflask/static/fonts/verdana.ttf"
+TREBUC_FILE = "./wqflask/static/fonts/trebucbd.ttf"
+FNT_BS_FILE = "./wqflask/static/fonts/fnt_bs.ttf"
+ARIAL_FILE = "./wqflask/static/fonts/arial.ttf"
+
+assert(os.path.isfile(VERDANA_FILE))
+
# ---- END: FONT FILES ---- #
#########################################
@@ -2008,8 +2011,8 @@ class DisplayMappingResults(object):
js_data['max_score'] = LRS_LOD_Max
self.js_data = json.dumps(js_data)
- LRSScaleFont=pid.Font(ttf="verdana", size=16*zoom, bold=0)
- LRSLODFont=pid.Font(ttf="verdana", size=18*zoom*1.5, bold=0)
+ LRSScaleFont=ImageFont.truetype(font=VERDANA_FILE, size=16*zoom)
+ LRSLODFont=ImageFont.truetype(font=VERDANA_FILE, size=int(18*zoom*1.5))
yZero = yTopOffset + plotHeight
LRSHeightThresh = drawAreaHeight
diff --git a/wqflask/wqflask/static/fonts/README b/wqflask/wqflask/static/fonts/README
new file mode 100644
index 00000000..75a3e444
--- /dev/null
+++ b/wqflask/wqflask/static/fonts/README
@@ -0,0 +1 @@
+These fonts are used by pillow for 'interval mapping'
diff --git a/wqflask/wqflask/static/fonts/arial.ttf b/wqflask/wqflask/static/fonts/arial.ttf
new file mode 100644
index 00000000..bf0d4a95
--- /dev/null
+++ b/wqflask/wqflask/static/fonts/arial.ttf
Binary files differ
diff --git a/wqflask/wqflask/static/fonts/fnt_bs.ttf b/wqflask/wqflask/static/fonts/fnt_bs.ttf
new file mode 100644
index 00000000..712c38cf
--- /dev/null
+++ b/wqflask/wqflask/static/fonts/fnt_bs.ttf
Binary files differ
diff --git a/wqflask/wqflask/static/fonts/trebucbd.ttf b/wqflask/wqflask/static/fonts/trebucbd.ttf
new file mode 100644
index 00000000..1ab1ae0a
--- /dev/null
+++ b/wqflask/wqflask/static/fonts/trebucbd.ttf
Binary files differ
diff --git a/wqflask/wqflask/static/fonts/verdana.ttf b/wqflask/wqflask/static/fonts/verdana.ttf
new file mode 100644
index 00000000..754a9b7b
--- /dev/null
+++ b/wqflask/wqflask/static/fonts/verdana.ttf
Binary files differ