Page 1 of 1

DOS - Convert: - Font problem (Solved)

Posted: 2010-01-12T05:38:28-07:00
by Albireo
Hello!
Looked at an exciting example on the site:
ImageMagick v6 Examples -- Creating Thumbnails and Framing
Adding image labels
http://www.imagemagick.org/Usage/thumbnails/

I try to do / run this example in DOS (and in Autohotkey)

Code: Select all

convert -define jpeg:size=400x400  hatching_orig.jpg  -resize '120x200>' \
      \( +clone -matte -fill transparent -draw 'color 0,0 reset' \
         -resize 1000x200\!  -font SheerBeauty -pointsize 72 -gravity Center \
         -strokewidth 8 -stroke black  -fill black  -annotate 0,0 '%c' \
         -channel RGBA -blur 0x8 \
         -strokewidth 1 -stroke white  -fill white  -annotate 0,0 '%c' \
         -fuzz 1% -trim +repage -resize 115x \
      \) -gravity North -composite  -strip +repage  annotated.gif
Made the following translation for DOS.
I don't know how to split the rows in a "batch file" (???.bat).
Therefore, everything is in the same row. (may not be visible)

Code: Select all

convert -define jpeg:size=400x400 Hatching_Orig.jpg -resize "120x200>" ( +clone -matte -fill transparent -draw "color 0,0 reset" -resize 1000x200 -font Arial -pointsize 72 -gravity Center -strokewidth 8 -stroke black -fill black -annotate 0,0 "%c" -channel RGBA -blur 0x8 -strokewidth 1 -stroke white -fill white -annotate 0,0 "%c" -fuzz "1%" -trim +repage -resize "115x" ) -gravity North -composite -strip +repage annotated.gif

- Have copied "Hatching_Orig.jpg" from the web - somewhere.
- I don't understand what '% c' means or where the variable find its value ("Hatching of Linux")
- I don't know, how to use the font: "SheerBeauty" (here I have used Arial - to avoid error)
I have an font on my hard disk with the name: "c:\windows\fonts\Sheer Beauty Regular.ttf".
The font have the name: "Sheer Beauty" in program for example OpenOfficeWriter

When I type in the command:
".........-font "Sheer Beauty" -pointsize ........" or
".........-font "Sheer Beauty Regular.ttf" -pointsize ........"
In both cases I get the following error message in DOS:
"convert: unable to read font 'Sheer Beauty Regular.ttf' @ annotate.c/RenderType/807." or
"convert: unable to read font 'Sheer Beauty' @ annotate.c/RenderType/807."

Must the font be installed in Windows?
How to use the fonts that are installed?


My problem is that it doesn't get the expected result:

//Jan

Re: DOS - Convert: - Font problem (Solved)

Posted: 2010-01-12T12:57:32-07:00
by Albireo
Jippi! :D
I got the answer! (thank's! Pete!).

The translation below works in DOS
- Font names with spaces, indicated with a hyphen "-"
- More info on converting scripts is at: http://www.imagemagick.org/Usage/windows/#convertion
- What fonts will work with IM, can you see with the command:

Code: Select all

identify -list font
- The DOS line continuation character is ^

Code: Select all

Set c=Hatching to Linux
convert -define jpeg:size=400x400  hatching_orig.jpg  -resize "120x200>" ^
     ( +clone -matte -fill transparent -draw "color 0,0 reset" ^
        -resize 1000x200!  -font Sheer-Beauty -pointsize 72 -gravity Center ^
        -strokewidth 8 -stroke black  -fill black  -annotate 0,0 "%c%" ^
        -channel RGBA -blur 0x8 ^
        -strokewidth 1 -stroke white  -fill white  -annotate 0,0 "%c%" ^
        -fuzz 1% -trim +repage -resize 115x ^
     ) -gravity North -composite  -strip +repage  annotated.gif
// Jan