I am building an admin area using CodeIgniter 2, where the admin has the ability to add specific images that are "blank", when it comes to text overlay. When they upload the image, they should have a way of defining certain paths on which regular users can add desired text. Basically, this can be used for shirts, mugs...any type of custom printable surfaces.
The paths need to support straight lines, bezier curves and circles. And one base image needs to support multiple paths.
I used the Raphael JS library and SVG.
Here is my current approach:
- I open up the base image in InkScape and draw a path
- Export the path as SVG
- Use that path for creating a Raphael JS path
- Place the text on that path
The problem with this approach is that some letters display rather strange when placed on a curved/circular path and I can't quite place it exactly where it needs to be, so there is some offset letters that I just can't have.
Here is a sample site of where this kind of stuff has been implemented using .net. Basically, you enter the text in Line 1, Line 2 etc. and it displays on the badge on the right hand side. It also retains the text in the defined region, so if you enter more text than can fit in the region, it squeezes the text so it could fit.
Does anyone have any pointers for me as to what I should be looking for? Main points being: the paths/regions need to be defined by the admin (using JS or a third party application) and the text must be placed on those paths.
This does not have to be done using HTML5, it can be done using any kind of PHP library as well.