mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.25k stars 1.24k forks source link

Improved readability and scaling of digits and avoid some artefacts #13311

Closed m0dB closed 3 weeks ago

m0dB commented 3 weeks ago

Based on user feedback, improved the readability of the digits and fixed the spacing and the scaling, used for the beats/time until mark counter.

BEFORE:

Screenshot 2024-06-02 at 02 41 52

AFTER:

Screenshot 2024-06-02 at 02 43 06
m0dB commented 3 weeks ago

That is strange. Before the font scaling kicks in, singleline instead of multiline should kick in first. That that doesn’t happen is the bug. It certainly does in macOS. What resolution is this? And hdpi?

m0dB commented 3 weeks ago

I can't reproduce this, @daschuer . Are you sure you are running this branch?

This auto-scaling is uses

float allshader::WaveformRenderMark::getMaxHeightForText() const {
    return m_waveformRenderer->getBreadth() / 3;
} 

and if with the selected font size the text would be higher than this max height, it scaled the font size down so it fits. It will only use multiline if the twice the text height still fits in this max height.

So, if you only show beats or time, you should still get the too small font size, on a single line. Is that the case?

What happens if you return a very large number in getMaxHeightForText()?

I am wondering if maybe I am making a mistake with the device pixel ratio. Can you tell me which device pixel ratio you have?

daschuer commented 3 weeks ago

My ratio is just one.

m0dB commented 3 weeks ago

And what happens in the same situation with only beat count?

m0dB commented 3 weeks ago

Never mind, I have been able to repro the issue and wil add a solution to this PR.

m0dB commented 3 weeks ago

The minimum font point size is now limited to 10 pt.

I also added a 0.5 pixel margin around the text to avoid artefacts that I didn't see on HDPI, but noticed at 1:1 pixel ratio.

For reference: it is possible to run at 1:1 pixel ratio on macOS by building the bundle (cmake -DMACOS_BUNDLE=ON) and editing the Info.plist in the bundle with:

    <key>NSHighResolutionCapable</key>
    <string>False</string>

Will you do the honours and preset the merge button, @daschuer ? :-)

daschuer commented 3 weeks ago

Oh sorry forgot to merge. Now the CI is failing.

m0dB commented 3 weeks ago

let's see now.

there is a minor issue: depending on the font size, the blurred black outline is sometimes slightly displaced from the white foreground. not a biggie though, but now that I have seen it, I can't unseen it!

daschuer commented 3 weeks ago

I can confirm the minimum font size fixes the issue https://github.com/mixxxdj/mixxx/issues/13314 Are you working on a fix for last minor issue on to of this or shall I press merge?

m0dB commented 3 weeks ago

Let’s wait until tomorrow. I will make a final attempt.

m0dB commented 3 weeks ago

What I tried didn't work, so I'd say merge. If I find a solution I will create a new PR.

daschuer commented 3 weeks ago

Ok, thanks.