<?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[Observers and events]]></title><description><![CDATA[<p dir="auto">Is it possible to add an observer that watches the edit field in the Space Center? I can read the contents of the current Space Center manually, but I want to be able to react whenever the user types or edits the sample text in the edit field.</p>
]]></description><link>https://forum.robofont.com/topic/106/observers-and-events</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 19:22:35 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/106.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Mar 2012 13:20:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Observers and events on Wed, 03 Jan 2018 21:55:02 GMT]]></title><description><![CDATA[<p dir="auto">Is it possible to add an observer that watches the edit field in the Space Center? I can read the contents of the current Space Center manually, but I want to be able to react whenever the user types or edits the sample text in the edit field.</p>
]]></description><link>https://forum.robofont.com/post/106</link><guid isPermaLink="true">https://forum.robofont.com/post/106</guid><dc:creator><![CDATA[marksimonson]]></dc:creator><pubDate>Wed, 03 Jan 2018 21:55:02 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Wed, 03 Jan 2018 21:48:09 GMT]]></title><description><![CDATA[<p dir="auto">This is a feature planned feature for the next version.<br />
Something similar like tools and his observers for the Glyph View but enhanced for Space Center.</p>
<p dir="auto">see <a href="http://cl.ly/ExxK" rel="nofollow">http://cl.ly/ExxK</a> :)</p>
<p dir="auto">It is possible but it will be with some detours....</p>
]]></description><link>https://forum.robofont.com/post/652</link><guid isPermaLink="true">https://forum.robofont.com/post/652</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 21:48:09 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Wed, 03 Jan 2018 21:49:15 GMT]]></title><description><![CDATA[<p dir="auto">Okay, plan B then.</p>
<p dir="auto">Is there a way to go back and forth between a list of glyphs and a string? For example,</p>
<p dir="auto">Go from this:</p>
<pre><code class="language-python">['H', 'e', 'l', 'l', 'o', 'exclam']
</code></pre>
<p dir="auto">to this:</p>
<pre><code class="language-python">"Hello!"
</code></pre>
<p dir="auto">and back again? Seems like there should be something like this built into one of the included packages, but I don't know where to start looking.</p>
]]></description><link>https://forum.robofont.com/post/653</link><guid isPermaLink="true">https://forum.robofont.com/post/653</guid><dc:creator><![CDATA[marksimonson]]></dc:creator><pubDate>Wed, 03 Jan 2018 21:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Wed, 03 Jan 2018 21:50:37 GMT]]></title><description><![CDATA[<p dir="auto">Everything is depending on the font you want to use and the character unicode mapping inside that font.</p>
<p dir="auto">you can use something similar:</p>
<pre><code class="language-python">## this is used internally to split inputted text to a list of glyph names based on the current font
from lib.UI.spaceCenter.glyphSequenceEditText import splitText
from robofab.interface.all.dialogs import AskString

## get some text
text = AskString("input")
print "input:", text

font = CurrentFont()

## the character map
cmap = font.getCharacterMapping()

## split the text based on the camp in to a list of glyph names
glyphNameList = splitText(text, cmap)

print "as glyph names list:", glyphNameList

## loop over the glyph names asks for their unicode value in the current font
## convert it back to text based on that unicode value
backToText = u""
for glyphName in glyphNameList:
    if glyphName in font:
        glyph = font[glyphName]
        if glyph.unicode is not None:
            backToText += u"%s" % (unichr(glyph.unicode))
        else:
            backToText += "/%s " % glyphName    
    else:
        backToText += "/%s " % glyphName

print "backtoText:", backToText
</code></pre>
<p dir="auto">hope this makes sense.</p>
]]></description><link>https://forum.robofont.com/post/654</link><guid isPermaLink="true">https://forum.robofont.com/post/654</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 21:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Tue, 13 Mar 2012 20:51:00 GMT]]></title><description><![CDATA[<p dir="auto">Ah, okay. I may be able to work from this.</p>
<p dir="auto">Essentially, though, I have a little window built with vanilla with a textEditor in it, and I want to get and set the text in the Space Center text field. This is in the form of a list of glyph names, while the vanilla textEditor field is in the form of a string.</p>
<p dir="auto">The font I'm using is whatever the default is in the vanilla textEditor field (Helvetica of some kind).</p>
]]></description><link>https://forum.robofont.com/post/655</link><guid isPermaLink="true">https://forum.robofont.com/post/655</guid><dc:creator><![CDATA[marksimonson]]></dc:creator><pubDate>Tue, 13 Mar 2012 20:51:00 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Wed, 03 Jan 2018 21:52:38 GMT]]></title><description><![CDATA[<p dir="auto">mmmm, oke</p>
<p dir="auto">I'm kind of guessing what you want to achieve but maybe this can help to.</p>
<p dir="auto">A <code>SpaceCenter</code> object also has a <code>setRaw</code> and <code>getRaw</code> methods, expecting a string, text as input or return.</p>
<pre><code class="language-python">from robofab.interface.all.dialogs import AskString
from mojo.UI import CurrentSpaceCenter

sp = CurrentSpaceCenter()

text = AskString("input")
sp.setRaw(text)
</code></pre>
<p dir="auto">(I've just updated <a href="http://doc.robofont.com/api/mojo/mojo-ui/" rel="nofollow">http://doc.robofont.com/api/mojo/mojo-ui/</a> with <code>getRaw</code> and <code>setRaw</code>)</p>
]]></description><link>https://forum.robofont.com/post/656</link><guid isPermaLink="true">https://forum.robofont.com/post/656</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 03 Jan 2018 21:52:38 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Tue, 13 Mar 2012 21:28:26 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that will work! Thanks!</p>
<p dir="auto">Sorry for not being clearer about what I was trying to accomplish -- I could have spared you from writing all that code in your previous response. I appreciate your time.</p>
]]></description><link>https://forum.robofont.com/post/657</link><guid isPermaLink="true">https://forum.robofont.com/post/657</guid><dc:creator><![CDATA[marksimonson]]></dc:creator><pubDate>Tue, 13 Mar 2012 21:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Tue, 13 Mar 2012 23:00:28 GMT]]></title><description><![CDATA[<p dir="auto">Here's the script I've been working on:</p>
<p dir="auto"><a href="http://www.ms-studio.com/Robofont/PangrammerHelper.py" rel="nofollow">http://www.ms-studio.com/Robofont/PangrammerHelper.py</a></p>
<p dir="auto">It's a little window for composing pangrams. If Space Center is active, it displays them there as well.</p>
]]></description><link>https://forum.robofont.com/post/659</link><guid isPermaLink="true">https://forum.robofont.com/post/659</guid><dc:creator><![CDATA[marksimonson]]></dc:creator><pubDate>Tue, 13 Mar 2012 23:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to Observers and events on Wed, 14 Mar 2012 07:45:59 GMT]]></title><description><![CDATA[<p dir="auto">great!<br />
thanks</p>
]]></description><link>https://forum.robofont.com/post/661</link><guid isPermaLink="true">https://forum.robofont.com/post/661</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Wed, 14 Mar 2012 07:45:59 GMT</pubDate></item></channel></rss>