Hi Andrés,
Bug confirmed. Surprisingly, your test script works perfectly on Linux and Mac OS X. The problem only happens on Windows.
While I fix this bug, a workaround is using a style sheet instead of setting the Control.font property:
#include <pjsr/Sizer.jsh>
#include <pjsr/FontFamily.jsh>
function TextBoxDialog()
{
this.__base__ = Dialog;
this.__base__();
this.tbox = new TextBox( this );
// THIS LINE PRODUCES AN ACCESS VIOLATION ERROR
//this.tbox.font = new Font(FontFamily_Helvetica, 10);
// This is a workaround using Control.styleSheet
this.tbox.styleSheet = "* { font-family: Helvetica; font-size: 10pt; }";
this.sizer = new VerticalSizer;
this.sizer.margin = 8;
this.sizer.spacing = 6;
this.sizer.add( this.tbox );
this.windowTitle = "Test TextBox font";
this.adjustToContents();
this.setFixedSize();
}
TextBoxDialog.prototype = new Dialog;
var dialog = new TextBoxDialog();
dialog.execute();
Hope this helps. Sorry for the inconvenience.