- static text_prop_t tp_cache[] = { {-1,"",NULL}, {-1,"",NULL}, {-1,"",NULL}, {-1,"",NULL}, {-1,"",NULL}, {-1,"",NULL}};
-
- if (tp_cache[prop].font_desc == NULL){
- tp_cache[prop].font_desc = pango_font_description_new();
- im->text_prop[prop].font_desc = pango_font_description_copy (tp_cache[prop].font_desc);
- }
-
- if (font != NULL && strcmp(tp_cache[prop].font,font) != 0){
- pango_font_description_free(tp_cache[prop].font_desc);
- pango_font_description_free(im->text_prop[prop].font_desc);
- tp_cache[prop].font_desc = pango_font_description_from_string( font );
- im->text_prop[prop].font_desc = pango_font_description_copy( tp_cache[prop].font_desc );
- strncpy(tp_cache[prop].font, font, sizeof(text_prop[prop].font) - 1);
- tp_cache[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
- strcpy(im->text_prop[prop].font,tp_cache[prop].font);
- }
- if (size != 0 && size != (tp_cache[prop].size)){
- pango_font_description_set_size(tp_cache[prop].font_desc, size * PANGO_SCALE);
- pango_font_description_set_size(im->text_prop[prop].font_desc, size * PANGO_SCALE);
+ if (font){
+ strncpy(im->text_prop[prop].font, font, sizeof(text_prop[prop].font) - 1);
+ im->text_prop[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
+ im->text_prop[prop].font_desc = pango_font_description_from_string( font );
+ };
+ if (size > 0){