<?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[Change Component Indexes]]></title><description><![CDATA[<p dir="auto">Hi there!</p>
<p dir="auto">Is there a way to change a glyph's component indexes via a script? I feel like I might be totally overthinking this problem.</p>
<p dir="auto">Best,<br />
Connor</p>
]]></description><link>https://forum.robofont.com/topic/506/change-component-indexes</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 23:30:00 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/506.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Aug 2018 14:52:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Change Component Indexes on Tue, 28 Aug 2018 22:23:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi there!</p>
<p dir="auto">Is there a way to change a glyph's component indexes via a script? I feel like I might be totally overthinking this problem.</p>
<p dir="auto">Best,<br />
Connor</p>
]]></description><link>https://forum.robofont.com/post/1692</link><guid isPermaLink="true">https://forum.robofont.com/post/1692</guid><dc:creator><![CDATA[connor]]></dc:creator><pubDate>Tue, 28 Aug 2018 22:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Change Component Indexes on Tue, 28 Aug 2018 16:45:31 GMT]]></title><description><![CDATA[<p dir="auto">he Connor</p>
<p dir="auto">there are several ways to achieve a different sorting for components: this is an easy one. You can also make a <a href="http://robofont.com/documentation/building-tools/toolkit/pens/" rel="nofollow">pen to sort the components</a>.</p>
<p dir="auto">good luck</p>
<pre><code class="language-python"># get current glyph
g = CurrentGlyph()
# get all components
components = g.components
# clear them all
g.clearComponents()
# convert the tuple to a list
components = list(components)
# create a sorter
def myComponentSorter(component):
    return component.baseGlyph
# sort with our custom sort function
components.sort(key=myComponentSorter)
# start a loop over our sorted components
for component in components:
    # add all compenets
    g.appendComponent(component.baseGlyph, component.offset, component.scale)
</code></pre>
]]></description><link>https://forum.robofont.com/post/1693</link><guid isPermaLink="true">https://forum.robofont.com/post/1693</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Tue, 28 Aug 2018 16:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to Change Component Indexes on Tue, 28 Aug 2018 18:57:26 GMT]]></title><description><![CDATA[<p dir="auto">Wow, thank you * 10000 for the help, Frederik! I really appreciate it.</p>
]]></description><link>https://forum.robofont.com/post/1694</link><guid isPermaLink="true">https://forum.robofont.com/post/1694</guid><dc:creator><![CDATA[connor]]></dc:creator><pubDate>Tue, 28 Aug 2018 18:57:26 GMT</pubDate></item></channel></rss>