You have a crash because you are passing the address of a local variable(TextBoxStyle
) which is destroyed when Construct
function exits.
Store it as a class member or create your own style management class.
BTW I don’t know if the whole process of creating the font is correct.