Page 1 of 1

Gravity and justify...

Posted: 2010-12-12T04:00:40-07:00
by cedk
Hello,
As suggested by fmw42,this is an enhancement request.
Topic : Writing a text with justify argument relative to a point

I think I understand (~) the -gravity option. But for justify text, I didn't found any existing option. So what about creating an -justify option ? or maybe, to be as complete as svg, 2 options : text-align and vertical-align ? (W3C SVG). I think (?) all needed values are already present in the -debug annotate "Metric line"...

I suppose that the problem will be when both of the 2 options (gravity & justify) may be present in one command-line.
But write

Code: Select all

convert -size 400x300 -gravity South -vertical-align middle -annotate 0 test ...
doesn't look uninteresting to me.

Re: Gravity and justify...

Posted: 2010-12-12T04:53:06-07:00
by Bonzo
Another user is also having a similar problem: viewtopic.php?f=1&t=17649

Re: Gravity and justify...

Posted: 2011-05-10T07:02:48-07:00
by cedk
To not forget my question...
Thanks

Re: Gravity and justify...

Posted: 2011-05-10T23:20:37-07:00
by anthony
This has been a 'want' since IMv6 first came out. I will be ensuring that it is included in IMv7 but that will be at least a year away.

Re: Gravity and justify...

Posted: 2011-11-30T09:18:17-07:00
by cedk
Hi,

Is there a date scheduled for IM7 ? With justify option ??!!! :wink:
I can't see anything about that on this page : http://www.imagemagick.org/script/porting.php

Regards

Re: Gravity and justify...

Posted: 2011-12-04T22:55:19-07:00
by anthony
At the moment the programming is concentrating on low level pixel handling (allowing up to a hundred channels rather than the current 3,4, or 5 channels of image data), low level speed increases, and for me the CLI interface to enable 'stream' or 'pipeline' operations, and setting handling.

Re: Gravity and justify...

Posted: 2012-05-07T11:05:59-07:00
by nerdx86
Count me as a vote for justification as well!!

Re: Gravity and justify...

Posted: 2019-12-06T09:17:21-07:00
by IM.nut
Ancient request, but highest page rank (in two hours of searching) so posting here.

Pango seemed like the best hope, but as @anthony notes in the Text reference doc, "I have not been able to get pango to selectively center just a single line of text."

So it appears the workaround remains transforming coordinates for each piece of text to be center-justified. For priority, I'd place this near the top. (Trying to build momentum here; Can you feel it?!)

Re: Gravity and justify...

Posted: 2019-12-06T09:57:32-07:00
by snibgo
I'm not sure what you are asking for. "-define pango:justify=true" will split at work boundaries, and justify the left and right sides.

Re: Gravity and justify...

Posted: 2019-12-06T13:33:20-07:00
by IM.nut
snibgo wrote:
2019-12-06T09:57:32-07:00
I'm not sure what you are asking for. "-define pango:justify=true" will split at work boundaries, and justify the left and right sides.
It's the same as @cedk referenced back in 2010 in OP (not changing anything myself). The code snippet you mention does work great when used as intended. This suggestion is to separate gravity and justification so that several (or few) pieces of text may be placed in the image using points and specifying the justify setting for each -- all independent of the current gravity setting. Text would flow from each point according to only the justify settings (h and v).

But alas, maybe there's not that many who use the program for such things. ...Or perhaps more would use it if this feature were included.

Re: Gravity and justify...

Posted: 2019-12-06T13:44:25-07:00
by snibgo
For that type of feature, I suggest using am html rasterizer such as wkhtmltoimage.

Re: Gravity and justify...

Posted: 2019-12-06T15:25:34-07:00
by IM.nut
IM is already an incredibly powerful tool; this would make it more so. Partially deferring to you, but keeping the dream alive.