Brikster / glyphs

Library for convenient management of bitmap textures from Minecraft resourcepacks.
Apache License 2.0
89 stars 4 forks source link

Add support for decorated font glyphs #11

Open ardunaline opened 6 months ago

ardunaline commented 6 months ago

Right now, you can use font.translate to get text of any size, position, and color. My idea is to also be able to get decorated text, such as bold/italic/etc. Protocol lib could even be used to achieve animated text.

Brikster commented 6 months ago

That's a good idea, but I have to solve the problem with characters' width calculation for decorated text. I take the width from the font texture for plain text, but for decorated text I need to use some unknown coefficient. I don't think that there's a trivial solution.

ardunaline commented 6 months ago

I'm pretty sure there is an alternative font entirely for bold minecraftia https://fonts2u.com/minecraft-bold.font

idk about italic tho, but surely underline is also possible!

On second research, this bold font doesn't exist in ascii.png It looks like what the game does is just duplicate the pixels by 1 pixel to the right image so it would be just 1 pixel longer