aboutsummaryrefslogtreecommitdiff
path: root/host/matelight/config.py
diff options
context:
space:
mode:
authorjaseg <jaseg@jaseg.net>2013-12-26 17:11:39 +0100
committerjaseg <jaseg@jaseg.net>2013-12-26 17:11:39 +0100
commit5453ec53e99d56171a2059f2e9705d1f1ae9ce83 (patch)
treed3e6886015e2bc45c088320e6b2307435b6a0b49 /host/matelight/config.py
parent93592ee43978005a86e0d83486c7b866e2c1b61f (diff)
downloadmatelight-5453ec53e99d56171a2059f2e9705d1f1ae9ce83.tar.gz
matelight-5453ec53e99d56171a2059f2e9705d1f1ae9ce83.tar.bz2
matelight-5453ec53e99d56171a2059f2e9705d1f1ae9ce83.zip
Uhm, foo.
Diffstat (limited to 'host/matelight/config.py')
-rw-r--r--host/matelight/config.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/host/matelight/config.py b/host/matelight/config.py
index d8cdde1..2177292 100644
--- a/host/matelight/config.py
+++ b/host/matelight/config.py
@@ -1,3 +1,4 @@
+import bdflib # Used to read the bitmap font
# Hard timeout in seconds after which (approximately) the rendering of a single item will be cut off
RENDERER_TIMEOUT = 20.0
@@ -8,12 +9,18 @@ DEFAULT_SCROLL_SPEED = 4
# Pixels to leave blank between two letters
LETTER_SPACING = 1
+FONT = bdflib.reader.read_bdf(open('fonts/5x8.bdf').readlines())
+FONT_WIDTH = 5
+
+# Computed value
+FONT_PADDED_BINARY = ('{:0'+str(FONT_WIDTH+'b}').format
+
# Display geometry
-# ┌─────────┐ ┌──┬──┬──┬ ⋯ ┬──┬──┬──┐
-# │1 o o o 5│ │ 1│ │ │ │ │ │16│
-# │6 o o o o│ ├──┼──┼──┼ ⋯ ┼──┼──┼──┤
-# │o o o o o│ │17│ │ │ │ │ │32│
-# │o o o o20│ └──┴──┴──┴ ⋯ ┴──┴──┴──┘
+# ┌─────────┐ ┌───┬───┬ ⋯ ┬───┬───┐
+# │1 o o o 5│ │ 1 │ │ │ │16 │
+# │6 o o o o│ ├───┼───┼ ⋯ ┼───┼───┤
+# │o o o o o│ │17 │ │ │ │32 │
+# │o o o o20│ └───┴───┴ ⋯ ┴───┴───┘
# └─────────┘
CRATE_WIDTH = 5
CRATE_HEIGHT = 4