(1.0,1.0,0.0),
(0.2,0.4,1.0),
(0.2,1.0,1.0),
- (1.0,0.2,102),
+ (1.0,0.2,0.4),
(1.0,1.0,1.0),
(0.6,0.6,0.6),
(0.5,0.5,0.5)
# fontsize is reduced if width gets too large
ctx.select_font_face(self.font, C.FONT_SLANT_NORMAL, C.FONT_WEIGHT_NORMAL)
shrinknick = 0
- while shrinknick < 10:
+ while shrinknick < 0.6 * self.nick_fontsize:
ctx.set_font_size(self.nick_fontsize - shrinknick)
xoff, yoff, tw, th = ctx.text_extents(stripped_nick)[:4]
if tw > self.nick_maxwidth:
- shrinknick += 2
+ shrinknick += 1
continue
break
r,g,b = _dec_colors[int(tag[0])]
else:
r,g,b = _dec_colors[7]
-
+
+ xoff, yoff, tw, th = ctx.text_extents(txt)[:4]
ctx.set_source_rgb(r, g, b)
- ctx.move_to(self.nick_pos[0] + xoffset, self.nick_pos[1])
+ ctx.move_to(self.nick_pos[0] + xoffset - xoff, self.nick_pos[1])
ctx.show_text(txt)
- xoff, yoff, tw, th = ctx.text_extents(txt)[:4]
tw += (len(txt)-len(txt.strip())) * space_w # account for lost whitespaces
xoffset += tw + 2