Page 1 of 1
Using pointsize for measures
Posted: 2014-01-07T19:45:05-07:00
by emino
Firstly i'd like to say that i read / searched as much as i could, but didnt find anything about this.
Simply, can we use pointsize as a measurement - very much like "em"s in css - ? For example I want my caption to go 3 pointsize left from initial position; just like you would do in css left: 3em; can you do something similar in IM ?
-geometry +5%-3em ??
PS: Thank you for the great script & extensive documentation and examples. Pretty much everything is in there.
Re: Using pointsize for measures
Posted: 2014-01-07T20:02:18-07:00
by fmw42
I believe that IM only supports pixels and percent at this time for positioning. I have no idea if "em's" will be supported at a later time or not.
Re: Using pointsize for measures
Posted: 2014-01-08T06:49:40-07:00
by emino
I guess so. But i think it'd help a lot with captions if it could be implemented. Because if you have a variable pointsize, or multiple captions, it's almost impossible to define the right margins based on px / %.
Re: Using pointsize for measures
Posted: 2014-01-08T08:03:27-07:00
by snibgo
A useful trick is to put spaces at the start and end of captions eg
Code: Select all
convert -pointsize 30 caption:" šŋĩβģő " s.png
Re: Using pointsize for measures
Posted: 2014-01-08T08:32:04-07:00
by emino
snibgo wrote:A useful trick is to put spaces at the start and end of captions eg
Code: Select all
convert -pointsize 30 caption:" šŋĩβģő " s.png
Yes i've figured that for horizontal spacing, but my problem is with vertical spacing. i have to set an -extent for the caption, to go right below the one above it.
What i am trying to achieve is to auto-fit a quote in a 1280x520 area & place the author right below it, but with smaller pointsize ( With -pointsize 60% ). I can not know for sure how big 60% will be since the primary quote is auto-fit.
Here is a preview :
[img=http://s18.postimg.org/yukiqkpad/aqqqap ... tled_1.jpg]
So i currently assume a pointsize of 60 and thus 520 + 60 = 580. But ideally i would like to make it 520 + 1em, so it stays in the same place always. Current view:
[img=http://s27.postimg.org/6toxp1fan/spacci_Clipboard01.jpg]
Cant i grab the current font-size for that calculated -pointsize 60% somehow ?
PS: To clarify; i'd be perfectly fine adding \n's and spaces to the primary quote text. BUT problem is i want 60% size of the primary pointsize, which is automatically calculated.
Re: Using pointsize for measures
Posted: 2014-01-08T09:06:41-07:00
by snibgo
"-debug annotate" gives both the pointsize and pixels per em.
Code: Select all
convert -debug annotate -pointsize 30 caption:"šŋĩβģő" s.png
Re: Using pointsize for measures
Posted: 2014-01-08T11:22:05-07:00
by fmw42
I think you can adjust the line height by using
http://www.imagemagick.org/script/comma ... ne-spacing interline-spacing.
Also what I usually do is apply -trim +repage after creating the text image and then apply -border to pad it out.
Re: Using pointsize for measures
Posted: 2014-01-08T16:23:48-07:00
by emino
Thank you for the responses, +trim + repage allows you to start over, but i couldnt not find a way to make a -transparent, 520px- border top only to pad it from the top.
Also, as it turns out; i could not be more wrong about this. I.e; i thought i was inheriting the pointsize from the main text and getting 60% of it but it was actually getting 60% of the total size.
So, I give up; i'll just use fixed sizes i guess.
Re: Using pointsize for measures
Posted: 2014-01-08T20:01:14-07:00
by fmw42
emino wrote:Thank you for the responses, +trim + repage allows you to start over, but i couldnt not find a way to make a -transparent, 520px- border top only to pad it from the top.
Also, as it turns out; i could not be more wrong about this. I.e; i thought i was inheriting the pointsize from the main text and getting 60% of it but it was actually getting 60% of the total size.
So, I give up; i'll just use fixed sizes i guess.
You can pad just the top with transparency using -background none -gravity north -splice ...
see
http://www.imagemagick.org/Usage/crop/#splice
Re: Using pointsize for measures
Posted: 2014-01-09T12:20:01-07:00
by emino
Thank you, yes -splice did help me to apply a vertical padding (in the below image i'll just change the red to transparent in the production).
The only thing i cant do is to get the 60% of the quote text's size to apply to "albert einstein" text. But i think i'll just go with a fixed -48 something pointsize.
