Jump to content

Recommended Posts

Posted

Hi,

Because Minecraft doesn't support all possible Unicode characters, I was wondering if there was a way to add glyphs for the ones it's missing? My first thought was that this would be as simple as adding localized names for blocks/items/entities/etc but looking at FontRenderer, that doesn't seem to be the case.

Posted

The vanilla FontRenderer supports 256 pages of 256 characters, which is the entirety of the Basic Multilingual Plane (BMP) and the full value range of a char.

 

To support the full range of Unicode code points, you'll need to iterate through the code points of a String (represented as ints or pairs of chars) rather than the code units (represented as chars). In Java 8, CharSequence#codePoints returns an IntStream of a CharSequence's code points.

 

You'll need to create your own page textures and glyph width file for code points outside of the BMP and arrays to store the page locations and glyph widths. You'll then need to override FontRenderer#renderUnicodeChar to do the same thing as the super method but use your page textures/glyph widths. You can then replace Minecraft#fontRenderer with an instance of your class.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.