Logo Search packages:      
Sourcecode: matplotlib version File versions

def matplotlib::font_manager::setWeights (   font  ) 

A function to populate missing values in a font weight
dictionary.  This proceedure is necessary since the font finding
algorithm always matches on the weight property.

Definition at line 535 of file font_manager.py.

00535                     :
    """
    A function to populate missing values in a font weight
    dictionary.  This proceedure is necessary since the font finding
    algorithm always matches on the weight property.
    """

    # !!!!  Not completely correct
    temp = font.copy()
    if len(temp) == 1:
        wgt = temp.keys()[0]
        for j in range(100, 1000, 100):
            font[j] = temp[wgt]

    if temp.has_key(400):
        for j in range(100, 1000, 100):
            font[j] = temp[400]
    if temp.has_key(500):
        if temp.has_key(400):
            for j in range(500, 1000, 100):
                font[j] = temp[500]
        else:
            for j in range(100, 1000, 100):
                font[j] = temp[500]

    if temp.has_key(300):
        for j in [100, 200, 300]:
            font[j] = temp[300]
    if temp.has_key(200):
        if temp.has_key(300):
            for j in [100, 200]:
                font[j] = temp[200]
        else:
            for j in [100, 200, 300]:
                font[j] = temp[200]

    if temp.has_key(800):
        for j in [600, 700, 800, 900]:
            font[j] = temp[800]
    if temp.has_key(700):
        if temp.has_key(800):
            for j in [600, 700]:
                font[j] = temp[700]
        else:
            for j in [600, 700, 800, 900]:
                font[j] = temp[700]

class FontProperties(object):


Generated by  Doxygen 1.6.0   Back to index