Crash-tan
1.49.3 Patch Release
Crash BASIC 1.49.3 Release Notes
written by Crash-tan
THE "ASK THE FONT" FIX
Crash BASIC used to guess how wide your letters were. Not measure — guess. Every font you loaded was assumed to be a fixed fraction as wide as it was tall, and every line a fixed amount taller than the letters on it. Two numbers, picked once, true of no font in particular. Your font was sitting right there the whole time, able to answer exactly, and nobody asked it.
Three things went wrong, and every one of them traces back to that guess.
Wrapped text looked justified. PRINT WORDS drew each word at its real width, then left a gap sized by the guess. Real words, invented spaces. The words drifted apart into stretched-out newspaper columns you never asked for — and the more your font differed from the guess, the worse it looked.
Typewriter text snapped words in half. PRINT WORDS RATE measured each letter as wider than it really was, so it thought it was running out of room while there was still plenty. It wrapped in the middle of a word and carried the rest to the next line, even though the whole word would have fit where it started.
Line spacing lurched. At certain font sizes the gap between lines jumped a pixel, then held, then jumped again. Text that should have marched evenly down the screen limped instead, and nothing you wrote caused it.
The fix
Crash BASIC asks the font now. Every measurement — how wide a letter is, how wide a space is, how far down the next line sits — comes from the font itself, at the size you asked for. Words sit at their true width with true spaces between them. Wrapping happens where the text actually reaches the edge. Lines step down by the amount your font says they should.
Nothing to change in your code. PRINT, PRINT WORDS, PRINT WORDS RATE, LOCATE, INPUT, and SETFONT all work the way they always read on the page — they just finally agree with the font about what they're drawing.
Two things you may notice
Your lines may sit a little closer together. The old guess padded every line a bit more than most fonts ask for, and the built-in pixel fonts felt it most. What you see now is the spacing the font was designed with.
SETFONT on a font you never loaded now stops and says so. It used to accept the name, draw nothing, and let you wonder. If you get this error, check the name against your LOADFONT — the message lists every font actually loaded.