A FontForge plug-in to harmonize or tunnify (balance) or add inflection points to the selected part

While working on my type family Elemaints, I have written several scripts that enhance the capabilities of FontForge. On https://github.com/linusromer/harmonize-tunnify-inflection I have published some of these tools, as you might find them useful too, if you are using FontForge.



Comments

  • ivan louetteivan louette Posts: 269
    edited November 23
    @Linus Romer WOW ! That's very good news. I have spent so much time to add inflection points to my FF drawings. Thanks you so much !
  • edited November 23
    @Linus Romer  very useful tool, first of all inflection points!
    btw. if I can suggest a little trick in Fontforge-Python that I discovered too late, because it is useful. You can avoid the definitions of
    harmonize_contours, harmonize_handles_contours, tunnify_contours, inflection_contours, harmonize_glyphs, harmonize_handles_glyphs, tunnify_glyphs, inflection_glyphs
    and use "junk" :smile: variable. Instead of:
       fontforge.registerMenuItem(harmonize_glyphs,are_glyphs_selected,None,"Font",None,"Harmonize");
    ...
    ...
    You can directly
    ...
  • James MontalbanoJames Montalbano Posts: 917
    edited November 23
    If needed I could have placed those additional points of inflection without the need of this script. That point on the right side of the shape really should be at the extreme and not where it is at the moment of being "tunnified". Use your eyes!
  • ivan louetteivan louette Posts: 269
    edited November 23
    @Linus Romer I installed it as explained and it appears in the Tools Menu. My FF version is the last PPA for Ubuntu 18.04 . I get this error :

  • AbrahamLeeAbrahamLee Posts: 245
    it’s exciting to see another person coding plugins for FontForge! Honestly, I thought I was the only one for a while. None of mine are publicly available yet, though, so you’ve 1-upped me there ;-)
  • Linus RomerLinus Romer Posts: 59
    edited November 24
    I have updated the plugin on https://github.com/linusromer/harmonize-tunnify-inflection. The plugin no longer relies on fontforge.point() and therefore should work now with older versions of FontForge (e.g. from 2017) too.
    @Grzegorz Luk (gluk) Indeed, this is a cool trick, it makes the code much more compact. I have implemented the trick in the new version. Thank you for the hint!
    If needed I could have placed those additional points of inflection without the need of this script.

    In automated processes one will still need a script in order to add points of inflection.

    That point on the right side of the shape really should be at the extreme and not where it is at the moment of being "tunnified". Use your eyes!

    I have never claimed any of these contours to be perfect. The non-horizontal-or-vertical node on the dot contour should demonstrate that the tools will work for such nodes, too.

    @ivan louette I think I have figured out what probably happend: You inserted an inflection point at the end of a contour. This led to a problem because the end node is identical with the start node. I have fixed this bug now. I hope it will work now for you.

    @AbrahamLee Unfortunately, there are hardly any plugins of FontForge available. I have only found the plugin in the FontForge documentation and those of David Crossland (which were worth a lot for me because the documentation is so sparse). I am looking forward to the publication of your scripts.


  • @Linus Romer Thanks for the update. However now Tool menu remain greyed and I get this message :

  • Linus RomerLinus Romer Posts: 59
    edited November 24
    @ivan louette According to the error message I assume you have downloaded the html-file instead of the raw file. The direct link to the file (without html view) is:
    https://raw.githubusercontent.com/linusromer/harmonize-tunnify-inflection/master/harmonize_tunnify_inflection.py
  • @Linus Romer OOOOPS ! I was so silly ! :smiley: Now it works like a charm on my current 2017 FF ! Thanks for your patience :wink:
  • Stefan PeevStefan Peev Posts: 67
    edited November 25
    @Linus Romer I downloaded the file from the link above, but...

    I use Windows 8.1 and the latest an official version of FontForge.
  • AbrahamLeeAbrahamLee Posts: 245
    @AbrahamLee Unfortunately, there are hardly any plugins of FontForge available. I have only found the plugin in the FontForge documentation and those of David Crossland (which were worth a lot for me because the documentation is so sparse).
    Absolutely true. This was a really frustrating realization I came to as well when there are so many awesome ones for Glyphs, Robofont, Fontlab, etc. Once I was able to really figure out how to do it (and it was very much NOT easy or obvious), I have had way too much fun creating useful plugins for all levels of font production/deveopment (i.e., font level, glyph level, contour level, etc.).
    I am looking forward to the publication of your scripts.
    Me too ;-) I don't have a specific plan for this, but I really do hope to some day.
  • Linus RomerLinus Romer Posts: 59
    edited November 26
    @Stefan Peev Thanks for the note. This bug was due to the windows path "C:\Users..." in the docstring. Under Linux there were no complaints but under Windows "\U" obviously must not be contained in the docstring. I have fixed the bug and tested the new version with Windows (and it worked):

  • @Linus Romer Thank you. Now it works for me too.
  • I was asked if my plugin could be part of the (future) contrib scripts of FontForge. Therefore, I had to change a few things and I will release the updated plugin under a new name (because the compatibility to FontForge2017 will be broken). However, I am not sure what name will fit the plugin. At the moment, I have chosen "Curvatura" because my tools are related to curvature and "Curvatura" is understandable in many languages and "Curvatura.py" is not as overused as "Curvature.py":
    If you have a better name for the plugin, I would be glad to read it here.
  • This is really interesting and useful. Any interest in doing the same for FL5?
  • @Jeremy Dooley Unfortunately, I do not own a copy of Fontlab 5, which is a bad precondition for testing and supporting. However, if someone wants to adapt the script: Feel free to use my script (under the conditions of the GPL). For all the actions in my plugin there are low level methods that can be used 1:1 for FontLab.
  • Thanks for the info, Linus and for your contribution to the community.
Sign In or Register to comment.