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

Minor font rendering glitch #15664

Open
appgurueu opened this issue Jan 10, 2025 · 2 comments
Open

Minor font rendering glitch #15664

appgurueu opened this issue Jan 10, 2025 · 2 comments
Labels
Bug Issues that were confirmed to be a bug @ Client rendering

Comments

@appgurueu
Copy link
Contributor

Luanti version

Luanti 5.11.0-dev-debug-e5542e5b0 (Linux)
Using LuaJIT 2.1.1713773202
Built by GCC 14.2
Running on Linux/6.9.10 x86_64
BUILD_TYPE=Debug
RUN_IN_PLACE=1
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1

Operating system and version

Fedora 40

CPU model

AMD Ryzen 5 3500U

GPU model

integrated Radeon™ Vega Mobile Gfx × 8

Active renderer

4.6 / any / SDL

Summary

This is how Intel One Mono renders for me:

Screenshot from 2025-01-10 01-50-20

Note the glitch on the j:

Screenshot from 2025-01-10 01-50-13

Steps to reproduce

Set Intel One Mono as monospace font with a size of 20, view e.g. using hypertext.

Discovered while testing #15606 but confirmed independent; the mod recommended for testing there is useful to quickly reproduce this.

@appgurueu appgurueu added Bug Issues that were confirmed to be a bug @ Client rendering labels Jan 10, 2025
@SmallJoker
Copy link
Contributor

SmallJoker commented Jan 11, 2025

It also appears that the bottom pixels are cut off. I would expect at least some aliasing for the y and g letters. Red line for height reference, at a 1 px gap.
grafik

@appgurueu
Copy link
Contributor Author

Yeah, it also seems to be cut off. I wonder whether the following is to blame:

unsigned int FontEngine::getTextHeight(const FontSpec &spec)
{
	gui::IGUIFont *font = getFont(spec);

	return font->getDimension(L"Some unimportant example String").Height;
}

/** get line height for a specific font (including empty room between lines) */
unsigned int FontEngine::getLineHeight(const FontSpec &spec)
{
	gui::IGUIFont *font = getFont(spec);

	return font->getDimension(L"Some unimportant example String").Height
			+ font->getKerning(L'S').Y;
}

Using "some unimportant example string" seems very dubious here.

But what confuses me is that this can't fully explain the glitches. There's more going on here. It looks almost a bit as if some rectangle is intruding upon the glyphs and overwriting the pixels, but I don't see why that would be happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Client rendering
Projects
None yet
Development

No branches or pull requests

2 participants