Forum Discussion
Formatting text within variable values.
As i always find these kind of challenges intriguing, i couldnot resist finding a solution. And although it for sure aint perfect its a first step.
Storyline text is span based and all SVG. It is no pure HTML anymore and thus most HTML tricks will fail.
But you can offcourse add your own HTML text element...and then easily use sup and sub tags.
Like this...
const el = document.createElement('div'); el.innerHTML = "create HTML text is clicked and now <sub>we need to set parts</sub> of this text to subscript and/or <sup>superscript</sup>";el.setAttribute('title', 'my-title');const box = document.querySelector("[data-acc-text='txtBox']");box.appendChild(el);
I have a shape called 'txtBox' that is where the HTML-text element will be setup.
Combining variables and what parts need to be set to sub or sup is the next step.
Making a working sample now.
Related Content
- 12 months ago
- 12 months ago