Right now .ch8 font files have to have exactly 768 bytes (a full Sinclair ZX Spectrum character set) or 2048 bytes (a full 256 characters which doesn't really work on the Spectrum at all except in CP/M+3).
Some Spectrum fonts are upper-case only (512 bytes) and some support additional characters.
Ideally RECOIL would support any .CH8 file over 512 bytes that is a multiple of 8 bytes with the height being file size / 32.
Not sure how to do PR's but it's a simple change with the DecodeCh8! function becoming:
bool DecodeCh8!(byte[] content, int contentLength)
{
if (contentLength % 8 != 0)
return false;
int charCount = contentLength / 8;
int rows = (charCount + 31) / 32; // Round up to nearest 32
int height = rows * 8;
SetSize(256, height, RECOILResolution.Spectrum1x1);
DecodeBlackAndWhiteFont(content, 0, contentLength, 8);
return true;
}
Sorry please ignore the line "Ideally RECOIL would support any .CH8 file over 512 bytes that is a multiple of 8 bytes with the height being file size / 32." - was previous thought and SF doesn't seem to let me edit ticket now.
Merged, thanks! Also added a check for empty and large files.
As for PRs, I don't think SF supports it directly, but you can:
a. Fork the repo, make the change and submit a ticket with a link to it.
There's a "Fork" button on https://sourceforge.net/p/recoil/code/ci/master/tree/
which makes a fork into your SF profile.
b. Attach the patch (git show >my.patch) to the ticket.