The words are defined using Signed Distance Field functions -- a function that determines the distance to object's surface. It is quite simple to write down an SDF for primitive objects like cube and sphere, cylinder, torus, then using negation and min/max you can create unions, intersections and differences of shapes defined by SDFs.
Inigo Quilez has in-depth explanations and plenty of examples for these: https://iquilezles.org/www/articles/distfunctions/distfuncti...