Hi Vincent, when replace a font for text in an object you must first capture the existing text in a temporary variable and then "empty" the text in the object, set your new font and then "paste" the text back in the object.
Here is an example of how to change the font:
'Define temp text container
Dim strTemp As String
'Define a text object
Dim TextObj As xpTextObject
'Define Font object
Dim FontObj As xpFont
' ************* FONT COLOUR CHANGE ****************************
'Get the text object you want to change colour
self.GetObjectByName("text", TextObj)
'Capture current text
strTemp = TextObj.Text
'Get New font defined
Engine.GetFontByName("fontrouge", FontObj)
'Clear text in text object
TextObj.Text = ""
'Set new font on text object
TextObj.CurrentFont = FontObj
'Re-enter text in textobject
TextObj.Text = strTemp
'end of code
Regards
Jim
#XPression