Label interword-spacing fit, but multiple spaces in text
Posted: 2016-05-11T00:39:36-07:00
I need to fit (justify) a text to the bottom of an image.
I use label interword-spacing fit, and it's great when there's just one single space in the text: "www.google.com (555)123-4567"
But, now I have multiple spaces: "www.google.com CALL (555) 123-4567"
I need the final text to be stretched like this:
-www.google.com-on the left side
- big empty gap in the middle
- CALL (555) 123-4567 - on the right side, one single space between words
Like this: http://www.google.com __________________ CALL (555) 123-4567
_ is space
My command line is this, the text is spread over the entire bottom evenly:
Thanks.
Later edit: looks like I found a workaround:
1. save command output to a text line. Use underscores instead of spaces, so there's one single space in the text line.
Last line will contain the pointsize of the resulting text:
2. Extract pointsize using AutoIt, I'm pretty sure you can extract this using any simple tool/programming language.
3. Create 2 labels, SouthWest and SouthEast, use spaces this time:[/code]
I use label interword-spacing fit, and it's great when there's just one single space in the text: "www.google.com (555)123-4567"
But, now I have multiple spaces: "www.google.com CALL (555) 123-4567"
I need the final text to be stretched like this:
-www.google.com-on the left side
- big empty gap in the middle
- CALL (555) 123-4567 - on the right side, one single space between words
Like this: http://www.google.com __________________ CALL (555) 123-4567
_ is space
My command line is this, the text is spread over the entire bottom evenly:
Code: Select all
www.google.com _____ CALL _____ (555) _____ 123-4567
Code: Select all
convert.exe -size 824x450 xc:none -font Arial -size 824x -fill #0d0707 -stroke rgb(255,255,255) -background transparent -gravity South -interword-spacing 100 label:"www.google.com CALL (555) 123-4567" -bordercolor transparent -border 15x15 -composite +repage -depth 8 output.png
Later edit: looks like I found a workaround:
1. save command output to a text line. Use underscores instead of spaces, so there's one single space in the text line.
Code: Select all
convert.exe -size 824x450 xc:none -font Arial -size 824x -fill #0d0707 -stroke rgb(255,255,255) -background transparent -gravity South -interword-spacing 100 -debug annotate label:"www.google.com CALL_(555)_123-4567" -bordercolor transparent -border 15x15 -composite +repage -depth 8 null: 2> x.txt
Code: Select all
Font c:\windows\fonts\arial.ttf; font-encoding none; text-encoding none; pointsize 32.25
3. Create 2 labels, SouthWest and SouthEast, use spaces this time:
Code: Select all
[code]convert.exe -size 824x450 xc:none -font Arial -fill #0d0707 -stroke rgb(255,255,255) -background transparent -gravity SouthWest -pointsize 32.25 label:"www.google.com" -compose over -composite -font Arial -fill #0d0707 -stroke rgb(255,255,255) -background transparent -gravity SouthEast -pointsize 32.25 label:"CALL (555) 123-4567" -bordercolor transparent -border 15x15 -composite +repage -depth 8 output.png