meteor-client icon indicating copy to clipboard operation
meteor-client copied to clipboard

[Bug] Font Rendering breaks with certain texture pack fonts

Open machiecodes opened this issue 3 years ago • 3 comments

Describe the bug

Using a resource pack that alters the font will screw with meteor's rendering when custom font is turned off. Below I'm using the font from the compliance 64x pack. EDIT: I tried this again with an empty mods folder besides latest dev build and it still happens. Seasnail will cope easily

https://medal.tv/games/minecraft/clips/6rXKJzt9paatM/d1337ayE2YXL?invite=cr-MSw1MFYsMzQwMjE5MDEs

Steps to reproduce

Create a resource pack that alters the Minecraft font and disable "Custom Font" in the config tab.

Meteor Version

1373

Minecraft Version

1.18.1

Operating System

Windows

Before submitting a bug report

  • [X] This bug wasn't already reported. (I have checked every bug report on github)

  • [X] This is a valid bug. (I am able to reproduce this on the latest dev build)

machiecodes avatar Dec 30 '21 22:12 machiecodes

The video above doesn't load for me, but I'm having what I think is the same issue. When I use the font from faithful/compliance 32x, have custom font disabled (so it uses the resource pack font) and have the text alignment centered, then the text rendering looks really bad because it isn't aligned/rounded to the nearest pixel before being drawn. I have the scaling set to 1.1494 since that results in an integer scaling amount once the internal vanilla font scaling of 1.74 is applied (1.74 * 1.1494 = ~2), but even with that the font rendering only looks ok with the text alignment set to left since that always results in the text being drawn at an x coordinate of ___.0 whereas center aligned text divides the width by 2 so can result in an x coord of ___.5 causing the font to look bad. I've tried a build where I modified the above line to x += Math.round(w / 2 - titleWidth / 2); and that fixed the rendering with centered text, but only with a scaling amount that results in an integer, any other scaling amount still has rendering issues.

LilyRose2798 avatar Jan 13 '22 12:01 LilyRose2798

Doesn't load for me either, what the comment above describes is something that is not a fault of Meteor. It is simply an issue caused by MC's default font being very low res and cant really be fixed by Meteor.

arlomcwalter avatar Jan 13 '22 18:01 arlomcwalter

As mentioned above, the issue isn't necessarily with just the vanilla font, it also occurs with other bitmap fonts like the ones in 32x/64x resource packs. There is a way to address this as I mentioned above which is to make sure that if custom font rendering is disabled that the font isn't drawn at sub-pixel coordinates, only at whole pixel coords. This can be mostly addressed with some simple rounding operations to the x/y values for the vanilla font renderer.

LilyRose2798 avatar Jan 14 '22 04:01 LilyRose2798