object has no attrib 'setFont'?

So I am testing some stuff and imported a font and such.
Now I tried to apply a font and this message popped up:
AttributeError: "libpanda.DynamicTestFont’ object has no attribute ‘setFont’

this was my code that I used:

import direct.directbase.DirectStart
#TextNode Module
from pandac.PandaModules import TextNode

#Displaying Text
object = loader.loadModel("models/winlogo.egg")

#Loading Fonts
font1 = loader.loadFont('fonts/AK.TTF')
font2 = loader.loadFont("fonts/Avalq___.TTF")
font3 = loader.loadFont("fonts/BABYJEEP.TTF")
font4 = loader.loadFont("fonts/BALSAMO.TTF")
font5 = loader.loadFont("fonts/BEARPAW_.TTF")

#Font Quality (def 30px)
font1.setPixelsPerUnit(60)
font2.setPixelsPerUnit(60)
font3.setPixelsPerUnit(60)
font4.setPixelsPerUnit(60)
font5.setPixelsPerUnit(60)

#When crashes occur with higher font qualities (def 256x256)
font1.setPageSize(512, 512)
font2.setPageSize(512, 512)
font3.setPageSize(512, 512)
font4.setPageSize(512, 512)
font5.setPageSize(512, 512)

#Render Text
text1 = TextNode('text1')
text1.setText("Rendering text")
text1NodePath = aspect2d.attachNewNode(text1)
text1NodePath.setScale(0.07)

#Font
font1.setFont(font1)

#Small Caps
font1.setSmallCaps(True)
font1.setSmallCapsScale(0.4)

run()

“font1.setFont(font1)” doesn’t make any sense at all. You probably meant to type “text1.setFont(font1)” instead.

David

Oh man I hate it when I make stupid mistakes and fail to notice them.

Thx david!