Beispiel #1
0
            self._root = font
        self._root *= 10
        self._root += prec
        # conversion to mpl not implemented
        self._mpl = None


if __name__ == '__main__':
    # Example from http://root.cern.ch/root/html/TAttText.html#T5
    from rootpy.plotting import Canvas
    from rootpy.interactive import wait
    from ROOT import TLatex

    c = Canvas(500, 700, name="ROOT Fonts", title="ROOT Fonts")
    c.Range(0, 0, 1, 1)
    c.SetBorderSize(2)
    c.SetFrameFillColor(0)

    def get_text(x, y, f, s):
        t = TLatex(x, y, "#font[41]{%d :} %s" % (f(), s))
        t.SetTextFont(f('root'))
        t.SetTextAlign(12)
        t.SetTextSize(0.048)
        return t

    y = 0.95
    prec = 2
    for font in sorted(fonts_root2text.keys()):
        f = Font(font, prec)
        if font != 14:
            t = get_text(0.02, y, f, "ABCDEFGH abcdefgh 0123456789 @#$")