// Let the layout widget work in the same property subtree.
LayoutWidget wid(props);
- puFont *fnt = _gui->getDefaultFont();
- wid.setDefaultFont(fnt, int(fnt->getPointSize()));
+ SGPropertyNode *fontnode = props->getNode("font");
+ if (fontnode) {
+ FGFontCache *fc = _gui->get_fontcache();
+ _font = fc->get(fontnode);
+ } else {
+ _font = _gui->getDefaultFont();
+ }
+ wid.setDefaultFont(_font, int(_font->getPointSize()));
int pw=0, ph=0;
int px, py, savex, savey;
FGFontCache *fc = _gui->get_fontcache();
puFont *lfnt = fc->get(nft);
object->setLabelFont(*lfnt);
+ } else {
+ object->setLabelFont(*_font);
}
if (props->hasValue("property")) {
// The GUI subsystem.
NewGUI * _gui;
+ // The dialog font. Defaults to the global gui font, but can get
+ // overridden by a top level font definition.
+ puFont * _font;
+
// PUI provides no way for userdata to be deleted automatically
// with a GUI object, so we have to keep track of all the special
// data we allocated and then free it manually when the dialog