<?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[G.copy]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">For some observers I need the decomposed, removeOverlaped glyph.</p>
<p dir="auto">I have sort of a solution by adding duplicate glyphs to the font and decompose, removeOverlap them. And automatically remove them when the observer was removed.</p>
<p dir="auto">But I know this can be done in a nicer way. But this code doesn't do the trick. But why not? Seems okay to me...</p>
<pre><code class="language-python">f = CurrentFont()

g = f['H']

temp = g.copy()
temp.decompose()
temp.removeOverlap()
for c in temp.components:
    print c #these must be gone...
drawGlyph(temp)
</code></pre>
<pre><code class="language-console">&lt;Component for I&gt;
&lt;Component for I&gt;
Traceback (most recent call last):
  File "&lt;untitled&gt;", line 10, in &lt;module&gt;
  File "main.py", line 29, in drawGlyph
  File "lib/fontObjects/robofabWrapper.pyc", line 2736, in draw
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/glyph.py", line 299, in draw
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/glyph.py", line 308, in drawPoints
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/component.py", line 107, in drawPoints
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/robofab/pens/adapterPens.py", line 111, in addComponent
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/fontTools/pens/basePen.py", line 166, in addComponent
TypeError: 'NoneType' object has no attribute '__getitem__'&lt;/code&gt;
</code></pre>
<p dir="auto">Who can help?<br />
Thanks! Thom</p>
]]></description><link>https://forum.robofont.com/topic/340/g-copy</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Mar 2026 19:59:18 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/340.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Oct 2014 11:42:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to G.copy on Wed, 03 Jan 2018 15:31:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">For some observers I need the decomposed, removeOverlaped glyph.</p>
<p dir="auto">I have sort of a solution by adding duplicate glyphs to the font and decompose, removeOverlap them. And automatically remove them when the observer was removed.</p>
<p dir="auto">But I know this can be done in a nicer way. But this code doesn't do the trick. But why not? Seems okay to me...</p>
<pre><code class="language-python">f = CurrentFont()

g = f['H']

temp = g.copy()
temp.decompose()
temp.removeOverlap()
for c in temp.components:
    print c #these must be gone...
drawGlyph(temp)
</code></pre>
<pre><code class="language-console">&lt;Component for I&gt;
&lt;Component for I&gt;
Traceback (most recent call last):
  File "&lt;untitled&gt;", line 10, in &lt;module&gt;
  File "main.py", line 29, in drawGlyph
  File "lib/fontObjects/robofabWrapper.pyc", line 2736, in draw
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/glyph.py", line 299, in draw
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/glyph.py", line 308, in drawPoints
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/defcon/objects/component.py", line 107, in drawPoints
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/robofab/pens/adapterPens.py", line 111, in addComponent
  File "/Applications/RoboFont_Beta.app/Contents/Resources/lib/python2.7/fontTools/pens/basePen.py", line 166, in addComponent
TypeError: 'NoneType' object has no attribute '__getitem__'&lt;/code&gt;
</code></pre>
<p dir="auto">Who can help?<br />
Thanks! Thom</p>
]]></description><link>https://forum.robofont.com/post/340</link><guid isPermaLink="true">https://forum.robofont.com/post/340</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Wed, 03 Jan 2018 15:31:30 GMT</pubDate></item><item><title><![CDATA[Reply to G.copy on Wed, 03 Jan 2018 15:29:32 GMT]]></title><description><![CDATA[<p dir="auto">he</p>
<p dir="auto">A copy has no parent anymore… so it cannot find the referenced glyph in a component. So decompose will not work.</p>
<p dir="auto">Maybe the best option is to set the parent in the copied glyph:</p>
<pre><code class="language-python">source = CurrentGlyph()
g = source.copy()
g.setParent(source.getParent())
</code></pre>
]]></description><link>https://forum.robofont.com/post/1268</link><guid isPermaLink="true">https://forum.robofont.com/post/1268</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 15:29:32 GMT</pubDate></item><item><title><![CDATA[Reply to G.copy on Fri, 10 Oct 2014 12:06:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">OK it draws. But still overlapped, and composed...</p>
]]></description><link>https://forum.robofont.com/post/1270</link><guid isPermaLink="true">https://forum.robofont.com/post/1270</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Fri, 10 Oct 2014 12:06:43 GMT</pubDate></item><item><title><![CDATA[Reply to G.copy on Wed, 03 Jan 2018 15:30:41 GMT]]></title><description><![CDATA[<p dir="auto">owke, this is idd not working cause a weakref object has to be referenced once or more.</p>
<p dir="auto">you could force it with:</p>
<pre><code class="language-python">g = CurrentGlyph()

copy = g.copy()

# get the internal font and set it hard in the internal glyph object, even it is a copy
copy.naked().setParent(g.naked().getParent())

copy.decompose()
copy.removeOverlap()

print copy.components
</code></pre>
]]></description><link>https://forum.robofont.com/post/1271</link><guid isPermaLink="true">https://forum.robofont.com/post/1271</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 15:30:41 GMT</pubDate></item><item><title><![CDATA[Reply to G.copy on Mon, 13 Oct 2014 13:56:38 GMT]]></title><description><![CDATA[<p dir="auto">Great, this works!<br />
Thanks!</p>
]]></description><link>https://forum.robofont.com/post/1272</link><guid isPermaLink="true">https://forum.robofont.com/post/1272</guid><dc:creator><![CDATA[thom]]></dc:creator><pubDate>Mon, 13 Oct 2014 13:56:38 GMT</pubDate></item></channel></rss>