Not that I'd see this as a major issue,  but perhaps something
along the lines of changing line 200 in pdcscrn.c from

    if( !pdcfont)

   to

    if( !pdcfont || pdcfont->format->BitsPerPixel != 1)

   might provide suitable warning?  Or possibly adding lines to check
that we've got one bit per pixel and that the bitmap is a multiple of
32 in width and of 8 in height would be useful :

    assert( pdcfont->format->BitsPerPixel == 1);
    assert( pdcfont->w % 32 == 0);
    assert( pdcfont->h % 8 == 0);

-- Bill

On 2018-03-24 16:17, William McBrine wrote:
On Sat, Mar 24, 2018 at 3:09 PM, Karl Garrison <kgarri...@pobox.com> wrote:

Also, I don't see this in the docs anywhere, but it took me a bit to realize
that the BMP needed to be 1 BPP. ... I suggest adding a note to the
documentation about the BMP depth requirement

Ahem...

"The font is a simple BMP, 32 characters wide by 8 characters tall,
preferably with a palette. (BMPs without palettes still work, but in
that case, no attributes will be available, nor will the cursor work.)
The first entry in the palette (usually black) is treated as the
background color; the last entry (usually white) is treated as the
foreground. These are changed or made transparent as appropriate; any
other colors in the palette are passed through unchanged. So -- although
a one-bit depth is sufficient for a normal font -- you could redraw some
characters as multi-colored tiles."

That's from doc/sdl.md (combined into PDCurses.md, if you build that).
It's been there since 2007.

Reply via email to