I apologize if this is answered somewhere and I would really appreciate if you could be so kind to point me to the right direction or post regarding solution to this problem...
I have a weird demand from my employer, and I have been banging my head with it for the last two days, but no go... 🙁
Here goes:
I am to build an application that allows user of this application to create a text to his liking and then print it upon a picture and create it as a new picture which he will get from it.
Now I did the GD thingy to create a new picture with demanded text upon it by using GD, so that is not the issue...
The issue is how to parse text that I get from tinyMCE which is used to shape a text in the form for this application.
I limited a lot of options and have only text size, font type and underline and such for a text so it is fairly simple use of tinyMCE, but I cannot seem to get my head around it...
The HTML I get is something like:
<p>text1 <span style="font-size: medium;">text with space</span></p>
Or more complex but all the same possible:
<p><span style="font-size: xx-large;"><span style="font-size: medium;">text with space</span>text1 </span></p>
..and so on...
Clearly, I would need a system that would manage to parse out text in both occasions and in any other new situation that might come by...
Now, in GD I am going to need a text and an array associated to it in which I would get font-size, font-type values and such....
Again - I KNOW how to do the GD stuff, but I would like to be able to connect to it this tinyMCE or another RTE to make it possible for user to play around...
I have tried to figure this out by myself although I am not that versed when it comes to regular expressions and now, finally, I need another head to help me with this...
Any thought or help would be very appreciated!
P.S. If I wasn't clear - please be so kind to to let me know and I would explain in more detail... 🙂