aboutsummaryrefslogtreecommitdiffstats
path: root/src/__main__.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-26 18:54:11 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-26 18:54:11 +0100
commit2373dfbb9b3c066fba670fa84560eac44bddc8cb (patch)
treebf6e3dfb6ef69eda2605d95ac88f5bc10f106992 /src/__main__.py
parentplane 0 text drawing (diff)
downloadxpybar-2373dfbb9b3c066fba670fa84560eac44bddc8cb.tar.gz
xpybar-2373dfbb9b3c066fba670fa84560eac44bddc8cb.tar.bz2
xpybar-2373dfbb9b3c066fba670fa84560eac44bddc8cb.tar.xz
font metrics
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/__main__.py')
-rwxr-xr-xsrc/__main__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 08c0f94..f28d7f4 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -44,7 +44,11 @@ while True:
gc.change(foreground = cmap.alloc_color(0x0000, 0x0000, 0x0000).pixel)
window.fill_rectangle(gc, 0, 0, width, panel_height)
gc.change(foreground = cmap.alloc_color(0xC0C0, 0xC0C0, 0xC0C0).pixel)
- gc.change(font = display.open_font('-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*'))
+ font = display.open_font('-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*')
+ gc.change(font = font)
+ print(font.query().font_ascent)
+ print(font.query().font_descent)
+ print(font.query_text_extents("Test").overall_width)
text_ = '°°° TEST °°° ꚺ░∈𝕐 '.encode('utf-16')[2:]
text = []
for i in range(len(text_)):