<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Antonin Langlade on Medium]]></title>
        <description><![CDATA[Stories by Antonin Langlade on Medium]]></description>
        <link>https://medium.com/@antoninlanglade?source=rss-7e6b9b5c62f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y9CV4qqFdQkYOEOEA-f5TA.jpeg</url>
            <title>Stories by Antonin Langlade on Medium</title>
            <link>https://medium.com/@antoninlanglade?source=rss-7e6b9b5c62f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:35:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antoninlanglade/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Font Animation Deformation JS]]></title>
            <link>https://medium.com/@antoninlanglade/font-animation-deformation-js-b44e925a94e9?source=rss-7e6b9b5c62f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b44e925a94e9</guid>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Antonin Langlade]]></dc:creator>
            <pubDate>Mon, 02 Jan 2017 08:31:50 GMT</pubDate>
            <atom:updated>2017-01-02T08:31:50.655Z</atom:updated>
            <content:encoded><![CDATA[<p>A home slider is a series of images, and fonts are static… Or? As the binary geeks we are, we wanted to push the boundaries and see just how cool we could actually make these simple letters soon to be found on our agency’s landing page — by playing with code, willpower and a bit of magic.</p><p>To be precise, we wanted to experiment with finding a new way to animate titles on a home slider. While trying out different visual approaches, we realised that deforming the font itself would bring life to the animation and add the edge we were hoping to achieve.</p><p>And that always makes it even more interesting — like solving a riddle. So, we started the first research and found some articles telling us how to do it with Canvas: lines, curves… <a href="http://www.professorcloud.com/svg-to-canvas/"><strong>But it was difficult and time consuming</strong></a>, and as developers tend to do, we found a way to simplify the process.</p><p>I think that we found a good answer to our prayers : <a href="https://www.w3.org/TR/SVG/"><strong>SVG</strong></a>.</p><p>First, we tried to animate the describing points of a simple <a href="https://www.w3.org/TR/SVG/"><strong>SVG</strong></a> shape; the path attributes. It worked well with animation libraries like <a href="https://greensock.com/tweenmax"><strong>GSAP</strong></a> and <a href="http://dynamicsjs.com/"><strong>dynamics.js</strong></a> combined with <a href="http://snapsvg.io/"><strong>Snap.svg</strong></a> (yes, Snap — because working with SVG is really obscure when you’re not using a library!).</p><p>Secondly, we examined how to export all the letters of a particular font, while keeping the same characteristics. So, the Art Director had to work with the same viewbox border-to-border width of the letter — and he had to vertically centre the letters in order to obtain the desired vertical alignment.</p><p>Once finished, we created a little script to convert the SVG paths in the Illustrator exports to one compiled JSON file. This allowed us to use the paths more easily and freely in code because of the standard notation. The most important thing in this step was to convert all the coordinates into absolutes, because if you want to animate the relative points, you will completely destroy the logic of positioning/parents/relations… And without absolute numbers, the result would be a real headache.</p><pre>// Get SVG DOM element<br>var $svg = <strong>Snap</strong>(document.getElementById(&#39;path&#39;));<br>// Transform string into array of values<br>var dbString = Snap.path.<strong>toAbsolute</strong>($svg.attr(&#39;path&#39;));</pre><pre>// This is an export of my JSON alphabet file<br>// Draw is the SVG instruction into path string<br>// Move is a variable for describe which point will move <br>// -1 || 1 value for the direction</pre><pre>{<br> &quot;A&quot;: [{<br>  &quot;draw&quot;: [&quot;M&quot;,&quot;395.1&quot;,&quot;662.6&quot;],<br>  &quot;move&quot;: 0<br> }, {<br>  &quot;draw&quot;: [&quot;H&quot;,&quot;198.9&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;147.6&quot;,&quot;811.1&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;H&quot;,&quot;0.0&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;217.8&quot;,&quot;188.3&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;H&quot;,&quot;376.2&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;606.6&quot;,&quot;811.1&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;H&quot;,&quot;447.3&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;395.1&quot;,&quot;662.6&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;Z&quot;],<br>  &quot;move&quot;: 0<br> }, {<br>  &quot;draw&quot;: [&quot;M&quot;,&quot;242.1&quot;,&quot;536.6&quot;],<br>  &quot;move&quot;: 0<br> }, {<br>  &quot;draw&quot;: [&quot;H&quot;,&quot;351.9&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;297.0&quot;,&quot;379.1&quot;],<br>  &quot;move&quot;: 1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;297.0&quot;,&quot;379.1&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;L&quot;,&quot;242.1&quot;,&quot;536.6&quot;],<br>  &quot;move&quot;: -1<br> }, {<br>  &quot;draw&quot;: [&quot;Z&quot;],<br>  &quot;move&quot;: 0<br> }]<br>}</pre><p>So, once you have the JSON file with all the paths of your alphabet, you can start to transform the paths. Let the fun begin! To make it easier for the Art Director, we created a second LiveReload script that allowed him to decide which points should be translated to create the desired animation, giving him the possibility to play with both left- and right-side deformation -1 || 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lADwtRa7DrtMrh8I0kDUbQ.gif" /></figure><p>With all these animated letters, we were confronted with a big problem. Another big problem, one might add. How do you manage the SVG positioning between letters and words? Well, after some hours, we found a good solution using the Library <a href="http://opentype.js.org/"><strong>OpenType.js</strong></a>. It allows you to access the letterforms of text in <a href="https://nodejs.org/en/"><strong>node.js</strong></a>.</p><p>With this database, we were able to use the values to correctly draw the letters. For example, we could use Kerning to adjust the space between two letters to maintain the font’s characteristics and make it readable at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/1*A34GiXpY1VuXx6sonIkhAg.png" /></figure><pre>{<br>  &quot;B&quot;: {<br>    &quot;width&quot;: 606.6,<br>    &quot;height&quot;: 1000,<br>    &quot;kerning&quot;: {&quot;A&quot;: 28,&quot;B&quot;: 0,&quot;C&quot;: -40,&quot;D&quot;: 0,&quot;E&quot;: 0,&quot;F&quot;: 0,&quot;G&quot;: -40,&quot;H&quot;: 0,&quot;I&quot;: 0,&quot;J&quot;: 15,&quot;K&quot;: 0,&quot;L&quot;: 0,&quot;M&quot;: 0,&quot;N&quot;: 0,&quot;O&quot;: -40,&quot;P&quot;: 0,&quot;Q&quot;: -40,&quot;R&quot;: 0,&quot;S&quot;: -15,&quot;T&quot;: -65,&quot;U&quot;: -30,&quot;V&quot;: -85,&quot;W&quot;: -65,&quot;X&quot;: 27,&quot;Y&quot;: -95,&quot;Z&quot;: 0 <br>  }<br>}</pre><p>To finish, we had to make a ratio scaling for all the stages to respect screen sizes, create space between words — and naturally complete the animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*RN_bIhN36GVh4bl-DfeZow.gif" /></figure><h3>To wrap it up</h3><p>It was a challenging module, but we ended up being quite satisfied, and if we do say so ourselves, the result is pretty smooth and cool. After having created this system, it will be way easier for us to use different fonts to create some appealing stuff by re-using the code in the future.</p><p>Process-wise, it was a great feeling to work closely together with the Art Director and find solutions to problems in a previously unknown field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b44e925a94e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>