Skip to main content
Roland Kahlenberg
Legend
January 22, 2025
Open for Voting

Handling of word spaces with new Text Styling options

Current constructs to not allow for control of word spaces - they all get nuked or ignored, by default.

As an example - 

We start with - 

Today has been a busy day.

If I then set my range to select words 2 and 3 with the intention of animating its fontSize via a Slider Control and starting from 0 to 50 with 50 also being the size of the base style; when fontSize is at 0, this is the result - 

Todaya busy day.

This of course sucks like a drenched cigar. So, I'm thinking of a way to control word spaces and thought we could have an "extends" a bit like how sourceRectAtTime() uses extends. The possible arguments for "extends" to work with affected properties in the text.sourceText prop is as follows - 

fontSize(mySlider,startValue,length,true,1)

Where "true" means, word spaces will be retained and the number (1 in this case) specifies the number of word spaces to use/retain. 

So, when animating fontSize, I will be able to hook up the "1", the number of wordspaces value to a Slider Control and also animate it but going from 1 to 0. With this construct, with my specified set up, when fontSize is at 0, this will be the result - 

Today a busy day.