gigaherz / Guidebook

Minecraft book API and library
https://www.curseforge.com/minecraft/mc-mods/guidebook
Other
31 stars 16 forks source link

suggestion: custom font support (smoothfont) #105

Open ghost opened 2 years ago

ghost commented 2 years ago

Would it be possible to add a section in the style field of text elements where one can specify a custom font, such as one provided by the smoothfont mod (.minecraft/fontfiles)? This would be very useful for making books thematically appropriate for the subject they're documenting, for example you might choose to use a serif kerned font for a book on magic and a sans-serif monospace font for a book detailing a tech mod. This would also be useful for separating types of text within one book, e.g. the main body has one font and quoted sections/"code" blocks have another.

gigaherz commented 2 years ago

Starting with whatever version vanilla added custom fonts (1.16? 1.17?), guidebook supports them. If these smoothfont fonts can be used in vanilla text components, they can be used in Guidebook.

ghost commented 2 years ago

As far as I can tell, minecraft's "custom fonts" only allow you to provide one font that overrides all text in the game. This would be entirely useless for the purpose I described.

gigaherz commented 2 years ago

Nope not anymore. You can specify a font json and use it selectively in text components. in guidebook, you can specify <span font="name:of_font">text</span> to get a different font from default.

ghost commented 2 years ago

seems like the version I'm using doesn't support that. oh well