I like the "Text"-class of KineticJS but its not enough for what I have in mind. Thats why I want to create a bitmap font (having all characters inside one image and using parts of the image to create the text).
- Is there a best approach to do this in KineticJS?
- Is there a way to copy a part of an image and draw it on a layer?
If you use Kinetic.Shape, you're given a canvas context to work with.
(It's actually wrapper around the actual context--but it's almost fully functional).
Then use context.drawImage with the clipping parameters to clip letters from your "font spritesheet".
Also keep in mind that there's nothing prohibiting you from creating an offscreen html canvas for tasks like yours.
Clip the letters from your spritesheet onto the offscreen canvas and then use offscreen.toDataURL() to create an image object that you can use in Kinetic.Image--best of both worlds!
Cheers!