RSS/Atom feed Twitter
Site is read-only, email is disabled

Setting text markup from python script

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Setting text markup from python script Burbly 06 Sep 19:48
2014-09-06 19:48:43 UTC (over 9 years ago)
postings
1

Setting text markup from python script

[Working on WinXP/Win 8, GIMP 2.8.14, Python 2.7.5 started via GIMP's menu.]

I'm using Python scripting to create a large number of GIMP images from templates. The images contain some text fields, and some words in the paragraphs of text need markup applied (e.g. bold, or colour). AFAICS, since gimp-text-layer-set-markup isn't available in the pdb, there's no way to do this. (Cf. https://bugzilla.gnome.org/show_bug.cgi?id=724101 for more context -- as I'm working on Windows, I unfortunately can't just apply the patch.)

I think I'm going to have to write my own mini text-formatting algorithm -- use GIMP to insert a word (with appropriate formatting), measure its dimensions, move a space's width to the right, insert the next word, and so on, until there's no more room for the next word, at which point you wrap a line + start again. But before implementing that I thought it was asking if there was any workaround that would just let me use markup!

thanks, Mohan