Beispiel #1
0
def handle_rendering(text, text_size, text_font, text_color):
    key = "xcore.label."+calculate_key(text, text_size, text_font, text_color)

    label = get_label_by_key(key)

    if not label:
        logger.debug("going to create label "+_debug_key(key, text))
        text = text.encode("iso8859-1")
        label, dimensions = textimage.get_label(text, text_color, int(text_size), text_font)
        tag = _create_imgtag(key, text, dimensions)
        label = _cache_label(key, label, tag)

    return label['img_tag'], bool(label['img_tag']), key
Beispiel #2
0
 def test_get_label(self):
     label = get_label(text="HalloWelt")
     self.assertEquals("tuple", label.__class__.__name__)
Beispiel #3
0
 def test_get_label(self):
     label = get_label(text="HalloWelt")
     self.assertEquals("tuple", label.__class__.__name__)