<?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[Observe point changes&#x2F;movements?]]></title><description><![CDATA[<p dir="auto">I'm hoping to record the changes made to points in glyphs. My current plan is to make a dictionary of point locations when a glyph is opened (or possibly just accessing the glif data), then comparing point locations when points are moved, and making a dictionary of point movements.</p>
<p dir="auto">Is there an observer that can send a notification when points are moved?</p>
<p dir="auto">I'm hoping for something along the lines of <code>pointMovedInCurrentGlyph</code>, so I could add something like this to my code...</p>
<pre><code>addObserver(self, 'recordPointMovement', "pointMovedInCurrentGlyph") # fake code
</code></pre>
<p dir="auto">...but I'm not finding anything obvious.</p>
<p dir="auto">Am I missing something? How might I best approach this?</p>
]]></description><link>https://forum.robofont.com/topic/515/observe-point-changes-movements</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 23:22:01 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/515.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Oct 2018 13:01:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Mon, 08 Oct 2018 13:49:32 GMT]]></title><description><![CDATA[<p dir="auto">I'm hoping to record the changes made to points in glyphs. My current plan is to make a dictionary of point locations when a glyph is opened (or possibly just accessing the glif data), then comparing point locations when points are moved, and making a dictionary of point movements.</p>
<p dir="auto">Is there an observer that can send a notification when points are moved?</p>
<p dir="auto">I'm hoping for something along the lines of <code>pointMovedInCurrentGlyph</code>, so I could add something like this to my code...</p>
<pre><code>addObserver(self, 'recordPointMovement', "pointMovedInCurrentGlyph") # fake code
</code></pre>
<p dir="auto">...but I'm not finding anything obvious.</p>
<p dir="auto">Am I missing something? How might I best approach this?</p>
]]></description><link>https://forum.robofont.com/post/1731</link><guid isPermaLink="true">https://forum.robofont.com/post/1731</guid><dc:creator><![CDATA[StephenNixon]]></dc:creator><pubDate>Mon, 08 Oct 2018 13:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Tue, 09 Oct 2018 07:46:20 GMT]]></title><description><![CDATA[<p dir="auto">There is a <code>Contour.PointsChanged</code> notification for a contour object.</p>
<p dir="auto">There are no notifications for each point object.</p>
<p dir="auto">a tiny script that shows all font level notifications:</p>
<pre><code class="language-python">
import vanilla


class AllNotifications(object):
    
    def __init__(self):
        
        self.w = vanilla.Window((400, 400), minSize=(200, 200))
        self.w.e = vanilla.TextEditor((0, 0, 0, 0))
        # keep a ref otherwise weak ref will not work
        self.w._ref = self
        self.w.bind("close", self.windowClose)
        self.w.open()
        
        self.font = CurrentFont().naked()        
        self.font.dispatcher.addObserver(self, "callback", notification=None, observable=None)
    
    def windowClose(self, sender):
        # remove the observer
        self.font.dispatcher.removeObserver(self, notification=None, observable=None)
        # remove the references
        del self.w._ref    
        del self.font
        
    def callback(self, notification):
        txt = "\n%s --&gt; %s" % (notification.name, notification.object)        
        self.w.e.set(self.w.e.get() + txt)
 
 
AllNotifications()
</code></pre>
]]></description><link>https://forum.robofont.com/post/1733</link><guid isPermaLink="true">https://forum.robofont.com/post/1733</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Tue, 09 Oct 2018 07:46:20 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Tue, 09 Oct 2018 15:16:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/1">@frederik</a> said in <a href="/post/1733">Observe point changes/movements?</a>:</p>
<blockquote>
<p dir="auto">Contour.PointsChanged</p>
</blockquote>
<p dir="auto">Amazing, thank you! I'll give this a shot tonight and see where it gets me.</p>
]]></description><link>https://forum.robofont.com/post/1734</link><guid isPermaLink="true">https://forum.robofont.com/post/1734</guid><dc:creator><![CDATA[StephenNixon]]></dc:creator><pubDate>Tue, 09 Oct 2018 15:16:02 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Wed, 10 Oct 2018 15:56:43 GMT]]></title><description><![CDATA[<p dir="auto">It's working nicely to show that a point moved!</p>
<p dir="auto">Is there a simple way to know <em>which</em> point moved, once I get the notification? The notification I receive is:</p>
<pre><code class="language-console">Contour.PointsChanged --&gt; &lt;lib.fontObjects.doodleContour.DoodleContour object at 0x112f24320&gt;
</code></pre>
<p dir="auto">Ideally, I'd want to get to data which was the point index with its parent contour index.</p>
<p dir="auto">If I print <code>notification.data</code>, it only gives <code>None</code>.</p>
<p dir="auto">Does the <code>object at 0x112f24320</code> mean anything?</p>
<p dir="auto">Would I have to do something like looping through all points to compare them to a "before" state (possibly in another layer), then assign changed points a unique identifier with <a href="https://ts-defcon.readthedocs.io/en/latest/objects/contour.html#defcon.Contour.generateIdentifierForPoint" rel="nofollow">generateIdentifierForPoint(point)</a>?</p>
]]></description><link>https://forum.robofont.com/post/1744</link><guid isPermaLink="true">https://forum.robofont.com/post/1744</guid><dc:creator><![CDATA[StephenNixon]]></dc:creator><pubDate>Wed, 10 Oct 2018 15:56:43 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Wed, 10 Oct 2018 15:55:57 GMT]]></title><description><![CDATA[<p dir="auto">the <code>Contour.PointsChanged</code> calls your callback with a notification object:</p>
<pre><code class="language-python">notification.object # in this case the contour object
notification.data # optional data related to the event, in this case it will be None
</code></pre>
<p dir="auto">this notification is sent on different events: inserting, removing, changing start point...</p>
<p dir="auto">in most cases the moved points are the selected ones:</p>
<pre><code class="language-python">glyph.selectedPoints
</code></pre>
]]></description><link>https://forum.robofont.com/post/1748</link><guid isPermaLink="true">https://forum.robofont.com/post/1748</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 10 Oct 2018 15:55:57 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Fri, 12 Oct 2018 11:55:11 GMT]]></title><description><![CDATA[<p dir="auto">Ohh of course, that is simpler than I was thinking!</p>
<p dir="auto">I suppose that the only time points would move without being selected is if they were moved by a script, right?</p>
]]></description><link>https://forum.robofont.com/post/1761</link><guid isPermaLink="true">https://forum.robofont.com/post/1761</guid><dc:creator><![CDATA[StephenNixon]]></dc:creator><pubDate>Fri, 12 Oct 2018 11:55:11 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Fri, 12 Oct 2018 12:32:48 GMT]]></title><description><![CDATA[<p dir="auto">a script or something else like fe a transormation from the inspector</p>
]]></description><link>https://forum.robofont.com/post/1762</link><guid isPermaLink="true">https://forum.robofont.com/post/1762</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Fri, 12 Oct 2018 12:32:48 GMT</pubDate></item><item><title><![CDATA[Reply to Observe point changes&#x2F;movements? on Fri, 12 Oct 2018 14:38:50 GMT]]></title><description><![CDATA[<p dir="auto">Makes sense. Thanks so much for your help!</p>
]]></description><link>https://forum.robofont.com/post/1766</link><guid isPermaLink="true">https://forum.robofont.com/post/1766</guid><dc:creator><![CDATA[StephenNixon]]></dc:creator><pubDate>Fri, 12 Oct 2018 14:38:50 GMT</pubDate></item></channel></rss>