Grafx wrote:
I am trying to apply gimp_text_fontname in a python plug-in and I want to create a new layer, not a floating layer, and the documentation in the Procedure Browser says I should be able to enter "-1" in the argument for the drawable and this will create a new layer. But this in not working in Python. I get an error message, "TypeError: wrong parameter type".
A possible work-around is gimp_text which is deprecated in preference to this gimp_text_fontname, but I can't figure out the parameters for this older version. Does anyone have a sample argument entries for this older procedure or a solution to the newer procedure?
Use None instead:
text_layer = pdb.gimp_text_fontname(image, None, 0, 0, "Test", 0, True, 60, PIXELS, "Sans")
As a general rule, the
Python interface uses the objects instead of their ids in most calls, so where -1 is used to indicate "no object" in the Scheme interface, a "None" is very likely to work in the
Python interface (yes, the help in the procedure browser is really the Scheme one)