robofab.tools.nameTable
index
/code/projects/robofab/Lib/robofab/tools/nameTable.py

 
Classes
       
__builtin__.object
NameTable

 
class NameTable(__builtin__.object)
    An object that allows direct manipulation of the name table of a given font.
 
For example:
 
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 2004 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()
 
  Methods defined here:
__init__(self, font)
addRecord(self, pid, eid, lid, nidDict=None)
add a record. the optional nidDict is
a dictionary of NIDs and values. If no
nidDict is given, the method will make
an empty entry for ALL public NIDs.
removeEID(self, pid, eid)
remove an EID from a PID entry
removeLID(self, pid, eid, lid)
remove a LID from a PID entry
removeNID(self, nid)
remove a NID from ALL PID, EID and LID entries
removePID(self, pid)
remove a PID entry
setSpecificRecord(self, pid, eid, lid, nid, value)
set a specific record based on the PID, EID, LID and NID
this method does not do platform lineending conversion

Properties defined here:
compatibleFull
NID 18
get = _get_compatibleFull(self)
set = _set_compatibleFull(self, value)
copyright
NID 0
get = _get_copyright(self)
set = _set_copyright(self, value)
description
NID 10
get = _get_description(self)
set = _set_description(self, value)
designer
NID 9
get = _get_designer(self)
set = _set_designer(self, value)
designerURL
NID 12
get = _get_designerURL(self)
set = _set_designerURL(self, value)
familyName
NID 1
get = _get_familyName(self)
set = _set_familyName(self, value)
fullName
NID 4
get = _get_fullName(self)
set = _set_fullName(self, value)
license
NID 13
get = _get_license(self)
set = _set_license(self, value)
licenseURL
NID 14
get = _get_licenseURL(self)
set = _set_licenseURL(self, value)
manufacturer
NID 8
get = _get_manufacturer(self)
set = _set_manufacturer(self, value)
postscriptCID
NID 20
get = _get_postscriptCID(self)
set = _set_postscriptCID(self, value)
postscriptName
NID 6
get = _get_postscriptName(self)
set = _set_postscriptName(self, value)
preferredFamily
NID 16
get = _get_preferredFamily(self)
set = _set_preferredFamily(self, value)
preferredSubfamily
NID 17
get = _get_preferredSubfamily(self)
set = _set_preferredSubfamily(self, value)
sampleText
NID 19
get = _get_sampleText(self)
set = _set_sampleText(self, value)
subfamilyName
NID 2
get = _get_subfamilyName(self)
set = _set_subfamilyName(self, value)
trademark
NID 7
get = _get_trademark(self)
set = _set_trademark(self, value)
uniqueID
NID 3
get = _get_uniqueID(self)
set = _set_uniqueID(self, value)
vendorURL
NID 11
get = _get_vendorURL(self)
set = _set_vendorURL(self, value)
versionString
NID 5
get = _get_versionString(self)
set = _set_versionString(self, value)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x1564a50>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'NameTable' objects>
list of weak references to the object (if defined)

 
Functions
       
convertLineEndings(text, convertToMS=False)
convert the line endings in a given text string

 
Data
        MAC = 'macintosh'
MAC_INT = 1
MS = 'microsoft'
MS_INT = 3
UNI = 'unicode'
UNI_INT = 0
__warningregistry__ = {('FontLab contains a bug that renders nameTable.py inoperable', <class exceptions.Warning at 0x37030>, 2): 1}
macEIDInt2Name = {0: 'roman', 1: 'japanese', 3: 'korean', 4: 'arabic', 5: 'hebrew', 6: 'greek', 7: 'russian', 8: 'rsymbol', 9: 'devanagari', 10: 'gurmukhi', ...}
macEIDName2Int = {'arabic': 4, 'armenian': 24, 'bengali': 13, 'burmese': 19, 'chinese': 25, 'devanagari': 9, 'geez': 28, 'georgian': 23, 'greek': 6, 'gujarati': 11, ...}
macLIDInt2Name = {0: 'english', 1: 'french', 2: 'german', 3: 'italian', 4: 'dutch', 5: 'swedish', 6: 'spanish', 7: 'danish', 8: 'portuguese', 9: 'norwegian', ...}
macLIDName2Int = {'afrikaans': 141, 'albanian': 36, 'amharic': 85, 'arabic': 12, 'armenian': 51, 'assamese': 68, 'aymara': 134, 'azerbaijani_arabic': 50, 'azerbaijani_cyrillic': 49, 'azerbaijani_roman': 150, ...}
msEIDInt2Name = {0: 'symbol', 1: 'unicode_bmp_only', 2: 'shift_jis', 3: 'prc', 4: 'big5', 5: 'wansung', 6: 'johab', 7: 'unicode_full_repertoire'}
msEIDName2Int = {'big5': 4, 'johab': 6, 'prc': 3, 'shift_jis': 2, 'symbol': 0, 'unicode_bmp_only': 1, 'unicode_full_repertoire': 7, 'wansung': 5}
msLIDInt2Name = {}
msLIDName2Int = {}
nidInt2Name = {0: 'copyright', 1: 'familyName', 2: 'subfamilyName', 3: 'uniqueID', 4: 'fullName', 5: 'versionString', 6: 'postscriptName', 7: 'trademark', 8: 'manufacturer', 9: 'designer', ...}
nidName2Int = {'compatibleFull': 18, 'copyright': 0, 'description': 10, 'designer': 9, 'designerURL': 12, 'familyName': 1, 'fullName': 4, 'license': 13, 'licenseURL': 14, 'manufacturer': 8, ...}
pidName2Int = {'macintosh': 1, 'microsoft': 3, 'unicode': 0}
uniEIDInt2Name = {0: 'unicode_1.0', 1: 'unicode_1.1', 2: 'iso_10646:1993', 3: 'unicode_2.0_bmp', 4: 'unicode_2.0_full'}
uniEIDName2Int = {'iso_10646:1993': 2, 'unicode_1.0': 0, 'unicode_1.1': 1, 'unicode_2.0_bmp': 3, 'unicode_2.0_full': 4}
uniLIDInt2Name = {}
uniLIDName2Int = {}