Gravity and justify...

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Locked
cedk
Posts: 16
Joined: 2010-11-23T05:36:22-07:00
Authentication code: 8675308

Gravity and justify...

Post 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.

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Gravity and justify...

Post by Bonzo »

Another user is also having a similar problem: viewtopic.php?f=1&t=17649

cedk
Posts: 16
Joined: 2010-11-23T05:36:22-07:00
Authentication code: 8675308

Re: Gravity and justify...

Post by cedk »

To not forget my question...
Thanks

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Gravity and justify...

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

cedk
Posts: 16
Joined: 2010-11-23T05:36:22-07:00
Authentication code: 8675308

Re: Gravity and justify...

Post 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

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Gravity and justify...

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

nerdx86
Posts: 4
Joined: 2012-05-01T08:28:52-07:00
Authentication code: 13

Re: Gravity and justify...

Post by nerdx86 »

Count me as a vote for justification as well!!

IM.nut
Posts: 13
Joined: 2014-02-24T13:03:49-07:00
Authentication code: 6789

Re: Gravity and justify...

Post 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?!)

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gravity and justify...

Post 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.
snibgo's IM pages: im.snibgo.com

IM.nut
Posts: 13
Joined: 2014-02-24T13:03:49-07:00
Authentication code: 6789

Re: Gravity and justify...

Post 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.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gravity and justify...

Post by snibgo »

For that type of feature, I suggest using am html rasterizer such as wkhtmltoimage.
snibgo's IM pages: im.snibgo.com

IM.nut
Posts: 13
Joined: 2014-02-24T13:03:49-07:00
Authentication code: 6789

Re: Gravity and justify...

Post 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.

Locked