A Groups object. This object normally created as part of a
orphan Groups object can be created like this:
>>> groups = RGroups()
This object behaves like a Python dictionary. Most of the dictionary functionality
BaseDict, look at that object for the required environment
Groups uses :func:
normalizers.normalizeGroupKey to normalize the key of the
dict, and :func:
normalizers.normalizeGroupValue to normalize the the value
Add an observer object. that will receive notification for the given methodName.
Get a representation by name.
Optionally arguments could be provided if the representation factory requires arguments.
Removes all group information from Groups, resetting the Groups to an empty dictionary. :
list of the group or groups associated with glyphName.
glyphName will be an
string. If no group is found to contain
glyphName an empty
list will be returned. :
>>> font.groups.findGlyph("A") ["A_accented"]
Returns the contents of the named group.
groupName is a
string, and the returned values will either
list of group contents or
None if no group was found. :
>>> font.groups["myGroup"] ["A", "B", "C"]
It is important to understand that any changes to the returned group contents will not be reflected in the Groups object. If one wants to make a change to the group contents, one should do the following:
>>> group = font.groups["myGroup"] >>> group.remove("A") >>> font.groups["myGroup"] = group
Normalizes group key.
- value must be a
- value must be least one character long.
- Returned value will be an unencoded
list of all the group names in Groups. This list will be
>>> font.groups.keys() ["myGroup4", "myGroup1", "myGroup5"]
Removes a group from the Groups. groupName will be
string that is the group name to
This is a backwards compatibility method.
Updates the Groups based on otherGroups. *otherGroups** is a
groups information. If a group from otherGroups is in Groups, the group
members will be replaced by the group members from otherGroups. If a group
from otherGroups is not in the Groups, it is added to the groups. If Groups
contain a group name that is not in *otherGroups**, it is not changed.
Normalizes group value.
- value must be a
- value items must normalize as glyph names with
- Returned value will be a
list of each named group’s members. This will be a list of lists,
the group members will be a
string. The intial list will
>>> font.groups.items() [["A", "B", "C"], ["D", "E", "F"]]
Tell the environment that something has changed in the object. The behavior of this method will vary from environment to environment.