# P5.js Soft body dynamics on text

**URL:** <https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225>\
**Category:** Coding Questions\
**Created:** [December 21, 2021, 2:54pm UTC](https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225 "2021-12-21T14:54:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didicw93](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Didicw93](https://discourse.processing.org/u/Didicw93)\
**Post date:** [December 21, 2021, 2:54pm UTC](https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225/1 "2021-12-21T14:54:09Z")

</div>

I’m trying to figure out how to apply the basic soft dynamic in the reference page of P5.js on to typography/text. at the moment i think that the only option is to draw the shapes of the letters via “beginShape()”  
any smarter suggestions?  
thsnks

---

<div class="post-metadata">

**Author:** ![KumuPaul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kumupaul/32/13072_2.png) [@KumuPaul](https://discourse.processing.org/u/KumuPaul)\
**Post date:** [December 24, 2021, 8:05am UTC](https://discourse.processing.org/t/p5-js-soft-body-dynamics-on-text/34225/2 "2021-12-24T08:05:44Z")

</div>

Fundamentally it should be possible to combined the concepts from the [“Soft Body” example](https://p5js.org/examples/simulate-soft-body.html) with the [`p5.Font.textToPoints` function](https://p5js.org/reference/#/p5.Font/textToPoints). The main issue is that `textToPoints()` doesn’t provide a good way to determine which points should be connected to which. In characters with multiple parts (like an `i` or a `0`) there’s one sequence of points to indicate what part of the shape and another sequence for the others, which are sometimes voids as with the slashed zero. As a result it is tricky to use the output of `textToPoints` to draw a coherent shape. However, there are probably some other libraries out there that can turn a character into a set of splines given a certain font.
