python-fu script fails to use a PF_FONT choice (2.10.18)
GIMP version: 2.10.18
Operating System: Linux
Description of the bug
When I launch a script (which used to work on previous versions), it fails with this message on console :
Plug-in "test.py"
(/home/jazz/.config/GIMP/2.10/plug-ins/test.py)
attempted to install procedure "temp-procedure-number-1" with invalid parameter name "dialog status".
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Install the script (put the file in your user
plug-ins
folder - Launch the script (in
2-10-18
new menu) - Try to change the font
…
Expected result: Being able to change the font, then OK, and a new Text Layer saying This is a test
with the choosen font is created
Actual result: We can't choose a font.
Additional information
GIMP-Error: Plug-in "test.py"
(/home/jazz/.config/GIMP/2.10/plug-ins/test.py)
attempted to install procedure "temp-procedure-number-2" with invalid parameter name "dialog status".
Script to test :
#!/usr/bin/env python
# -*- coding: utf8 -*-
from gimpfu import pdb, register, main
from gimpfu import PF_FILE, PF_SPINNER, PF_FONT, PF_BOOL, PF_OPTION, PF_COLOR
from gimpfu import *
def add_text_layer(image, text, font, font_size,
layer_position, font_color):
"""Add text layer."""
tlayer = pdb.gimp_text_layer_new(image, text, font, 30, 0)
pdb.gimp_image_add_layer(image, tlayer, layer_position)
pdb.gimp_text_layer_set_color(tlayer, font_color)
pdb.gimp_text_layer_resize(tlayer, 500, 500)
pdb.gimp_layer_set_offsets(tlayer, 200, 200)
pdb.gimp_item_set_visible(tlayer, True)
def plugin_test_box_test(
image,
active_layer,
font,
font_size,
font_color):
""""Import text on path (plugin)."""
pdb.gimp_image_undo_group_start(image)
text = "This is a test"
add_text_layer(image, text, font, 15, 0, font_color)
pdb.gimp_image_undo_group_end(image)
# Register in Gimp
register(
"plugin_test_box_test",
"Foo",
"Bar",
"Sergeileduc",
"",
"2020-02",
"<Image>/2-10-18/Test",
"*",
# (type, name, description, default [, extra])
[
(PF_FONT, "font", "Font", 'Sans'),
(PF_SPINNER, "font_size", "Font size", 27, (1, 200, 1)),
(PF_COLOR, "font_color", "Font color", '#000000')
],
[],
plugin_test_box_test)
main()