i was wondering if it s possible to put a text with a specific size and font into a PShape object.
i am working on a sketch, that has some text elements, floating and bouncing around. i am not happy with the textWidth() function as it is not exactly correct, same with the text height.
so i thought it would be nice to have it as a shape object to get the specific width and height of it.
like converting text to paths as in illustrator. i know that i could load a svg file from the text but i was looking for a more elegant way.
I accidentally came across a solution for this one.
So in case someone has a similar problem, here it goes:
There is processing library called ‘geomerative’ which cut the letter/font into very small vertexes.
A good example with code can be seen here: http://www.generative-gestaltung.de/1/P_3_2_3_01
With this library you can also read the x/y-position of the vertex points. So i was able to read the exact dimensions of the font to make it perfectly bouncing in a specific frame.
You can also make a PShape out of this but I wasn’t that happy with the resolution. Thats why I draw the text with the text()-function and use the geomerative-text as a hidden mask.
True. That’s another way I haven’t thought about, thanks!!
But in this one the letters are not kerned so it looks very unbalanced overall.
I think fixing that would be a lot of effort.
Another reason geomerative works best in this case so far as it keeps the kerning information of the font.
Sorry for my crabbing, i’m very picky in case of type