I have completed a first cut of your script which you can download from here
, however, ...
You are going to have to alter your template file a little bit. The script is not able to handle the left and right text layers in their current form. The problem lies with the fact that the on-screen text editor creates different text than that created using the old-style text editor. Whereas a text layer created in the traditional fashion might contain "This is MY House
", when created with the onscreen editor it will contain "<markup><span font=\"Sans\"><span size=\"11796\">This is MY House</span></span></markup>
". (This latter form used by GIMP is a limited subset of the Pango markup format
Unfortunately, the interface has not yet been created
for plug-ins to set this type of markup text. There is an interface for my script to read
the markup text for a layer; however, this interface is buggy and can not be relied upon for the information I need for this script (for example, the markup for your text layers does not include the name of the font being used).
What you need to do to remedy this is:
- Double-click on the text_left layer to activate the Text Tool.
- If the Tool Options dialog is not visible, perform "Windows->Dockable Dialogs->Tool Options" to raise it (the dialog should show the options for the Text Tool).
- Click on the corresponding (left) text in the image window and then using the DELETE and BACKSPACE keys to remove all of the text.
- In the tool options dialog, choose your font and font size.
- In the tool options dialog, check the box labeled "Use editor". A small dialog box should appear somewhere on your screen.
- Enter your text into this dialog.
Repeat the above steps for the text_right
layer and then save your template. [*] In the future, do not use the on-screen editing features for creating/editing the text_left
layers. If you want to change the font or its size, use the settings in the Tool Options dialog.
The script adds the command "Filters->STW->Create Brochures..." which should be run with your template file. The template file should contain your five "dynamic" layers. These layers are identified by their names and thus should be named text_left
, and banner_image
The dialog that appears when you run the command is pretty self-explanatory.
You do, however, need to make sure that the output directory exists before you press OK -- the script is not able to create the directory (yet
). There should be an option to create a directory in the file dialog that appears when you choose "Other" from the Output Folder dropdown. The names of the files created will be of the form brochure-0001.xcf, brochure-0002.xcf, brochure-0003.xcf, ... where "brochure-" is the Output Basename specified in the dialog.
layers in the output files will have layermasks added to them. This is done so that the entire layer is available (i.e., it is not cropped) and can later be repositioned. When you use the Move Tool to reposition a layer that has an attached layermask, the mask will be moved along with the layer -- we do not want this. So...
I have added a second command "Filters->STW->STW Float Layer" that will turn the layer into a floating selection, allowing you to use the Move Tool to position the layer as you please (while the mask remains in place), anchoring the floated layer when done. The command is also available by right-clicking on the layer's thumbnail preview in the Layers Dialog.
Finally, any of the output brochure files can serve as a template. If an image_
layer has a layermask then the boundaries of the mask determine the framing of the image; if there is no mask then it is the layer itself.
Here is an example of the brochures (scaled down) produced from your example files.
You can download an example output brochure from here
(download it using the Original File link in the lower right). Note that I substituted fonts for the dynamic text layers as I did not have the ones you used on my machine.