diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-26 18:54:11 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-26 18:54:11 +0100 |
commit | 2373dfbb9b3c066fba670fa84560eac44bddc8cb (patch) | |
tree | bf6e3dfb6ef69eda2605d95ac88f5bc10f106992 | |
parent | plane 0 text drawing (diff) | |
download | xpybar-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 '')
-rwxr-xr-x | src/__main__.py | 6 |
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_)): |