0

I'm trying add text layer to image using gimp's python API. Maybe someone knows how could I add underline for text in this text layer.

textlayer=pdb.gimp_text_fontname(
                            newimage,
                            None, #layer,
                            0,
                            0,
                            'some underlined text',
                            -1,   #border
                            True, #anitalias
                            20,   #size
                            0, #GIMP_PIXELS
                            'Sans')
119Vik
  • 21
  • 3

1 Answers1

0

Unfortunatelly, there is no way to do that as of GIMP 2.8 -- one can see on the procedure browser: there is a "gimp_text_layer_get_markup call that allows one to retrieve text formatting attributes from a text layer, but there is no corresponding gimp_text_layer_set_markup.

Trying to set markup with the gimp_text_layer_set_text call will quote the tags, and render them as plain text.

The workaround for you is to use the functions to get layer and text extents, and to draw an underline using the drawing functions.

jsbueno
  • 99,910
  • 10
  • 151
  • 209