caption is breaking words... ugh
caption is breaking words... ugh
Firstly running latest version... have all depend.. etc...
BUT
with a function as easy as:
convert -size (whatever size) -font myfont.ttf -background black -fill white caption:'jennifer winningham' comp.png
everything is irrelevant really because if I don't specify a pointsize imagemagick is supposed to fit it correctly, so specifeng size.
So if the caption was "Jennifer Winningham".. it's outlaying like this:
Jennifer
Wiinning
ham
ummmm, what's going on? lol
BUT
with a function as easy as:
convert -size (whatever size) -font myfont.ttf -background black -fill white caption:'jennifer winningham' comp.png
everything is irrelevant really because if I don't specify a pointsize imagemagick is supposed to fit it correctly, so specifeng size.
So if the caption was "Jennifer Winningham".. it's outlaying like this:
Jennifer
Wiinning
ham
ummmm, what's going on? lol
Re: caption is breaking words... ugh
Everything is not irrelavent; if you have a long thin box it will be on one line but if you have a tall narrow box it will break up the text so what did you use for the size?
Re: caption is breaking words... ugh
Well silly me your right... hmmm... I just used a simple size of 100x100.. here is the exact code with simple syntax.
I could have swore caption resizes the pointsize to fill correctly, and not to break the word.
and not:
Jennifer
winning
ham
Code: Select all
<?php
// Set the path of convert command for imagemagick
$path = "/opt/local/bin/";
// Set which font we want to use
$font = "font/trace_edit.ttf";
$capfont = "font/corbel.ttf";
$text = "Jennifer\nwinningham";
$final = $path."convert -size 100x100 -font ".$capfont." -background black -fill white caption:\"".$text."\" final.png";
exec($final, $result);
header("Location: final.png");
?>
and not:
Jennifer
winning
ham
Re: caption is breaking words... ugh
We can reproduce the problem you posted and have a patch in ImageMagick 6.6.4-6 Beta available by sometime tomorrow. Thanks.
Re: caption is breaking words... ugh
Well spotted I was not thinking about the word being split and have just tried it and have the same problem on 6.5.9
Out of interest I do not use the ( can not remember the word for it ) ". ." around variables and it still works and so would use;
Not sure about the $path at the start as didn't test that. I tend to use convert all the time and so I would add the convert to the $path variable.
Out of interest I do not use the ( can not remember the word for it ) ". ." around variables and it still works and so would use;
Code: Select all
$final = "$path convert -size 100x100 -font $capfont -background black -fill white caption:\"$text\" final.png";
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption is breaking words... ugh
ASIDE:
however you can also use "$path/convert ..." as it does not matter if the slash on the end of $path gets doubled or not.
You will need to some how append without spaces $path and convert EG: $pathconvert however as that can not posibly work you also need to soemhow delimit the variable name in most languages (shell perl etc., don't know PHP) you use ${..} so that should be... "${path}convert ...."Bonzo wrote:Out of interest I do not use the ( can not remember the word for it ) ". ." around variables and it still works and so would use;Not sure about the $path at the start as didn't test that. I tend to use convert all the time and so I would add the convert to the $path variable.Code: Select all
$final = "$path convert -size 100x100 -font $capfont -background black -fill white caption:\"$text\" final.png";
however you can also use "$path/convert ..." as it does not matter if the slash on the end of $path gets doubled or not.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption is breaking words... ugh
Hey Magick,
Anything on a new patch for caption yet?
Thanks in advance!
Immortal
Anything on a new patch for caption yet?
Thanks in advance!
Immortal
Re: caption is breaking words... ugh
The patch is available now in ImageMagick 6.6.4-6 Beta. 6.6.4-6 will be released within a few days.
Re: caption is breaking words... ugh
Hey Magick,
I appreciate all the help, but it seems I stumbled upon another problem with caption.
When trying to use kerning is seems to still wrap in the middle of a word without reducing the pointsize.
I would hope kerning would work... can you reproduce a kerning problem with latest build you released with caption.
Thanks again for the help.
I appreciate all the help, but it seems I stumbled upon another problem with caption.
When trying to use kerning is seems to still wrap in the middle of a word without reducing the pointsize.
I would hope kerning would work... can you reproduce a kerning problem with latest build you released with caption.
Thanks again for the help.
Re: caption is breaking words... ugh
Post a caption command that fails. We need to reproduce the problem before we can comment.
Re: caption is breaking words... ugh
Code: Select all
$final = $path."convert -font ".$capfont." -kerning 40 -background black -gravity center -fill white -size 1000x500 caption:\"".$text."\" final.png";
Re: caption is breaking words... ugh
What is an example text? We tried your command with a some text and the caption appeared ok. Are you using Windows or Linux?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: caption is breaking words... ugh
Just a thought, but perhaps his very large -kerning 40 is putting so much space between characters that IM is having a hard time distinguishing words.
Does this word breaking happen with a small or no kerning?
Does this word breaking happen with a small or no kerning?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption is breaking words... ugh
word delimiting would not depend on kerning which is simply passed to the font rendering library.fmw42 wrote:Just a thought, but perhaps his very large -kerning 40 is putting so much space between characters that IM is having a hard time distinguishing words.
Does this word breaking happen with a small or no kerning?
All it does is make the words longer, so Im has trouble fitting the words into the specified width.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/