+ text = g_strdup(t->string);
+ l = strlen(text);
+ m = font_measure_string(t->font, text, t->shadow, t->offset);
+ while (l && m > position->width) {
+ text[--l] = '\0';
+ m = font_measure_string(t->font, text, t->shadow, t->offset);
+ }
+ if (!l) return;
+
+ switch (t->justify) {
+ case Justify_Left:
+ x = position->x;
+ break;
+ case Justify_Right:
+ x = position->x + (w - m);
+ break;
+ case Justify_Center:
+ x = position->x + (w - m) / 2;
+ break;
+ }