firstly, sorry for the long delay. A public holiday in parts of germany.

On Fri, Oct 29, 1999 at 05:28:37PM +0200, Marc Lehmann wrote:
> I dont understand this conclusion.. Do you mean the "top" (or the
> baseline) of the two text layers doesnt match, or do you mean that the
> baselines agree while the layers are sized differently?
to clarify this a bit consider this script (sorry for the clumsy
perl - its my graphiclanguage-to-perl-translator, I have cut and pastet from
the debug output so please ignore the linenumbering :):
 3: use Gimp;
 4: Gimp::Net::gimp_init();
 5: my $gimpl={};
 7: $gimpl->{img}=gimp_image_new(200,200,RGB_IMAGE);
 9: gimp_image_add_layer($gimpl->{bg},-1);
10: gimp_palette_set_background([0xFF,0xFF,0xFF]);
11: $gimpl->{bg}->gimp_drawable_fill(BG_IMAGE_FILL);
13: gimp_palette_set_foreground([0x00,0x00,0x00]);
16: $gimpl->{small}->gimp_layer_set_offsets(0,10);
18: gimp_palette_set_foreground([0x00,0x00,0x00]);
21: $gimpl->{big}->gimp_layer_set_offsets(100,10);
22: wm3print(qq{ });
23: $gimpl->{img}->gimp_display_new;

This script produces an image which has two gdtextlayers. One with
Aumlaut-q and one with r-u.

Though both are positioned at equal y positions they are not on the
same text-baseline.

> Yes, you could use Gimp->text_get_extents to get the position of the
> baseline, and the maximum size (measure XygjZ79 or something similar to
> be sure ;) then you can resize the layer after it was created.
gimp_text_get_extents returns 62, 53, 43, 10 and 46, 53, 43, 10
which seems correct to me. 

Now, why does gimp_text put the top of q and ru on the same line.
The bottom of ru should be on the same y-pos as the baseline of q.

BTW: Using the gimp-GUI does produce a different result. The two
textlayers have the same height now, though ru is still at the top.

The "right" approach to me seems to patch gimp_text and not to create a 
new wrapper which positions them correctly. 

Thanks anyway


http://www.dmcs.de/    mailto:[EMAIL PROTECTED]       Tel: 07 21/9 20 60-42
digital marketing concepts & services GmbH       Fax: 07 21/9 20 60-30

martin:x:518:112:Martin Treusch von Buttlar:/home/martin:/usr/bin/perl

Reply via email to