gigaherz / Guidebook

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

Adds scale attribute to text paragraphs #21

Closed joazlazer closed 7 years ago

joazlazer commented 7 years ago
joazlazer commented 7 years ago

The scale tag has a limitation when align="center" or "right" where if the text spans more than one line, it will not receive the proper alignment and will instead simply be "left" aligned. However, this appears to be a more general limitation with the text rendering and alignment structure and not with the new feature.

gigaherz commented 7 years ago

I'm going to start merging these PRs, just be warned that my IntelliJ is configured to reformat using "proper" brackets, so sooner or later there will be a cleanup commit including a project-wide reformat like I do every now and then. (Yeah I'm not a fan of Egyptian brackets. ;P )

The only concern I have about this is that I tried very hard to keep the font sizes as multiples of screen pixels, like the GUI scaling does, to avoid having distorted fonts, and these free-scaled titles are going to look somewhat "warped" due to texcoord rounding, unless you use very high res fonts. But eh, can't do miracles.