Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

28 lines
689 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# robothon06
# edit the nametable
# this seems to work in FontLab 5
# it is broken in FontLab 4.6
from robofab.world import CurrentFont
from robofab.tools.nameTable import NameTable
f = CurrentFont()
nt = NameTable(f)
# bluntly set all copyright records to a string
nt.copyright = "Copyright 2006 RoboFab"
# get a record
print nt.copyright
# set a specific record to a string
nt.setSpecificRecord(pid=1, eid=0, lid=0, nid=0,
value="You Mac-Roman-English folks should know\\
that this is Copyright 2004 RoboFab.")
# get a record again to show what happens
# when the records for a NID are not the same
print nt.copyright
# look at the code to see what else is possible
f.update()