Tagged: invalid groups
November 21, 2012 at 22:45 #5266
I’m very new to robofont so please forgive me if this question comes across silly.
I’m exporting some fonts from fontlab to UFO and I keep getting the following warning upon opening in robofont. (screen grab attached)
The ‘ tags I can only see from the output window, the groups and glyph names don’t seem to contain the ‘ tags, from what I can see. I can’t find where to remove the ‘ tags.
Have other people had this issue? How did they resolve it?
Attachments:You must be logged in to view attched files.November 22, 2012 at 01:29 #5268
An easy way I’ve found is to go to the Finder, right-click or control-click on the UFO and select “Show Package Contents”. You will see a file called “groups.plist”. Open that in a plain text editor (like BBEdit or TextMate) and then search for
'(the apostrophe) and replace with “” (nothing). Save the file and reopen the UFO in RoboFont. If the UFO was already open in RoboFont, it will put up a message about the UFO having been changed outside of RoboFont, which you can confirm.
(Edit: Those should be “dumb” quotes above, not smart quotes. The forum software seems to be “fixing” them automatically.)November 22, 2012 at 08:27 #5269
or easier, make a script that is removing all
font = CurrentFont() for groupName, items in font.groups.items(): newItems =  for glyphName in items: if "'" in glyphName: glyphName = glyphName.replace("'", "") newItems.append(glyphName) if newItems != items: ## something changed font.groups[groupName] = newItems
and connect this script with event observer on
fontDidOpenand it happens automatically.
(RoboFont will never do this atomically cause one of the main principles is that the users should always be aware of what is happening with his/her font data)November 23, 2012 at 14:50 #5274
Thank you both for your replies.
I tried both methods and they worked perfectly.
I couldn’t quite get the event observer to work properly as I’m pretty terrible at scripting.
—BNovember 23, 2012 at 17:13 #5275
that is easy to :)
from mojo.events import addObserver class RenameGroupsObserver(object): def __init__(self): addObserver(self, "checkGroupNames", "fontDidOpen") def checkGroupNames(self, info): print "checking group names for single quotes" font = info["font"] for groupName, items in font.groups.items(): newItems =  for glyphName in items: if "'" in glyphName: glyphName = glyphName.replace("'", "") newItems.append(glyphName) if newItems != items: ## something changed font.groups[groupName] = newItems print "done checking group names" RenameGroupsObserver()
save this script in a file and add it in the preferences as a start up script and you never ever have to worry about single quotes in groups.
Your font data will change and importing the UFO back in FL will change the groups behavior, off course
good luckAuthorPostsViewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.