From 2373dfbb9b3c066fba670fa84560eac44bddc8cb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 26 Feb 2014 18:54:11 +0100 Subject: font metrics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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_)): -- cgit v1.2.3-70-g09d2