On Mon, 20 Jul 2009 22:20:43 +0200
Stephan Wentz <[email protected]> wrote:
| Hi folks!
|
| I'm going nuts on this, I have never used text rendering with
| imagemagick before, and the usage tutorials didn't help me with this,
| either.
|
| I have an icon with a static size of 16x16 pixels. Next to it should be
| a varying string, with a pointsize of 14. This string should be
| vertically centered.
|
| I tried it with 2 steps, the first one rendering the text into a
| temporary image and trim it. The second step would be putting the icon
| and the temporary together.
|
| But I guess there is a solution to do this in one step, and catch some
| glitches (in my solution the text isn't centered vertically).
|
| convert -background transparent -fill "#7fa1cc" -font Arial -size 200x16
| -pointsize 14 caption:"Test String" -trim temp.png
|
| convert -background transparent search.png -size 5x16 xc:none temp.png
| -gravity center +append search_text.png
|
| As you can see some things are badly solved, like the 200x16 and
| trimming the image, or the 5x16 xc:none spacer. Haven't got a clue how
| to solve these the right way.
|
Do you want a transparent background, and a specific colored text?
Try not giving a point size, and using gravity center.
convert -fill #7fa1cc" -font Arial -gravity center -size x16 \
label:"Test String" search.png +swap +append result.png
Not if appending, the largest image will determine the final height,
and gravity the placement, other color will be set from -background.
Do not forget to use +repage after trim!
convert -fill #7fa1cc" -font Arial -gravity center -size x16 \
label:"Test String" -trim +repage \
search.png +swap -background none +append result.png
Anthony Thyssen ( System Programmer ) <[email protected]>
-----------------------------------------------------------------------------
You know, the very powerful and the very stupid have one thing in
common. They don't alter their views to fit the facts. They alter
the facts to fit their views. -- Doctor Who, "The Face of Evil"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users