Post Reply 

newline in a text layer

Feb 12, 2012, 16:28
Post: #1
newline in a text layer
One of the button creation plugins creates a text layer using gimp_text_layer_new which takes a gchar * parameter. How do I insert a newline? I tried '\n' in the string and got a striked-through 'W'. Thank you.
Find all posts by this user
Quote this message in a reply
Feb 12, 2012, 19:41
Post: #2
RE: newline in a text layer
(Feb 12, 2012 16:43)ofnuts Wrote:  What language are you using? C? Never tried that one. IIRC Gimp uses UTF-8 encoded strings so maybe you \n was grouped with a previous byte?

The button plugin is Python-Fu. The current button text is retrieved using PF_STRING, but I was wondering whether PF_TEXT would work, but more important is what gimp_text_layer_new does with the value. Is there an escape sequence for newline.

I suppose I could download the source to gimp and figure out what the function does, but was hoping it was some bit of common knowledge I was missing. Several comments on the different button plugins asked about multi-line text, but no one had replied to them.
Find all posts by this user
Quote this message in a reply
Feb 13, 2012, 00:52
Post: #3
RE: newline in a text layer
That worked! Great. Thank you! And it was Windows 7.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Script-fu: How to create new, addressable layer using gimp-floating-sel-to-layer Bertholomäus 1 614 Aug 31, 2017 14:32
Last Post: Bertholomäus
  Setting text markup from python script Burbly 1 724 Sep 16, 2014 12:29
Last Post: Burbly
  Accented characters wihtin "text string" prevent script from loading Shadowes 1 576 Aug 28, 2014 15:37
Last Post: Shadowes
  Change menuitem text in plugin Barbie 1 530 Aug 11, 2014 03:16
Last Post: Barbie
  Getting Layer Effects on GIMP 2.8 for Mac Q A 4 1,704 May 28, 2014 23:58
Last Post: Esper

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS