New line space - How to control it?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New line space - How to control it?

Post by fmw42 »

you need to show us your commands
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New line space - How to control it?

Post by fmw42 »

I don't understand. First your string is using label:, but you don't use your string and switch to -annotate. I think we need to see more?

Try running your commands in command line mode with specific values and see if that works, then if not show us that simple exact code, not some code snippet.

P.S. New lines use \n not /n

Your font size of 96 will cause large new line spacing, though if done right, not as big as you example is showing.

see
http://www.imagemagick.org/Usage/text/
and perhaps particularly
http://www.imagemagick.org/Usage/text/#annotate_size
http://www.imagemagick.org/Usage/anim_mods/#annotating
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New line space - How to control it?

Post by fmw42 »

What version of IM are you using? If old, perhaps upgrade?

Does it have too large spacing when you use smaller fonts?

I still don't understand why you have label: in your code? Are you using it to get -size for -annotate?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New line space - How to control it?

Post by fmw42 »

Did you try smaller pointsizes?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: New line space - How to control it?

Post by anthony »

I would first get rid of the complication of the animation. It is irrelevent in this example. But if you want a better way to the 'masked' animation see...
http://www.imagemagick.org/Usage/anim_mods/#glitter

Now as for your spacing...
I can's see any reason for it in the command line examples given. None of which MATCH the images being shown!

Though somewhere I saw a newline on the end of a "label:" string, which would add a extra blank line to the output image.
Also watch out for 'return' characters in reading text from files.

See...
http://www.imagemagick.org/Usage/text/#label_lines

Note that in text handling... pointsize is not actually text size, but line spacing in points (1/72 points per inch) It comes from the days of metal type printing. It is why some font look smaller than other fonts at the same pointsize, because point size is NOT font size but line spacing... Only the developer of a font can specify the real font size to pointsize relationship, and some do it very badly.
http://www.imagemagick.org/Usage/text/#pointsize
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New line space - How to control it?

Post by fmw42 »

Looks like you are getting two newlines in stead of one. What happens with using \r rather than \n?

also see http://www.imagemagick.org/Usage/anim_mods/#glitter. Perhaps this is a simpler way to do what you want?
Post Reply