Hello!
please, help me to find out how annotation works.
I need to write text vertically. I just write text in a usual way using "\n", like "A\nB\nC\n".
The problem is how to control vertical distance between the characters.
Something similar to line-height in HTML.
Could you please suggest me anything?
vertical text
Re: vertical text
I belive the spacing between the characters will be set by the font.
I wrote some code before putting the characters into a sized canvas:
I wrote some code before putting the characters into a sized canvas:
Code: Select all
<?php
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"R\" \" R.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"u\" \" u.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"b\" \" b.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"l\" \" l.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"e\" \" e.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"w\" \" w.gif");
exec("convert -size 20x20 xc:white -fill black -pointsize 20 -gravity center \\
-draw \" text 0,0 \"s\" \" s.gif");
exec("convert -background none -gravity Center \\
R.gif u.gif b.gif b.gif l.gif e.gif w.gif e.gif b.gif s.gif -append text_vertical.gif");
// Delete the tempory images
$delete = array('R.gif','u.gif','b.gif','l.gif','e.gif','w.gif','s.gif');
foreach ($delete as $value) {
unlink($value); }
?>
Another method :
<?php
$string="TEXT";
for ($pos = 0; $pos < strlen($string); $pos++)
if ( $pos != strlen($string)-1 ){
$modified .= substr($string, $pos, 1)."\\n"; }
else $modified .= substr($string, $pos, 1);
exec("convert -pointsize 20 -gravity center label:$modified label_vertical1.gif");
//With this code you can automaticaly add the \n to every character in the string.
//The last character will not have a \n
?>
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: vertical text
IM does not have interline spacing at this time to my knowledge. I will defer to the IM folks to correct me. So the best you can do is use \n as many times as you want between characters. Not very good solution but I think that is all there is.
see
http://www.imagemagick.org/Usage/text/#label_vertical
see
http://www.imagemagick.org/Usage/text/#label_vertical
Re: vertical text
We added an -interline-spacing option in the Subversion trunk, available by sometime tomorrow.
Re: vertical text
Many thanks! I wonder, that nobody needs it before
But I have framework on Perl and use perl-magick. Is it possible to add "-interline-spacing" as a parameter to Annotate function?
But I have framework on Perl and use perl-magick. Is it possible to add "-interline-spacing" as a parameter to Annotate function?
Re: vertical text
Already done. Grab ImageMagick-6.5.5-8 Beta sometime tomorrow.
Re: vertical text
I just made
#svn co https://www.imagemagick.org/subversion/ ... gick/trunk ImageMagick
The last record in ChangeLog was made on 2009-08-31 for version 6.5.5-6
Is ChangeLog not up-to-date?
Also, how do you think, is it safe to roll out 6.5.5-8 on production server?
#svn co https://www.imagemagick.org/subversion/ ... gick/trunk ImageMagick
The last record in ChangeLog was made on 2009-08-31 for version 6.5.5-6
Is ChangeLog not up-to-date?
Also, how do you think, is it safe to roll out 6.5.5-8 on production server?
Re: vertical text
6.5.5-8 will be released as a production release later today.
Re: vertical text
Great ! Thanks for adding -interline-spacing. I was just looking after it.
I compiled 6.5.5-9 and it works fine.
I compiled 6.5.5-9 and it works fine.