The following script appears to work OK with normal text
# Convert text in a text file to an image
# text2image.ksh Name.txt
# Produces: Nametext.png
N=$(basename $1 .txt)
imgconvert -size 1000x1000 xc:white -font "SimSun" -pointsize 56 \
-fill black -annotate +15+80 "@$N.txt" \
However with Chinese font, such as SimSun in the script as above, a `?' mark is inserted
in front of the first line.
eg if a text file contains the Chinese character for `I' 我 (Pinyin wo3) and is saved
as utf8, then the image produced has a question mark`?' in front of the 我 character.
Subsequent lines in the file are OK.
Various Chinese fonts were tried and the result was the same.
Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
2 posts • Page 1 of 1
- Posts: 13034
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK