<?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[Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs]]></title><description><![CDATA[<p dir="auto">Glyph layer and mark not imported from UFOCentral</p>
<p dir="auto">for layers/masks:<br />
UFOCentral generates this markup:<br />
<code>org.robofab.fontlab.maskData</code><br />
RoFo generates this markup:<br />
<code>com.typemytype.robofont.layerData</code></p>
<p dir="auto">for marks:<br />
UFOCentral generates this markup:<br />
<code>org.robofab.fontlab.mark</code><br />
RoFo generates this markup:<br />
<code>com.typemytype.robofont.mark</code></p>
<p dir="auto">A quick hack of the UFO replacing those entries crashes RoFo on opening.<br />
(I did not reorder the tags but this should not matter in XML, right?)</p>
]]></description><link>https://forum.robofont.com/topic/48/glyph-mask-and-mark-data-not-imported-from-fls-ufocentral-generated-ufos</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 02:26:56 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/48.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Oct 2011 13:08:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:30:29 GMT]]></title><description><![CDATA[<p dir="auto">Glyph layer and mark not imported from UFOCentral</p>
<p dir="auto">for layers/masks:<br />
UFOCentral generates this markup:<br />
<code>org.robofab.fontlab.maskData</code><br />
RoFo generates this markup:<br />
<code>com.typemytype.robofont.layerData</code></p>
<p dir="auto">for marks:<br />
UFOCentral generates this markup:<br />
<code>org.robofab.fontlab.mark</code><br />
RoFo generates this markup:<br />
<code>com.typemytype.robofont.mark</code></p>
<p dir="auto">A quick hack of the UFO replacing those entries crashes RoFo on opening.<br />
(I did not reorder the tags but this should not matter in XML, right?)</p>
]]></description><link>https://forum.robofont.com/post/48</link><guid isPermaLink="true">https://forum.robofont.com/post/48</guid><dc:creator><![CDATA[jbl]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:30:29 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:24:57 GMT]]></title><description><![CDATA[<p dir="auto">RoboFont is already using the color scheme of UFO3 which stated that colors are a tuple of <code>(r, g, b, a)</code></p>
<p dir="auto">You could convert the font lab HSV color to rgba with this tiny script:</p>
<pre><code class="language-python">import colorsys
f = CurrentFont()

for g in f:
    fontLabMarkColor = g.lib.get("org.robofab.fontlab.maskData")
    
    if fontLabMarkColor is None:
        continue
    
    r, g, b = colorsys.hsv_to_rgb(fontLabMarkColor/256., 1., 1.)
    
    g.mark = (r, g, b, 1)
</code></pre>
]]></description><link>https://forum.robofont.com/post/473</link><guid isPermaLink="true">https://forum.robofont.com/post/473</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Mon, 10 Oct 2011 19:53:12 GMT]]></title><description><![CDATA[<p dir="auto">Thank you!</p>
]]></description><link>https://forum.robofont.com/post/474</link><guid isPermaLink="true">https://forum.robofont.com/post/474</guid><dc:creator><![CDATA[jbl]]></dc:creator><pubDate>Mon, 10 Oct 2011 19:53:12 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:25:15 GMT]]></title><description><![CDATA[<p dir="auto">Does this still work? I have the same problem; <code>org.robofab.fontlab.maskData</code> exist in the UFO, but I can’t get it visible in RoboFont</p>
]]></description><link>https://forum.robofont.com/post/843</link><guid isPermaLink="true">https://forum.robofont.com/post/843</guid><dc:creator><![CDATA[bruno]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:25:15 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Fri, 05 Oct 2012 12:56:06 GMT]]></title><description><![CDATA[<p dir="auto">This script should work to convert FL mark colors to UFO mark colors</p>
]]></description><link>https://forum.robofont.com/post/844</link><guid isPermaLink="true">https://forum.robofont.com/post/844</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Fri, 05 Oct 2012 12:56:06 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:26:16 GMT]]></title><description><![CDATA[<p dir="auto">Because <code>com.typemytype.robofont.layerData</code> &amp; <code>org.robofab.fontlab.maskData</code> are not in the same format, replacing these will not make the layers appear in RoboFont as mentioned (As I understood it) above. From that I conclude that either UFOcentral or RoboFont have been updated in how they write layerdata?</p>
<p dir="auto">Updated code below will port the colour:</p>
<pre><code class="language-python">import colorsys
f = CurrentFont()
for glyph in f:
    fontLabMarkColor = glyph.lib.get("org.robofab.fontlab.mark")
    if fontLabMarkColor is None:
        continue
    r, g, b = colorsys.hsv_to_rgb(fontLabMarkColor/256., 1., 1.)
    glyph.mark = (r, g, b, 1)
</code></pre>
]]></description><link>https://forum.robofont.com/post/845</link><guid isPermaLink="true">https://forum.robofont.com/post/845</guid><dc:creator><![CDATA[bruno]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:26:16 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:27:30 GMT]]></title><description><![CDATA[<p dir="auto">Tonight I've decided to switch from FLS to RF. As I was testing the conversion, I noticed that Masks didn't end up in RF. I searched the forum and found this post, unfortunately even after running your script, before using UFO Central to export as UFO, I can't manage to see my Masks. "Format 2" and "Glyph Masks" boxes are checked.</p>
<p dir="auto">I've noticed that running the above script doesn't seem to modify the .vfb file, or FLS doesn't notice it, because I can close my font file without being prompted to Save.</p>
<p dir="auto">Version 1.3.1b (built 1211021533)<br />
OS 10.7.5</p>
]]></description><link>https://forum.robofont.com/post/924</link><guid isPermaLink="true">https://forum.robofont.com/post/924</guid><dc:creator><![CDATA[mathieu-christe]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:27:30 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 04 Jan 2018 11:29:33 GMT]]></title><description><![CDATA[<p dir="auto">Hey Mathieu,</p>
<ol>
<li>Run <a href="http://code.typesupply.com/browser/applicationScripts/FontLab/UFO/UFOCentral.py" rel="nofollow">UFO Central</a> in FontLab to export your font to ufo (make sure export layers is ticked)</li>
<li>Open the UFO in Robofont</li>
<li>Run the following code in RoboFont to get your lay­er­data drawn:</li>
</ol>
<pre><code class="language-python">import colorsys

f = CurrentFont()

MASK_LIB_KEY = "org.robofab.fontlab.maskData"
MARK_LIB_KEY = "org.robofab.fontlab.mark"

def portFLmark(glyph):
    fontLabMarkColor = glyph.lib.get("org.robofab.fontlab.mark")
    if fontLabMarkColor is not None:
        r, g, b = colorsys.hsv_to_rgb(fontLabMarkColor/256., 1., 1.)
        glyph.mark = (r, g, b, 1)

def portFLmaskData(glyph):
    # get pendata
    # filter out any single point contours (anchors)
    instructions = []
    pointStack = []
    lib = glyph.lib
    
    if lib.has_key(MASK_LIB_KEY):
        instructions = lib[MASK_LIB_KEY]
        pen = glyph.getPointPen()
        instructionsDrawPoints(instructions, pen)
        # clear the mask data from the glyph lib
        del lib[MASK_LIB_KEY]

    glyph.update()

def instructionsDrawPoints(instructions, pointPen):
    """draw instructions created by InstructionPointPen"""
    # filter out single point contours (anchors)
    pointStack = []
    for instruction in instructions:
        pointStack.append(instruction)
        meth = instruction["method"]
        if meth == "endPath":
            if len(pointStack) &amp;gt; 3:
                _drawPointStack(pointStack, pointPen)
            pointStack = []
            
def _drawPointStack(stack, pointPen):
    for instruction in stack:
        meth = instruction["method"]
        if meth == "beginPath":
            pointPen.beginPath()
        elif meth == "endPath":
            pointPen.endPath()
        elif meth == "addPoint":
            pt = instruction["pt"]
            smooth = instruction.get("smooth")
            segmentType = instruction.get("segmentType")
            name = instruction.get("name")
            pointPen.addPoint(pt, segmentType, smooth, name)
        elif meth == "addComponent":
            baseGlyphName = instruction["baseGlyphName"]
            transformation = instruction["transformation"]
            pointPen.addComponent(baseGlyphName, transformation)
        else:
            raise NotImplementedError, meth

for glyph in f:
    # port the colour marks
    portFLmark(glyph)
    # create/get the layer for the mask data
    glyph.getLayer("FontLab Mask")
    # flip it so we draw on a clean layer
    glyph.flipLayers("FontLab Mask", "foreground")
    portFLmaskData(glyph)
    # flip back we’re done
    glyph.flipLayers("FontLab Mask", "foreground")

print "Done"
</code></pre>
<p dir="auto">Hope that helps.</p>
]]></description><link>https://forum.robofont.com/post/925</link><guid isPermaLink="true">https://forum.robofont.com/post/925</guid><dc:creator><![CDATA[bruno]]></dc:creator><pubDate>Thu, 04 Jan 2018 11:29:33 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 29 Nov 2012 14:36:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi Bruno,</p>
<p dir="auto">Many thanks for kindly sharing your script, which works very well. The Mask layer and its content are back into RoboFont.<br />
Looking at my translated file, I've just realised that the anchors (accents) are gone. I was expecting the anchors to fall into the category of "Glyphs Marks" when exporting to UFO. It seems again that RoboFont can't see or display them. I'm guessing it because if I export to UFO from FLS and then import the very same UFO file, the anchors are there.</p>
<p dir="auto">Did you manage to get your FLS accent anchors into RoboFont?</p>
<p dir="auto">All the best,</p>
<p dir="auto">Mathieu</p>
]]></description><link>https://forum.robofont.com/post/926</link><guid isPermaLink="true">https://forum.robofont.com/post/926</guid><dc:creator><![CDATA[mathieu-christe]]></dc:creator><pubDate>Thu, 29 Nov 2012 14:36:56 GMT</pubDate></item><item><title><![CDATA[Reply to Glyph mask and mark data not imported from FLS+UFOCentral-generated UFOs on Thu, 29 Nov 2012 15:02:02 GMT]]></title><description><![CDATA[<p dir="auto">Damn, without switching on Display Anchors, it's hard to see them ;-)<br />
I think I'm set to switch and work mostly in RoboFont, thank you for your help Bruno.</p>
]]></description><link>https://forum.robofont.com/post/927</link><guid isPermaLink="true">https://forum.robofont.com/post/927</guid><dc:creator><![CDATA[mathieu-christe]]></dc:creator><pubDate>Thu, 29 Nov 2012 15:02:02 GMT</pubDate></item></channel></rss>