Jump to content

Font rendered in incorrectly


PlumpOrange

Recommended Posts

I've been working on some modifications for the game and wanted to have it load in my own provided font by default. I did this by just providing my own ascii.png in the font folder under textures. However, when I do this with any font I convert and load in, it comes up all "scrapped" up, Its like it loads it, but with a lot of artifacts, which are non-existent in the png. I have tested this a lot and haven't found the cause. Tried putting the font in a resource pack still with no prevail. 

 

ascii png:

Spoiler

image.png.dfc91d39078ec3de13e052a249ddbfdf.png

 

 

When Loaded:

Spoiler

image.png.2533c73621de14b8502fc429719ee243.png

Any ideas?

 

Edited by PlumpOrange

Just an orange that codes

Link to comment
Share on other sites

I think what's happening here is your font is of a pretty high resolution and minecraft's textures by default have a linear interpolation on the minimization filter so when shrunk parts of the texture become transcluent. By default it looks like FontRenderer doesn't enable blend when rendering so alpha test takes care of the alpha values and the default value of the function set in place simply discards any texels with too low of an alpha value.

What you can do is provide a custom implementation of FontRenderer that changes the alpha test function to a desireable one and enables blend before drawing.

Link to comment
Share on other sites

20 hours ago, V0idWa1k3r said:

I think what's happening here is your font is of a pretty high resolution and minecraft's textures by default have a linear interpolation on the minimization filter so when shrunk parts of the texture become transcluent. By default it looks like FontRenderer doesn't enable blend when rendering so alpha test takes care of the alpha values and the default value of the function set in place simply discards any texels with too low of an alpha value.

What you can do is provide a custom implementation of FontRenderer that changes the alpha test function to a desireable one and enables blend before drawing.

I managed to figure out that it was in fact the render cutting it off, I will be trying your recommendation in a while to see of it fixes the issue.

Just an orange that codes

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.