From: Jan Behrens Date: Sat, 29 Sep 2012 16:15:59 +0000 (+0200) Subject: Improved (fixed?) the spacing between differently colored character groups in the... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e278a828ebb381ba80b3981e4c0818135ede0f1d;p=xonotic%2Fxonstat.git Improved (fixed?) the spacing between differently colored character groups in the playernick --- diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 813594d..70e6ef3 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -275,8 +275,13 @@ class Skin: break # determine width of single whitespace for later use - xoff, yoff, tw, th = ctx.text_extents("_")[:4] + xoff, yoff, tw, th = ctx.text_extents("_ _")[:4] space_w = tw + xoff, yoff, tw, th = ctx.text_extents("__")[:4] + space_w -= tw + + # this hilarious line should determine the spacing between characters + sep_w = int(0.25 * space_w) # split nick into colored segments xoffset = 0 @@ -317,7 +322,7 @@ class Skin: ctx.show_text(txt) tw += (len(txt)-len(txt.strip())) * space_w # account for lost whitespaces - xoffset += tw + 2 + xoffset += tw + sep_w ## print elos and ranks