Previous Next blank.gif Home Page

Class Font - Lets you change the attributes of text.


SYNOPSIS

import HTMLgen
class Font(Text)
  def __repr__(self)

  # Methods inherited by Font from Text
  def __init__(self, text='', **kw)
  def append(self, text='')

DESCRIPTION

Argument is a text string or object with a string representation. Keyword arguments control the rendered apperance of this text.

size
Browsers typically represent font size as an index from 1 to 7. Normal body text is declared a 3 on this scale (not in point size). Relative font changes can be declared by using a '+/-N' notation where N is the number of size steps relative to the surrounding text.
color
Set the color of the text using the hex triple notation.
face
A string listing (comma separated) the preferred font family names. e.g., face="Times,Times New Roman" or face="Helvetica,Arial,Geneva". This allows more direct usage of font capabilities on browsing machines.

Arguments must be strings. e.g. Font( Blazing ,color='#cc0000',size='+2') will present the word Blazing in the color red and a font two sizes larger than the surrounding text.

def append(self, text='')

Concatenate text characters onto the end.

Will escape special characters.

SEE ALSO

HTMLgen

Text


Previous Next blank.gif Home Page
Buzz.gif

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedric@phoenix.net
Generated: Mon Dec 2 1996