Jump to content
John Rostron

Warping Text onto a wave

Recommended Posts

Some time ago I presented a formula to plug into Equations to warp text along a wavy baseline. I promised to create a macro to perform this, but never got round to it. Well here is that macro and a library containing it.

Wavy Text.afmacro

Wavy Text.afmacros

The transformation is just a sine/cosine curve:

y=y-(h*a/3)*(b*sin(360*x/w/c)+(1-b)*cos(360*x/w/c))

The a parameter determines the amplitude. The default is a=0.5, which creates a wave that  reaches about half way to the top and bottom of the layer. 

The b parameter shifts the position of te wave along the horizontal axis.

The c parameter affects the wavelength. Reducing c gives more waves along the x-axis.

If you start with a text layer such as:

147699529_OriginalText.png.e649968b898d4fe53db88c870d468517.png

and apply the macro with the default parameters, you get:

414516505_WarpedText.png.3021ebcd4a43d3840105d09e83cc0f1f.png

The macro is designed to operate on a text object on a background. It needs the background to give it room. It begins by rasterizing the text to a pixel layer. It uses the height and width of the background layer to determine the amplitude and wavelength, not the height and width of the text itself.

To use this, I would suggest creating a new document of a size to hold the text, then warp it, then  place or copy it into the target document with an appropriate blending mode.

John


Windows 10, Affinity Photo 1.6.5.123 and Designer 1.6.5.123, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites
52 minutes ago, evtonic3 said:

Does this mean the UI to this is right around the corner? I'm excited!

I'm not sure what you mean by this.

John


Windows 10, Affinity Photo 1.6.5.123 and Designer 1.6.5.123, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites
57 minutes ago, evtonic3 said:

Does this mean the UI to this is right around the corner? I'm excited!

John is a user, not a Serif developer.


-- Walt

Windows 10 Home, version 1809, 16GB memory, Intel Core i7-6700K @ 4.00Gz, GeForce GTX 970
Affinity Photo 1.6.5.123 and 1.7.0.333 Beta       / Affinity Designer 1.6..5.123 and 1.7.0.333 Beta    / Affinity Publisher 1.7.0.337 Beta

Share this post


Link to post
Share on other sites

Just excited to see any resemblance of text warping. What I meant was since warping can be done mathematically, could a true warp function similar to other apps (AI Warp)  be close to bringing it Affinity apps as well?

Screen Shot 2019-03-13 at 11.16.28 AM.png

Share this post


Link to post
Share on other sites
3 minutes ago, walt.farrell said:

John is a user, not a Serif developer.

doh! Sorry about that...lol I guess being that he's so smart and giving us macros and all  I'd just assumed he was. He should be!!

 

Share this post


Link to post
Share on other sites
On 3/13/2019 at 5:17 PM, evtonic3 said:

Just excited to see any resemblance of text warping.

Well in APh using equations here will always yield to a pixel based representation of the modified text or shapes then ...

warp_equation.jpg.96a50d43ae80491f79d3a8df0449c4a8.jpg

On 3/13/2019 at 5:17 PM, evtonic3 said:

What I meant was since warping can be done mathematically, could a true warp function similar to other apps (AI Warp)  be close to bringing it Affinity apps as well? ...

What you probably mean is then on the plain vector side (AD) instead, so things like envelope distortion or freeform distortion of vectors/shapes which are sadly missing there in AD. - It's something which needs to be still implemented for AD, so people don't have to switch over to use AI, Inkscape, Magix/Xara, ... etc. instead for performing such tasks.

 


☛ Affinity Designer 1.6.1 ◆ Affinity Photo 1.6.7 ◆ OSX El Capitan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×