Next / Previous / Contents / Shipman's homepage

37. font()

This function uses Section 40, “deCamel(): Convert from camel-case to dashed attribute names” to convert camel-case attribute names to XSL-FO attribute names.

fosox.py
# - - -   f o n t

def font(**kw):
    '''Return a dictionary of font properties.
    '''
    #-- 1
    result = {}

    #-- 2
    # [ result  +:=  key-value pairs from kw but with each key
    #       replaced by de-camel(key) ]
    for key in kw:
        result[deCamel(key)] = kw[key]

    #-- 3
    return result