diff --git a/changefont.py b/changefont.py index 9e30bcf..b7302d7 100755 --- a/changefont.py +++ b/changefont.py @@ -6,15 +6,18 @@ from gimpfu import * -def python_change_font(img, fontsize, fontface, fontcolor): +def python_change_font(img, changesize, fontsize, changeface, fontface, changecolor, fontcolor): pdb.gimp_image_undo_group_start(img) for l in img.layers: if not pdb.gimp_item_is_text_layer(l): continue - pdb.gimp_text_layer_set_font_size(l, fontsize, 0) - pdb.gimp_text_layer_set_font(l, fontface) - pdb.gimp_text_layer_set_color(l, fontcolor) + if changesize: + pdb.gimp_text_layer_set_font_size(l, fontsize, 0) + if changeface: + pdb.gimp_text_layer_set_font(l, fontface) + if changecolor: + pdb.gimp_text_layer_set_color(l, fontcolor) pdb.gimp_image_undo_group_end(img) @@ -29,9 +32,12 @@ def python_change_font(img, fontsize, fontface, fontcolor): "*", [ (PF_IMAGE, "image", "Input image", None), + (PF_BOOL, "changesize", "Change Font Size", FALSE), (PF_SPINNER, "fontsize", "New Font Size", - 14, (1, 50, 1)), + 14, (1, 250, 1)), + (PF_BOOL, "changeface", "Change Font", FALSE), (PF_FONT, "fontface", "New Font", "Sans"), + (PF_BOOL, "changecolor", "Change Color", FALSE), (PF_COLOR, "fontcolor", "Color", (1.0, 1.0, 0.0)), ], [],