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

[drape] Removed fixed text size in favor of always using SDF fonts #7959

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

biodranik
Copy link
Member

Fixed size was a case only for some older mdpi devices (likely to look a bit better). SDF fonts allow dynamic resizing to any desired size without loss of quality. And each glyph should be rendered only once on the texture.

Preparation for #4281

Fixed size was a case only for some older mdpi devices (likely to look a bit better).
SDF fonts allow dynamic resizing to any desired size without loss of quality.
And each glyph should be rendered only once on the texture.

Signed-off-by: Alexander Borsuk <me@alex.bio>
@biodranik biodranik added the Drape Drape OpenGL, Vulkan and Metal graphics rendering engine label Apr 19, 2024
@biodranik biodranik requested a review from vng April 19, 2024 22:41
@pastk
Copy link
Contributor

pastk commented Apr 20, 2024

Looks good on my mdpi screen, better than before!

Now there are much less boggled fonts cases like this:
image

Now this is the worst case I was able to spot
image

Also the labels seem to be somewhat more contrast now and the min font size is smaller now.

@biodranik
Copy link
Member Author

@pastk your screen is mdpi, right? Are there any before/after screenshots?

@pastk
Copy link
Contributor

pastk commented Apr 20, 2024

Yeap its mdpi, this PR produces smaller, more condensed and less blurry fonts:

fonts

@biodranik
Copy link
Member Author

Can you please test if visual quality of fonts changes when you edit this parameter:

    uint32_t m_sdfScale = 4;

to 1, 2, 8, 16, 32?

And also check how uint32_t m_baseGlyphHeight = 22; influences the quality too? Maybe try 18, 24, 28, 32?

@biodranik
Copy link
Member Author

@pastk sorry, the correct place to modify these constants is here:

uint32_t VisualParams::GetGlyphSdfScale() const
{
  ASSERT_INITED;
  return (m_visualScale <= 1.0) ? 3 : 4;
}

uint32_t VisualParams::GetGlyphBaseSize() const
{
  ASSERT_INITED;
  return 22;
}

@pastk
Copy link
Contributor

pastk commented Apr 20, 2024

GlyphSdfScale is best with 3 (the default) or 4 (I like it a bit more). The difference is very subtle anyway.
(2 is too blurry, 8 is too coarse like there is no AA at all).

GlyphBaseSize is the best with default 22. I won't change it.

Copy link
Member

@vng vng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile doesn't use mdpi for a long time already ..

@biodranik biodranik merged commit 6e8e596 into master Apr 24, 2024
15 of 17 checks passed
@biodranik biodranik deleted the ab-drape-remove-fixed-size-font branch April 24, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drape Drape OpenGL, Vulkan and Metal graphics rendering engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants