switching between custom and default fonts (?"\015"
) behaves a bit strangely; the first line of text is spaced differently from the rest, depending on whether:
- custom fonts are enabled by default (
poke(0x5f58,0x81)
), and - the line height (
peek(0x5602)
) is more or less than 6 (the size of the default font)
run this cart to see what I mean:
specifically:
- when the custom font is enabled by default and the custom font's height is more than 6, the default-font text in this cart has a large gap between the first and second lines:
- when the custom font is not enabled by default and the custom font's height is less than 6, the custom-font text in this cart has a large gap between the first and second lines:
I didn't test how ?"\^y"
affects things.
my system info: 64-bit linux, pico8 0.2.5e
(oh, and while we're on the topic: it's also strange that setting the custom height will clip custom fonts but not the default font. I think I'd expect them to both be clipped? but I haven't thought it through and also will likely never use it -- it's a very minor thing)
Thanks @pancelor, fixed for 0.2.5f
Related: this was also happening when switching fonts at the start of the line before anything is printed -- I think in either case character height should not have any impact on line height until a character is actually printed. e.g. the first print shows 0.2.5f behaviour which I think is correct (no space under the last line even though switching back to system font after the newline).
The first print statement made in 0.2.5e would incorrectly give the same result as the /second/ print statement shown here -- I've inserted a space which causes the last line to be rendered 20px tall.
For both this example and the one you gave, character height specified with \^y
was also showing the same problem. e.g. ?"\^yftall\n\^y4short"
was not ending with a 4px height line.
For 0.2.5f, the only case where the line height is assumed to be the current character height is when reaching a newline before any printable characters are found. So, ?"\^yfa\n\nb"
should give 3 15px height lines.
On the scope of custom height: I take it to mean "height of the custom font" rather than a global custom height. There's isn't any way to set the width / height of the system font in the same way that the characters data can't be changed; hopefully that won't come up too much. But there's also \^y
and \^x
for that.
sweet! thanks for the fix, and I like the \n changes too
custom height: oh, yeah that makes complete sense! I agree; I hadn't thought it through fully
[Please log in to post a comment]