Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waveform: always use pixel size and 'Open Sans' for text markers #3954

Merged
merged 2 commits into from
Jun 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/waveform/renderers/waveformrendermark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,22 @@ void WaveformRenderMark::generateMarkImage(WaveformMarkPointer pMark) {
}
}

QFont font; // Uses the application default, if not set per skin
font.setPointSizeF(10 * devicePixelRatio);
font.setStretch(100);
font.setWeight(75);
// This alone would pick the OS default font, or that set by Qt5 Settings (qt5ct)
// respectively. This would mostly not be notable since contemporary OS and distros
// use a proven sans-serif anyway. Though, some user fonts may be lacking glyphs
// we use for the intro/outro markers for example.
QFont font;
// So, let's just use Open Sans which is used by all official skins to achieve
// a consistent skin design.
font.setFamily("Open Sans");
// Use a pixel size like everywhere else in Mixxx, which can be scaled well
// in general.
// Point sizes would work if only explicit Qt scaling QT_SCALE_FACTORS is used,
// though as soon as other OS-based font and app scaling mechanics join the
// party the resulting font size is hard to predict (affects all supported OS).
font.setPixelSize(13);
font.setWeight(75); // bold
font.setItalic(false);

QFontMetrics metrics(font);

Expand Down