Using pointsize for measures
Using pointsize for measures
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using pointsize for measures
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
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 / %.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Using pointsize for measures
A useful trick is to put spaces at the start and end of captions eg
Code: Select all
convert -pointsize 30 caption:" šŋĩβģő " s.png
snibgo's IM pages: im.snibgo.com
Re: Using pointsize for measures
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.snibgo wrote:A useful trick is to put spaces at the start and end of captions egCode: Select all
convert -pointsize 30 caption:" šŋĩβģő " s.png
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.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Using pointsize for measures
"-debug annotate" gives both the pointsize and pixels per em.
Code: Select all
convert -debug annotate -pointsize 30 caption:"šŋĩβģő" s.png
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using pointsize for measures
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.
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
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using pointsize for measures
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
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.

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.
