07-03-2022, 03:59 PM
(07-02-2022, 03:53 PM)jake51188 Wrote: How would you be able to change one text box and it change multiple other text boxes on the same layer or different layers? Ideally linking multiple text boxes together.
Use case: I have a letter that sits on 12 places on an image. Every day I need to change that letter, instead of changing 12 different text boxes, could I just change one and it auto edit the rest?
Thanks,
Jake
Assuming that you just want to change one particular character for another single character I can think of two ways.
The first, and neater, of the two methods would be to write a (fairly) simple script (ideally in Python). This would accept the new character (as a one character string) and then use the gimp-image-get-layer-by-name function once for each of the text layers and then use the gimp-text-layer-get-text and gimp-text-layer-set-text functions to set the updated text for that layer.
The second, not recommended, method would be to write a program that would open the GIMP xcf file in binary mode and scan through it searching for and then changing the text strings before saving the file (or a copy of it)
Neither method is a particularly easy solution for GIMP. I don't know much about imagemagick but perhaps you could use that to add the relevant text to a base image produced by GIMP. On balance, if it was something I had to do each day, I would go for the first option noted above and write a script.