I'm looking for a way to generate an image with various text, provided as a parameter (includes specified font) and I have another image used as a template (some sort of background). Please help in pointing a way to achieve that, if it is actually possible.
Asked
Active
Viewed 420 times
2 Answers
0
Use the canvas tag, see http://diveintohtml5.ep.io/canvas.html.

Bill the Lizard
- 398,270
- 210
- 566
- 880

Jakub Hampl
- 39,863
- 10
- 77
- 106
-
Actually JS doesn't provide appropriate (for my needs) level of image processing, even though canvas has a lot for vector graphics (judging from Raphael.js). Any way my solution is server side php image generation ("unties my arms" in certain sense). – Denys S. Nov 06 '10 at 23:52
-
Canvas and Raphael.js have nothing to do with each other. – DanMan Apr 30 '11 at 14:17
0
You can use canvas or SVG, the latter being better at text handling since it natively supports text. By that i mean that you can literally type the text into your SVG file, whereas for canvas you'd have to somehow render the text yourself AFAIK. You can also embed an image into a SVG file.
As a sidenote, you could also use a server-side language like PHP to create images, in case you didn't know.

DanMan
- 11,323
- 4
- 40
- 61
-
Well in canvas you can generally render text with `context.fillText("my text", x, y);`. Also note that SVG allows you to do resolution independent vector graphics, canvas excels with pixel pushing. A nice wrapper library for SVG is Raphael.js. – Jakub Hampl Nov 06 '10 at 23:28