/goodnight progress bar does not match percentage
Issue #347
resolved
As title, as issue:
Comments (7)
-
-
I think there's a file somewhere that defines the width of characters. Perhaps we could use that for width calculations.
-
Is there? That could be useful
-
I lied; in the default minecraft font,
=
is 5 "pixels" wide,>
4 pixels, and[
,]
and spaces 3 -
- changed status to resolved
/goodnight: Use char width for bar, fixes
#347→ <<cset 8e2b137b0c7e>>
-
Could probably write a monospacer of sorts...
-
Minecraft just uses the actual width of the character, with a 3-pixel width for spaces. Between chars is 1 pixel of space. For the unicode font, there's a file that defines the character widths (
assets/font/glyph_sizes.bin
) - Log in to comment
It would if the display were monospace. Problem is spaces are much narrower than equals signs in that particular Minecraft font.
A workaround could be to multiply number of spaces by some hardcoded value but that might not be the same on fonts from other skins or theme mods.
Another workaround could be to replace spaces with a fixed width character of the same width, such as
_
- but the result may be uglier