Jump to content

[1.12] Texel "density" of the current font


OreCruncher

Recommended Posts

For performance reasons I have code that renders text elements using drawString() to a dynamic texture.  The texture is updated whenever resources are reloaded (i.e. a resource pack is added/removed).  Right now I have a hard coded 64x64 texels for each of the elements stitched into this texture.  The code works with the default Minecraft font as well as texture packs that have "64x" support.  My concern, though, is the amount of resources being used based on the default assumption of 64x64 texels.  What I would like to do is pick the texel size for each element based on whether a "16x", "32x", "64x" font is being used.  Is there a method somewhere or a calculation I can perform that would give me this answer?

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.