C++ (Qt) QFontDatabase database; QFont font; if (database.families().contains("Monospace")) font = QFont("Monospace", 12); else { foreach (QString family, database.families()) { if (database.isFixedPitch(family)) { font = QFont(family, 12); break; } } } setFont(font);