Changeset View
Changeset View
Standalone View
Standalone View
src/fontshelpers.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 34 | { | |||
---|---|---|---|---|---|
49 | QRegularExpression fontRx(QStringLiteral(" (.*) +([0-9]+)$")); | 49 | QRegularExpression fontRx(QStringLiteral(" (.*) +([0-9]+)$")); | ||
50 | QRegularExpressionMatch match = fontRx.match(font, familyIdx); | 50 | QRegularExpressionMatch match = fontRx.match(font, familyIdx); | ||
51 | if (match.isValid()) { | 51 | if (match.isValid()) { | ||
52 | QString fontStyle = match.captured(1).trimmed(); | 52 | QString fontStyle = match.captured(1).trimmed(); | ||
53 | int fontSize = match.captured(2).toInt(); | 53 | int fontSize = match.captured(2).toInt(); | ||
54 | f.setStyleName(fontStyle); | 54 | f.setStyleName(fontStyle); | ||
55 | f.setPointSize(fontSize); | 55 | f.setPointSize(fontSize); | ||
56 | } else { | 56 | } else { | ||
57 | qWarning() << "Couldn't figure out syle and size" << font; | 57 | qWarning() << "Couldn't figure out style and size" << font; | ||
58 | } | 58 | } | ||
59 | return f; | 59 | return f; | ||
60 | } | 60 | } |