| 77 | } |
| 78 | |
| 79 | QFont fontFromString(const QString& s) |
| 80 | { |
| 81 | QFont font; |
| 82 | if (!s.isEmpty() && font.fromString(s)) { |
| 83 | return font; |
| 84 | } |
| 85 | |
| 86 | QStringList families({"Menlo", "Consolas", "Courier New"}); |
| 87 | |
| 88 | font.setPointSize(13); |
| 89 | font.setStyleHint(QFont::TypeWriter); |
| 90 | for (auto& family : families) { |
| 91 | font.setFamily(family); |
| 92 | if (font.exactMatch()) { |
| 93 | break; |
| 94 | } |
| 95 | } |
| 96 | return font; |
| 97 | } |
| 98 | |
| 99 | } |
no outgoing calls
no test coverage detected