<?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[Features update]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’m trying to build a script for my features.<br />
I open (or make) the <code>features.fea</code> file and write stuff into the file.<br />
The problem is: it’s not updated in the features UI.<br />
<code>f.update()</code> doesn’t to the trick.</p>
<p dir="auto">Who can help?</p>
<p dir="auto">Thanks!</p>
<p dir="auto">my sketch:</p>
<pre><code class="language-python">f = CurrentFont()
g = CurrentGlyph()

path = f._get_path() + "/features.fea"

fea = open(path, "w")

liga = "feature liga { \n"
for g in f:
    if g.name == 'fi':
        liga+= "    sub f i by fi;\n"
    if g.name == 'ffi':
        liga+= "    sub f f i by ffi;\n"
    if g.name == 'fl':
        liga+= "    sub f l by fl;\n"    
liga += "} liga;\n\n"

fea.write(liga)

fea.close()
</code></pre>
]]></description><link>https://forum.robofont.com/topic/167/features-update</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 16:53:33 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/167.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Aug 2012 13:01:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Features update on Tue, 02 Jan 2018 15:59:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’m trying to build a script for my features.<br />
I open (or make) the <code>features.fea</code> file and write stuff into the file.<br />
The problem is: it’s not updated in the features UI.<br />
<code>f.update()</code> doesn’t to the trick.</p>
<p dir="auto">Who can help?</p>
<p dir="auto">Thanks!</p>
<p dir="auto">my sketch:</p>
<pre><code class="language-python">f = CurrentFont()
g = CurrentGlyph()

path = f._get_path() + "/features.fea"

fea = open(path, "w")

liga = "feature liga { \n"
for g in f:
    if g.name == 'fi':
        liga+= "    sub f i by fi;\n"
    if g.name == 'ffi':
        liga+= "    sub f f i by ffi;\n"
    if g.name == 'fl':
        liga+= "    sub f l by fl;\n"    
liga += "} liga;\n\n"

fea.write(liga)

fea.close()
</code></pre>
]]></description><link>https://forum.robofont.com/post/167</link><guid isPermaLink="true">https://forum.robofont.com/post/167</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Tue, 02 Jan 2018 15:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Features update on Tue, 02 Jan 2018 16:01:26 GMT]]></title><description><![CDATA[<p dir="auto">mm, why would you rewrite the source file?<br />
RoboFont will see this change only when you jumped to an other application and back to RoboFont.</p>
<p dir="auto">But I strongly encourage you not to do it like this :)</p>
<pre><code class="language-python">f = CurrentFont()

## get the fea text
feaText = f.features.text

for i in range(100):
    feaText += "# halleluja\n"

f.features.text = feaText
</code></pre>
<p dir="auto">ps: also strongly advised: never ever use private callback, private callbacks are callbacks starting with an <code>_</code> (underscore) those allows developers to change underlaying API stuff with bothering the top level API.</p>
<p dir="auto">so:</p>
<pre><code class="language-python">f = CurrentFont()
print f.path
</code></pre>
<p dir="auto">thanks</p>
]]></description><link>https://forum.robofont.com/post/802</link><guid isPermaLink="true">https://forum.robofont.com/post/802</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Tue, 02 Jan 2018 16:01:26 GMT</pubDate></item><item><title><![CDATA[Reply to Features update on Thu, 16 Aug 2012 15:20:25 GMT]]></title><description><![CDATA[<p dir="auto">Yes, this is easier and does exactly what I want!</p>
<p dir="auto">Thanks Frederik!</p>
]]></description><link>https://forum.robofont.com/post/803</link><guid isPermaLink="true">https://forum.robofont.com/post/803</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Thu, 16 Aug 2012 15:20:25 GMT</pubDate></item></channel></rss>