SOLVED Setting the FontData for a Text Object

Hello,
I am trying to set the Font for a Text Objectt.

I've been following the code from this forum topic: SetFont not working

This example uses MoText, however, and I would like to use the Text Object. I'm unable to access its FontData via PRIM_TEXT_FONT:

import c4d

def main(doc):
    textObject = c4d.BaseObject(c4d.Osplinetext)
    doc.InsertObject(textObject)
    print textObject[c4d.PRIM_TEXT_FONT]
    #prints None
    c4d.EventAdd()

if __name__=='__main__':
    main(doc)

If I change the Font manually and then print Text[c4d.PRIM_TEXT_FONT] from the Command Line it does print the Font Data, but I don't know how to change this Font in Python.

Can anyone explain how to get/set the FontData with a Text Object? Thank you!

For whatever reason, the default Text Object has no FontData in Text[c4d.PRIM_TEXT_FONT]. By creating a FontData instance, I was able to set the Font.

import c4d

def main(doc):
    textObject = c4d.BaseObject(c4d.Osplinetext)
    doc.InsertObject(textObject)

    fontData = c4d.FontData()
    
    bc = c4d.BaseContainer()
    bc.SetString(500, 'Arial')
    bc.SetString(501, '11')
    bc.SetInt32(502, 400)
    bc.SetInt32(503, 0)
    bc.SetString(509, 'Arial')
    bc.SetString(508, 'ArialMT')
    fontData.SetFont(bc)
    
    textObject[c4d.PRIM_TEXT_FONT] = fontData
    textObject[c4d.ID_BASELIST_NAME] = bc[500]
    textObject[c4d.PRIM_TEXT_TEXT] = bc[500]
    c4d.EventAdd()

if __name__=='__main__':
    main(doc)

For whatever reason, the default Text Object has no FontData in Text[c4d.PRIM_TEXT_FONT]. By creating a FontData instance, I was able to set the Font.

import c4d

def main(doc):
    textObject = c4d.BaseObject(c4d.Osplinetext)
    doc.InsertObject(textObject)

    fontData = c4d.FontData()
    
    bc = c4d.BaseContainer()
    bc.SetString(500, 'Arial')
    bc.SetString(501, '11')
    bc.SetInt32(502, 400)
    bc.SetInt32(503, 0)
    bc.SetString(509, 'Arial')
    bc.SetString(508, 'ArialMT')
    fontData.SetFont(bc)
    
    textObject[c4d.PRIM_TEXT_FONT] = fontData
    textObject[c4d.ID_BASELIST_NAME] = bc[500]
    textObject[c4d.PRIM_TEXT_TEXT] = bc[500]
    c4d.EventAdd()

if __name__=='__main__':
    main(doc)