Is there any reason why you can't do this via CSS? That would be the way to do it. If there is any reason why you can't do it with CSS, you can use gtk_text_set_attributes
, but each time you change the size, you should clear the contents of "attributes" and only then add the new contents. This will probably avoid increasing memory usage.