Package pyscript :: Module afm :: Class AFM
[show private | hide private]
[frames | no frames]

Class AFM


Class for handling Adobe Font Metric objects
Method Summary
  __init__(self, fontname)
Initialisation of the AFM object
  __getattr__(self, attr)
Gets an attribute of the font
  __getitem__(self, key)
Gets an item within the font
  __repr__(self)
Returns the representation of the font object
  bbox(self, string, size, kerning)
Return a strings boundingbox in this font at the scale provided (relative to 1 point?)
  chars(self)
Returns the characters in the font
  comments(self)
Returns the comments in the font
  has_char(self, char)
Determins if the character exists in the font
  has_kernpair(self, pair)
Determines if the kerning pair exists in the font
  kernpairs(self)
Returns the kerning pairs in the font

Method Details

__init__(self, fontname)
(Constructor)

Initialisation of the AFM object
Parameters:
fontname - the name of the font
           (type=string)

__getattr__(self, attr)
(Qualification operator)

Gets an attribute of the font
Parameters:
attr - the attribute to get
           (type=?)

__getitem__(self, key)
(Indexing operator)

Gets an item within the font
Parameters:
key - the item to get
           (type=?)

__repr__(self)
(Representation operator)

Returns the representation of the font object

bbox(self, string, size=1, kerning=0)

Return a strings boundingbox in this font at the scale provided (relative to 1 point?)
Parameters:
string - the string to measure
           (type=string)
size - the point size of the font (sort of)
           (type=int)
kerning - whether to subtract off the kerning
           (type=boolean)
Returns:
xl, yb, xr, yt

chars(self)

Returns the characters in the font

comments(self)

Returns the comments in the font

has_char(self, char)

Determins if the character exists in the font
Parameters:
char - the character to look for
           (type=?)

has_kernpair(self, pair)

Determines if the kerning pair exists in the font
Parameters:
pair - the kering pair to look for
           (type=?)

kernpairs(self)

Returns the kerning pairs in the font

Generated by Epydoc 2.0 on Mon Apr 24 17:02:35 2006 http://epydoc.sf.net