I created letters based on ASCII codes in SVG. Each character in a separate file. This is for use as clipart in a drawing app. The following is an example of a script I used to generate the SVG:
cat <<EOF > f.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="512"
height="512"
id="svg3834"
inkscape:version="0.48.4 r9939"
sodipodi:docname="Perspective1.svg">
<g id="board">
EOF
mkdir letters
i=32
while [ $i -lt 400 ]; do
let "i++"
OUT=$( printf "letters/%03d.svg" $i)
echo $OUT
cat f.svg > $OUT
cat <<EOF >> $OUT
<text x="32" y="256"
font-family="Verdana" font-size="256" fill="red" >
EOF
printf "&#%d;" $i >> $OUT
cat <<EOF >> $OUT
</text>
</g>
</svg>
EOF
done
echo ""
echo " Now convert $( cygpath -w `pwd`)/letters/*.svg on http://www.fileformat.info/convert/image/svg2raster.htm "
echo
ls letters
How can I do the same/similar to get the Arabic alphabetic/numbers?
You can look for the Unicode code ranges. From Wikipedia, I got:
If you want, e.g., Arabic 0600-06FF, change your loop to:
And everything should work, except for your font. It seems that Verdana only supports pan-latin scripts, therefore you'd better change
font-family="Verdana"
tofont-family="Verdana,sans-serif"
so you can have a nice fallback.P.S. Your current handling of glyph metrics may seem broken with the wider glyphs in Arabic script.
P.P.S. Your file naming with 3-digit decimals may be broken due to the ranges of
$i
.