<?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[Clean curve&#x2F;remove points]]></title><description><![CDATA[<p dir="auto">Hi there,<br />
my outlines have too many points due to how I generate the glyphs (via Phython/mathematical functions). Therefore I have to do some “cleaning” before interpolation.<br />
In FontLab7 I found the comment “<strong>Contour &gt; clean up</strong>” which does what I want (see two screenshots below), but I would like to avoid jumping cross programs as I do everything else in RoboFont.<br />
However, I can't find anything in RF doing something similar. Any help appreciated!<br />
Thanks in advance,<br />
Petra</p>
<p dir="auto">Screenshot before:<br />
<img src="/assets/uploads/files/1609961454131-removepoints_1-resized.jpg" alt="RemovePoints_1.jpg" class="img-responsive img-markdown" /><br />
Screenshot after:<br />
<img src="/assets/uploads/files/1609961461091-removepoints_2-resized.jpg" alt="RemovePoints_2.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.robofont.com/topic/919/clean-curve-remove-points</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 00:37:58 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/919.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Jan 2021 19:33:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Wed, 06 Jan 2021 19:33:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi there,<br />
my outlines have too many points due to how I generate the glyphs (via Phython/mathematical functions). Therefore I have to do some “cleaning” before interpolation.<br />
In FontLab7 I found the comment “<strong>Contour &gt; clean up</strong>” which does what I want (see two screenshots below), but I would like to avoid jumping cross programs as I do everything else in RoboFont.<br />
However, I can't find anything in RF doing something similar. Any help appreciated!<br />
Thanks in advance,<br />
Petra</p>
<p dir="auto">Screenshot before:<br />
<img src="/assets/uploads/files/1609961454131-removepoints_1-resized.jpg" alt="RemovePoints_1.jpg" class="img-responsive img-markdown" /><br />
Screenshot after:<br />
<img src="/assets/uploads/files/1609961461091-removepoints_2-resized.jpg" alt="RemovePoints_2.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.robofont.com/post/3555</link><guid isPermaLink="true">https://forum.robofont.com/post/3555</guid><dc:creator><![CDATA[Manufraktur]]></dc:creator><pubDate>Wed, 06 Jan 2021 19:33:06 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Fri, 08 Jan 2021 09:24:10 GMT]]></title><description><![CDATA[<p dir="auto">There is not such a feature in RoboFont, yet</p>
<p dir="auto">RoboFont does recurve as much as possible when deleting a point.</p>
<p dir="auto">So that means all the building blocks are there to make a clean up tool.</p>
<p dir="auto"><strong>the plan:</strong></p>
<ul>
<li>make a copy of the glyph</li>
<li>delete one point in the copy</li>
<li>check if curve is almost the same as the original, maybe with an controlled error value</li>
<li>continue doing this until you can not delete points anymore or when all points are required to draw the shape</li>
</ul>
<p dir="auto">good luck!!!</p>
]]></description><link>https://forum.robofont.com/post/3557</link><guid isPermaLink="true">https://forum.robofont.com/post/3557</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Fri, 08 Jan 2021 09:24:10 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Fri, 08 Jan 2021 18:28:17 GMT]]></title><description><![CDATA[<p dir="auto">Thank you Frederik.<br />
The thing is that we're talking about a few hundred glyphs – which get generated on one click. So deleting all the points in each glyph cannot be done over and over again. (My font file is basically a Pyhthon script which gets generated on need.)<br />
Worst case I have to import the file in FontLab, but I was hoping to be able to avoid that.</p>
]]></description><link>https://forum.robofont.com/post/3559</link><guid isPermaLink="true">https://forum.robofont.com/post/3559</guid><dc:creator><![CDATA[Manufraktur]]></dc:creator><pubDate>Fri, 08 Jan 2021 18:28:17 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Sat, 09 Jan 2021 17:51:17 GMT]]></title><description><![CDATA[<p dir="auto">I was not talking about doing it manually :)</p>
<p dir="auto">Just wrote it down in pseudo code how to solve this. I dont have much time left. Not my intention to scare you, more to trigger you or someone else to write this little script :)</p>
]]></description><link>https://forum.robofont.com/post/3561</link><guid isPermaLink="true">https://forum.robofont.com/post/3561</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Sat, 09 Jan 2021 17:51:17 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Sun, 10 Jan 2021 19:13:43 GMT]]></title><description><![CDATA[<p dir="auto">Ahh, ok, now I got it. But I suspect my coding skills are not good enough yet to translate this into code. As my question is not urgent, I will try it myself first anyway and see where I get. I will post whatever solution I come up with.<br />
Cheers,<br />
P</p>
]]></description><link>https://forum.robofont.com/post/3562</link><guid isPermaLink="true">https://forum.robofont.com/post/3562</guid><dc:creator><![CDATA[Manufraktur]]></dc:creator><pubDate>Sun, 10 Jan 2021 19:13:43 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Mon, 11 Jan 2021 20:29:41 GMT]]></title><description><![CDATA[<p dir="auto">For what it’s worth, here’s how I tend to approach the problem in a non-code way:</p>
<ol>
<li>Copy the contour and then paste it to a background layer. Make sure this layer is visible, via the Inspector.</li>
<li>Select a point that isn’t needed, and hit <code>delete</code>. Adjust the path as needed to match the background contour as much as you want, while considering whether you can improve upon that.</li>
<li>Repeat!</li>
</ol>
<p dir="auto">If you had a bunch of glyphs to clean up, this would obviously be a hassle. But, often, it is probably better to have precise control over exactly how you are simplifying paths. It will result in cleaner curves, and helps you be careful to consider interpolation compatibility as you go (if needed).</p>
]]></description><link>https://forum.robofont.com/post/3563</link><guid isPermaLink="true">https://forum.robofont.com/post/3563</guid><dc:creator><![CDATA[ArrowType]]></dc:creator><pubDate>Mon, 11 Jan 2021 20:29:41 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Tue, 12 Jan 2021 13:31:34 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, ArrowType.<br />
Your described process is how I was approaching the issue until now – I have tried a few glyphs manually, to test. But now I am in the phase of my project where I have to switch to “mass production”, otherwise my whole approach wouldn't make sense. (It's a student project where I rebuild type which was defined by a mathematical system from a writing master of the 18th century.)</p>
]]></description><link>https://forum.robofont.com/post/3564</link><guid isPermaLink="true">https://forum.robofont.com/post/3564</guid><dc:creator><![CDATA[Manufraktur]]></dc:creator><pubDate>Tue, 12 Jan 2021 13:31:34 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Thu, 14 Jan 2021 02:02:40 GMT]]></title><description><![CDATA[<p dir="auto">Apologies if I’m misunderstanding the question, but I was recently playing around with some code to something similar — in my case, to iterate over all the glyphs in a font, and then automatically delete any non-extrema points (and from your illustration, that looks like what you’re trying to do as well).</p>
<p dir="auto">It works in my case because the the non-extrema points are usually extraneous, so the RoboFont point-deletion recurve algorithm "solves" the deletion correctly.</p>
<p dir="auto">No error checking or anything like that, as Frederik suggested, but hopefully it might still help you.</p>
<pre><code>for glyph in CurrentFont():
    glyph.deselect()
    for contour in glyph.contours:
        for bp in contour.bPoints:
            ix, iy = bp.bcpIn
            ox, oy = bp.bcpOut
            if bp.type == "corner":
                continue
            if abs(ox-ix) &gt; 5 and abs(oy-iy) &gt; 5:
                bp.selected = True

    if True:
        glyph.removeSelection(
            removePoints=True,
            removeComponents=False,
            removeAnchors=False,
            removeImages=False)
</code></pre>
]]></description><link>https://forum.robofont.com/post/3565</link><guid isPermaLink="true">https://forum.robofont.com/post/3565</guid><dc:creator><![CDATA[robstenson]]></dc:creator><pubDate>Thu, 14 Jan 2021 02:02:40 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Fri, 22 Jan 2021 14:14:01 GMT]]></title><description><![CDATA[<p dir="auto">Thank you Rob for all the effort you made (in the background) to help me and solve my problem. Highly appreciated!<br />
I will post the final code here:</p>
<pre><code>import math

def calc_vector(point1, point2):
    x1, y1 = point1
    x2, y2 = point2
    dx = x2 - x1
    dy = y2 - y1
    return dx, dy

def calc_angle(point1, point2):
    dx, dy = calc_vector(point1, point2)
    return math.degrees(math.atan2(dy, dx))

def bp_angles(bp):
    ax, ay = bp.anchor
    ix, iy = bp.bcpIn
    ox, oy = bp.bcpOut
    in_angle = calc_angle((ix+ax, iy+ay), bp.anchor)
    out_angle = calc_angle(bp.anchor, (ox+ax, oy+ay))
    diff = abs(in_angle - out_angle)
    return in_angle, out_angle, diff

def select_extra_points(glyph, remove=False):
    if False: # flip to True if you want to select a point and see it’s angles printed, useful for debugging
        for bp in glyph.selectedBPoints:
            in_angle, out_angle, diff = bp_angles(bp)
            print("----------", in_angle, out_angle, diff)
    else:
        glyph.deselect()
        for contour in glyph.contours:
            for bp in contour.bPoints:
                in_angle, out_angle, diff = bp_angles(bp)
                if diff &lt; 10:
                    if abs(abs(in_angle / 90) - round(abs(in_angle / 90))) &gt; 0.1:
                        bp.selected = True

        if remove:
            glyph.removeSelection(
                removePoints=True,
                removeComponents=False,
                removeAnchors=False,
                removeImages=False)
                
glyph = CurrentGlyph()
#glyph.removeOverlap(round=1)
select_extra_points(glyph, remove=False)

# To run on the entire font
#for glyph in CurrentFont():
#    select_extra_points(glyph, remove=True)
</code></pre>
]]></description><link>https://forum.robofont.com/post/3566</link><guid isPermaLink="true">https://forum.robofont.com/post/3566</guid><dc:creator><![CDATA[Manufraktur]]></dc:creator><pubDate>Fri, 22 Jan 2021 14:14:01 GMT</pubDate></item><item><title><![CDATA[Reply to Clean curve&#x2F;remove points on Fri, 22 Jan 2021 15:15:35 GMT]]></title><description><![CDATA[<p dir="auto">super!!! thanks <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/266">@robstenson</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/443">@Manufraktur</a></p>
]]></description><link>https://forum.robofont.com/post/3567</link><guid isPermaLink="true">https://forum.robofont.com/post/3567</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Fri, 22 Jan 2021 15:15:35 GMT</pubDate></item></channel></rss>