Vertical text on the right side.. I do not understand how?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
AKapaceb
Posts: 8
Joined: 2019-03-21T00:52:55-07:00
Authentication code: 1152

Vertical text on the right side.. I do not understand how?

Post by AKapaceb »

Friends,
help with the command please!

In the picture on the left side, the text is obtained using the command:

Code: Select all

convert input.jpg -set option:my:left_edge '0,%[fx:h/2]' \
          \( -font '/var/www/photos/fonts/10051.ttf' -pointsize 50 -background none label:'Long Long Text Here' \
             +distort SRT '%[fx:w/2],%h 1 90 %[my:left_edge]' \
          \) -flatten example.jpg
But I need a text that is placed on the right side of the picture (i marked red color). How to do it? I went through all the options, I do not understand ..

Help me please!
Thanks!

Image
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Vertical text on the right side.. I do not understand how?

Post by GeeMack »

AKapaceb wrote: 2019-03-22T11:58:32-07:00In the picture on the left side, the text is obtained using the command:

Code: Select all

convert input.jpg -set option:my:left_edge '0,%[fx:h/2]' \
          \( -font '/var/www/photos/fonts/10051.ttf' -pointsize 50 -background none label:'Long Long Text Here' \
             +distort SRT '%[fx:w/2],%h 1 90 %[my:left_edge]' \
          \) -flatten example.jpg
But I need a text that is placed on the right side of the picture (i marked red color). How to do it?

I don't have a *nix shell to test this, but a few minor changes to your command should do it. Try this...

Code: Select all

convert input.jpg  -set option:my:right_edge '%[w],%[fx:h/2]' \
          \( -font '/var/www/photos/fonts/10051.ttf' -pointsize 50 -background none label:'Long Long Text Here' \
             +distort SRT '%[fx:w/2],%h 1 -90 %[my:right_edge]' \
          \) -flatten example.jpg
That sets the location variable to the right edge "%[w]" instead of the left "0". It also rotates the label -90 degrees instead of 90.
AKapaceb
Posts: 8
Joined: 2019-03-21T00:52:55-07:00
Authentication code: 1152

Re: Vertical text on the right side.. I do not understand how?

Post by AKapaceb »

Excellent! It worked!

Thank very you, kind man!
Post Reply