How to place text right aligned under image?

If you have any questions regarding Quartam PDF Library for LiveCode, this is the place to get answers from your fellow users - experts and newbies alike.
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
matthias
Posts:1
Joined:Tue Sep 09, 2014 3:13 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
How to place text right aligned under image?

Post by matthias » Tue Sep 09, 2014 3:32 pm

Hi,

i have 2 images side by side on a page.
I am able to place a text under each image left aligned, so the each text is justified with the left side of the image.

Now i need to place some text under each image, which is justified right with the right edge of the image. I want the text to end at the right edge of the image. the longer the text is the more left it has to be placed.
But i am not successful.
Is this possible with the standard commands?
Or do i have to
1. calculate the x position according to the number of charcacters of the text
2. set the x positon
3. write the text left aligned
?

Regards,

Matthias

JanSchenkel
Site Admin
Posts:110
Joined:Sun Jul 18, 2010 5:21 pm
Location:Aalst, Belgium
Contact:

Re: How to place text right aligned under image?

Post by JanSchenkel » Tue Jun 02, 2015 8:16 pm

Hi Matthias,

My apologies for the ridiculously late reply. I've been lost in personal issues and am only now finding back the energy to get back to my LiveCode projects.

You have two options to tackle this:
1. use the approach you outlined, along with the function qrtPDF_WidthOfString to determine the X position
2. much easier is to use the qrtPDF_WriteTextBox command as in demo 2

Code: Select all

qrtPDF_WriteTextBox tDocRef, 160, 10, tBoxText, "bottom", "begin", "right", false
HTH,

Jan Schenkel.
Quartam Developer Tools for LiveCode
http://www.quartam.com

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable