@classmethod
def convertDistance(kls, painter, dist):
    """Convert a distance to plotter units.

        dist: eg 0.1 (fraction), 10% (percentage), 1/10 (fraction),
                 10pt, 1cm, 20mm, 1inch, 1in, 1" (size)
        painter: painter to get metrics to convert physical sizes
        """
    m = kls.distre.match(dist)
    if m is not None:
        func = kls.unit_func[m.group(2)]
        return func(m, painter)
    raise ValueError("Cannot convert distance in form '%s'" % dist)
