Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
InQuognito opened this issue Apr 12, 2023 · 9 comments
Open
Labels
enhancement New feature or request

Comments

@InQuognito
Copy link

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 InQuognito added the enhancement New feature or request label Apr 12, 2023
@Dheatly23
Copy link
Contributor

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.

@lenrik1589
Copy link

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

@Andre601
Copy link

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
Copy link

Andre601 commented May 15, 2023

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
Copy link

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

@Dheatly23
Copy link
Contributor

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.

@Andre601
Copy link

No idea what you mean with that tbh...

@lenrik1589
Copy link

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
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants