<?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"><channel><title><![CDATA[Performance boost tips]]></title><description><![CDATA[<p dir="auto">I've found some tips about making things run faster in RF and I want to share them here. I hope they're useful for others too:</p>
<h3>1. Python objects are faster than RF font objects</h3>
<p dir="auto">I realized if my script is run once, it's better if I convert RF objects to python objects. This way in many cases there is a huge performance boost. This could also be dangerous if you keep the data after user made changes to the font. So if you want to do something once and you're done after, this might help. Here is a very small public gist, but it's a start:<br />
<a href="https://gist.github.com/typoman/38a41811ad5dd8eb16a9d8acb6519a7f" rel="nofollow">https://gist.github.com/typoman/38a41811ad5dd8eb16a9d8acb6519a7f</a></p>
<h3>2. Representation factories</h3>
<p dir="auto">If you're making a user interface and are calculating something every time user makes a change, the representation factory is the way to cut some time. This is how you can cache data in font. Representaions can be anything, it doesn't have to be a visual data. RoboFont already has many. Like <code>Glyph.area</code> which gives you the surface area of the glyph. You can find how to make representation factories here:</p>
<p dir="auto"><a href="https://github.com/robotools/defcon/blob/master/documentation/source/concepts/representations.rst" rel="nofollow">https://github.com/robotools/defcon/blob/master/documentation/source/concepts/representations.rst</a></p>
<p dir="auto">An example:<br />
<a href="https://github.com/typesupply/glyph-nanny/blob/2d41cc0e200726b2ddc5ffda3f85caeee7a7235b/Glyph%20Nanny.roboFontExt/lib/glyphNanny.py#L627" rel="nofollow">https://github.com/typesupply/glyph-nanny/blob/2d41cc0e200726b2ddc5ffda3f85caeee7a7235b/Glyph Nanny.roboFontExt/lib/glyphNanny.py#L627</a></p>
]]></description><link>https://forum.robofont.com/topic/771/performance-boost-tips</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 11:59:22 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/771.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Dec 2019 14:11:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Performance boost tips on Wed, 18 Dec 2019 15:20:30 GMT]]></title><description><![CDATA[<p dir="auto">I've found some tips about making things run faster in RF and I want to share them here. I hope they're useful for others too:</p>
<h3>1. Python objects are faster than RF font objects</h3>
<p dir="auto">I realized if my script is run once, it's better if I convert RF objects to python objects. This way in many cases there is a huge performance boost. This could also be dangerous if you keep the data after user made changes to the font. So if you want to do something once and you're done after, this might help. Here is a very small public gist, but it's a start:<br />
<a href="https://gist.github.com/typoman/38a41811ad5dd8eb16a9d8acb6519a7f" rel="nofollow">https://gist.github.com/typoman/38a41811ad5dd8eb16a9d8acb6519a7f</a></p>
<h3>2. Representation factories</h3>
<p dir="auto">If you're making a user interface and are calculating something every time user makes a change, the representation factory is the way to cut some time. This is how you can cache data in font. Representaions can be anything, it doesn't have to be a visual data. RoboFont already has many. Like <code>Glyph.area</code> which gives you the surface area of the glyph. You can find how to make representation factories here:</p>
<p dir="auto"><a href="https://github.com/robotools/defcon/blob/master/documentation/source/concepts/representations.rst" rel="nofollow">https://github.com/robotools/defcon/blob/master/documentation/source/concepts/representations.rst</a></p>
<p dir="auto">An example:<br />
<a href="https://github.com/typesupply/glyph-nanny/blob/2d41cc0e200726b2ddc5ffda3f85caeee7a7235b/Glyph%20Nanny.roboFontExt/lib/glyphNanny.py#L627" rel="nofollow">https://github.com/typesupply/glyph-nanny/blob/2d41cc0e200726b2ddc5ffda3f85caeee7a7235b/Glyph Nanny.roboFontExt/lib/glyphNanny.py#L627</a></p>
]]></description><link>https://forum.robofont.com/post/2926</link><guid isPermaLink="true">https://forum.robofont.com/post/2926</guid><dc:creator><![CDATA[bahman]]></dc:creator><pubDate>Wed, 18 Dec 2019 15:20:30 GMT</pubDate></item></channel></rss>