Monocraft icon indicating copy to clipboard operation
Monocraft copied to clipboard

Convert font to Minecraft's .png font format to be used as a font ingame

Open InQuognito opened this issue 1 year ago • 9 comments

Convert the default font to these .png files in order to make them compatible with resource packs. Minecraft sucks at rendering .ttf and natively uses these files: image

It would be awesome if this pack was useable on here! Thanks.

InQuognito avatar Apr 12 '23 19:04 InQuognito

I don't think that's possible. For one, there is already Minecraft-Font for faithful Minecraft font. Second, there are ligatures, that Minecraft can't render. And finally, it's more of Minecraft-style font for general use rather than Minecraft-usable one.

Dheatly23 avatar Apr 13 '23 01:04 Dheatly23

for faithful Minecraft font

This is not what author of this issue is after, I am afraid, i'd love to use this font in-game as well, but as @InQuognito said, minecraft is not particularly strong at rendering pixelated ttfs/otfs and after fiddling with the "oversampling" value of the font for a prolonged period of time I was not able to produce results which would not have artifacts like these: Screenshot_20230428_055904

lenrik1589 avatar Apr 28 '23 03:04 lenrik1589

I wouldn't mind wasting my time on making this, tho I have no real idea how exactly the font system works in MC to make an entire font for this...

Andre601 avatar May 15 '23 09:05 Andre601

Quickly want to say that I started to work on a MC variant of this font using the PNG bitmap solution here (Not sure how long this is usable after 1.20 and their unicode font change stuff...)

It's actually relatively easy to implement. Most difficult aspect was/is to have the proper padding for characters like dots or semicolon, which I achieve using semi-transparent (7% opacity) pixels, as MC would otherwise cut any empty spaces...

Either way, here's a quick glance at the font right now (Ascii has been made with exception for these special unicode characters, as I can't think of a way to properly display them without issues... grafik

Here's a preview in a title that also has dots, commas, semicolons and colons (They are centered... Maybe changing that later on). 2023-05-15_18 02 15

Andre601 avatar May 15 '23 16:05 Andre601

I hope I'm not annoying people with these comments, but just in case did I create a repository for the above shown Font, so that people can get the necessary files for their resource pack.

It doesn't cover everything yet (i.e. no accented.png coverage yet), but ascii.png and nonlatin_european.png are mostly covered (With exception of unicode emojis not being monospaced yet).

Would appreciate any input and help on this, thanks.

https://github.com/Andre601/Monocraft-Bitmap

Andre601 avatar May 15 '23 20:05 Andre601

Well good luck on your journey i guess. Just a bit of pointer: maybe use scripting to automate generating the imagefile (and resourcepack). I think pillow should help with imagefile. And submodules too, to link it to this repository.

Dheatly23 avatar May 16 '23 01:05 Dheatly23

No idea what you mean with that tbh...

Andre601 avatar May 16 '23 08:05 Andre601

I have already made the script that generates both bitmap of the font, and the json file to go along too, but i am making this for a (for now a part of) private project

lenrik1589 avatar May 16 '23 08:05 lenrik1589

also, please, for the love of god (or whatever), use proper script structure with

if __name__ == "__main__":
  #execute main code here
  generateFont()
  generateExamples(characters, ligatures, charactersByCodepoint)

(hmm, i think i will post that custom version, i guess)

lenrik1589 avatar May 16 '23 08:05 lenrik1589