Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Solved
    • Unsolved
    1. Home
    2. Tags
    3. scripting
    Log in to post

    • joanca

      Create a font object but not open
      General Questions • scripting documentation • • joanca  

      6
      0
      Votes
      6
      Posts
      772
      Views

      frederik

      I bundled all documentation on a single html page. http://doc.robofont.com/the-complete-robofont-guide/
    • joanca

      Remove Glyph as alt-delete (robofab?)
      General Questions • scripting template glyphs • • joanca  

      2
      0
      Votes
      2
      Posts
      467
      Views

      frederik

      The gray template glyph cells are being build up for new UFOs from the character set in the preferences and for existing UFOs the font lib key public.glyphOrder if the lib key is existing. You can alter the data in the lib easily with interaction with the UI by: font = CurrentFont() glyphOrder = font.glyphOrder glyphOrder.remove("a") # test before removing a name if its in the list font.glyphOrder = glyphOrder # done This is sort of what happens when you alt-delete a glyph in the font overview. good luck
    • joanca

      Bug in glyph.isEmpty() ?
      Problems & Bugs • scripting • • joanca  

      2
      0
      Votes
      2
      Posts
      290
      Views

      frederik

      It will return False also if there is a key in the glyph.lib. Main reason is that the glyph.lib contains user set data and when a user has added some data in the lib, like a mark color, but also layers, the glyph has some data so its not empty...
    • franz

      Build single one-time operation tool/button in glyph window, like RemoveOverlap
      General Questions • scripting editing tools remove overlap • • franz  

      8
      0
      Votes
      8
      Posts
      1107
      Views

      franz

      For now, I haven't found a way to directly insert my toolbarItem into the toolbar as I couldn't get insertItemWithItemIdentifier:()atIndex:() to work in the context of my script/extension, but probably I'm just being daft here. So currently I read all the items in the glyph window toolbar, add my item, and use vanilla's addToolbar method to replace the toolbar. That's looking good so far, all the previously present items are there, glyph tools work, and my item shows up (not as a button yet, that's lined up next). RemoveOverlap in the replaced toolbar crashes right now when clicked (I guess I'm somehow breaking the delegate or something), but I hope to get that sorted, too.
    • joanca

      Can't install robofont shell command
      General Questions • scripting shell command • • joanca  

      4
      0
      Votes
      4
      Posts
      499
      Views

      frederik

      well spaces in a folder are never a good idea :)
    • tom

      Bug in autoContourOrder
      Problems & Bugs • scripting • • tom  

      2
      0
      Votes
      2
      Posts
      312
      Views

      frederik

      This was idd a bug in version 1.2 where it seems to be possible that a contour has zero points, this is solved in the upcoming RoboFont 1.3. thanks
    • jo

      Copy font info
      General Questions • scripting font info • • jo  

      6
      0
      Votes
      6
      Posts
      696
      Views

      jo

      hi frederik I cannot say for sure. I think I changed something in the Name Setting. Either the General Identification fields or the Postscript Identification. I did not change the values with a script this time but "manually". Sorry I cannot provide any better information. jo
    • thom

      G.mark by colorName
      Feature Requests • scripting preferences colors • • thom  

      3
      0
      Votes
      3
      Posts
      558
      Views

      thom

      Yup, I already had a solution: f = CurrentFont() g = CurrentGlyph() red = (1,0,0,1) cyan = (0,1,1,1) for g in f: if g.mark == cyan: g.mark = red g.update() :)
    • thom

      Features update
      General Questions • scripting opentype features • • thom  

      3
      0
      Votes
      3
      Posts
      541
      Views

      thom

      Yes, this is easier and does exactly what I want! Thanks Frederik!
    • joanca

      Not updating imported module
      Problems & Bugs • scripting • • joanca  

      2
      0
      Votes
      2
      Posts
      266
      Views

      frederik

      python creates .pyc files on the fly during runtime only if the compiled version is not existing. You can force to reload a module by: import myModule reload(myModule) good luck
    • niels

      RSegment.smooth property always returns None
      Problems & Bugs • scripting • • niels  

      2
      0
      Votes
      2
      Posts
      313
      Views

      frederik

      thanks, great catch will be fixed in the next version
    • mathieu-christe

      Bitmap image background: reimporting from FLS to RoboFont?
      General Questions • scripting images vfb • • mathieu-christe  

      3
      0
      Votes
      3
      Posts
      639
      Views

      mathieu-christe

      Yo, Thank you for the hint. Although I did some visual overall scaling and shifting in FLS, using a script, once I've found the right settings in RoboFont, I'll manage to reimport all my images. Best
    • joanca

      Scripts Menu name control
      Feature Requests • scripting user interface mojo • • joanca  

      2
      0
      Votes
      2
      Posts
      448
      Views

      frederik

      naming inside a file isn't a good idea: all files have be parsed before a menu can be build will add some functionality to mojo.UI in the next version from mojo.UI import getScriptingMenuNamingShortKey, setScriptingMenuNamingShortKey data = getScriptingMenuNamingShortKey() data['/path/to/my/python/script.py'] = dict(preferredName="my script name", shortKey="d") setScriptingMenuNamingShortKey(data)
    • jack_jennings

      Scripting Window Default Size and Placement
      Feature Requests • scripting user interface • • jack_jennings  

      3
      0
      Votes
      3
      Posts
      380
      Views

      jack_jennings

      Thanks. :)
    • yanone

      Custom rotation tool
      General Questions • scripting editing tools • • yanone  

      2
      0
      Votes
      2
      Posts
      499
      Views

      frederik

      can you elaborate what you want to achieve with the special rotation behavior? you can build a custom tool and draw the selected points yourself: s = 5 ## / scale # in a tool you can get the scale value for x, y in CurrentGlyph().selection: oval(x-s, y-s, s*2, s*2)
    • joanca

      Remove points from a script
      General Questions • scripting points • • joanca  

      1
      0
      Votes
      1
      Posts
      387
      Views

      joanca

      Which is the way to remove points from a script? segment.removePoint(ptindex) is not working (File "lib/fontObjects/robofabWrapper.pyc", line 1413, in removePoint NotImplementedError) Thanks for your help, --jca
    • joanca

      Robofab.pens.filterPen
      Problems & Bugs • scripting • • joanca  

      2
      0
      Votes
      2
      Posts
      238
      Views

      frederik

      that is a bug, and already solved in the beta, will be in the next release a workaround: from robofab.pens.filterPen import ThresholdPen tempGlyph = RGlyph() glyph = CurrentGlyph() pen = ThresholdPen(tempGlyph.getPen(), threshold=10) glyph.draw(pen) glyph.clear() glyph.appendGlyph(tempGlyph) print "done" good luck
    • joanca

      SOLVED Last Script
      Feature Requests • scripting user interface • • joanca  

      4
      0
      Votes
      4
      Posts
      510
      Views

      frederik

      cool, post from 2012!! 👋🏼 If you have a script open both in RF and an external editor, edit it externally, jump back to RF, the script auto updates as long as no changes were made in RF. There is also a really cool helper for Sublime Text, by @bahman
    • joanca

      Scripting, strings and diacritics
      Problems & Bugs • scripting unicode • • joanca  

      5
      0
      Votes
      5
      Posts
      687
      Views

      joanca

      dank u Frederik
    • traviskochel

      Margins from Beam
      General Questions • scripting metrics • • traviskochel  

      3
      0
      Votes
      3
      Posts
      562
      Views

      traviskochel

      Great, that will be very helpful! Thanks!