RSS/Atom feed Twitter
Site is read-only, email is disabled

gimp images with text

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

gimp images with text Luke R. 09 Jun 18:15
  gimp images with text Sven Neumann 09 Jun 21:25
   gimp images with text Luke R. 10 Jun 14:48
    gimp images with text Sven Neumann 12 Jun 10:25
Luke R.
2009-06-09 18:15:01 UTC (over 15 years ago)

gimp images with text

Hi

I'm trying to migrate a suite of legacy code running gimp 1.2 on Redhat to a Debian platform and gimp 2.4 .

I am starting gimp with /usr/bin/gimp --no-interface --console-messages --verbose --batch '(extension-perl-server 1 0 0)'

The old perl code probably needs updating, but at the moment it calls text_get_extents like so:

return Gimp::text_get_extents(undef, $text, $size, PIXELS, $foundry, $font, $weight, $slant, 'normal', '*', '*', '*');

There seem to be a couple of problems. When the $text contains anything other than [a-z], [A-Z], [0-9], gimp_text_get_extents fails, saying it was called with an invalid argument.

Also, when the code does create an image with text, I'm not convinced gimp is using the font I'm requesting.

Any help much appreciated.

Sven Neumann
2009-06-09 21:25:04 UTC (over 15 years ago)

gimp images with text

Hi,

On Tue, 2009-06-09 at 18:15 +0200, Luke R. wrote:

There seem to be a couple of problems. When the $text contains anything other than [a-z], [A-Z], [0-9], gimp_text_get_extents fails, saying it was called with an invalid argument.

You need to make sure that your text is in UTF-8 encoding.

Also, when the code does create an image with text, I'm not convinced gimp is using the font I'm requesting.

Font selection changed completely with GIMP 2.0. There's some compatibility code that tries to map the X Logical Font Description font names from the old days to a font-config font description, but this code is probably not perfect.

Sven

Luke R.
2009-06-10 14:48:01 UTC (over 15 years ago)

gimp images with text

There seem to be a couple of problems. When the $text contains anything other than [a-z], [A-Z], [0-9], gimp_text_get_extents fails, saying it was called with an invalid

argument.

You need to make sure that your text is in UTF-8 encoding.

Thanks. That fixed it.

Also, when the code does create an image with text, I'm not convinced gimp

is

using the font I'm requesting.

Font selection changed completely with GIMP 2.0. There's some compatibility code that tries to map the X Logical Font Description font names from the old days to a font-config font description, but this code is probably not perfect.

Could you give me some more detail on this? How does the mapping work?
I am having a problem in particular with Avantgarde from foundry urw. It seems to be reverting to a more Helvetica-like font.

Thanks Luke

Sven Neumann
2009-06-12 10:25:58 UTC (over 15 years ago)

gimp images with text

Hi,

On Wed, 2009-06-10 at 14:48 +0200, Luke R. wrote:

Could you give me some more detail on this? How does the mapping work?
I am having a problem in particular with Avantgarde from foundry urw. It seems to be reverting to a more Helvetica-like font.

Just stop using the old-style font definition and use a fontconfig font pattern instead. Have a look at the fontconfig documentation that is most likely installed on your computer. My Debian system installs it at /usr/share/doc/fontconfig/fontconfig-user.html

Sven