EDIT: I’m not sure if you’re talking about a component font (font in title bar you create in a window) or the window frame title bar text. This addresses the former, not the latter:
You’re trying to change font size in scripting? Something like this (shows some other sizing and positioning that may be needed along with changing font size, depending on application):
# Get handle for component.
label = event.source.getComponent('label')
# Scale font from base size of 12 and existing font characteristics.
font = label.font
scaledFont = font.deriveFont(12 * scaleFactor)
# Scale font container height from base of 16.
scaledHeight = 16 * scaleFactor
# Update component font.
label.font = scaledFont
# Update component height and Y position (you could also adjust width and X position, if needed)
system.gui.transform(label, newHeight = scaledHeight, newY = 4 * scaleFactor)