Re: [PDCurses] Custom font with PDCurses 3.6 / SDL2

2018-03-24 Thread William McBrine
On Sat, Mar 24, 2018 at 3:09 PM, Karl Garrison  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.


Re: [PDCurses] Custom font with PDCurses 3.6 / SDL2

2018-03-24 Thread Karl Garrison
As it turns out, the problem was on my end. My image editor was saving in
png mode, so presumably pdcurses SDL was ignoring the file since it
couldn't load it.

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. A number of image editors don't
have an option to save in this mode, and my results using a higher bit
depth BMP were odd (colors didn't work).

I suggest adding a note to the documentation about the BMP depth
requirement, and also suggest having the library give a message if it finds
a font file, but can't open it, or if it is the wrong bit depth.

Thanks for your help!


Karl


On Wed, Mar 21, 2018, 4:58 PM LM  wrote:

> On Wed, Mar 21, 2018 at 4:02 PM, Karl Garrison 
> wrote:
> > The SDL2 port also seems to add an  immense speed boost, so I'm happy
> about
> > that.  I only "upgraded", though, to stay current.
>
> That's good to hear.
>
> >
> > I double-checked, and I didn't compile with WIDE defined, so that's not
> my
> > issue.  Maybe I'll try building under a Linux VM to see if my results are
> > different.  For my purposes right now, developing under there would be
> good
> > enough, if I can't get it to work on my Macbook.
>
> I didn't really test a lot without the WIDE since I was trying to add
> the truetype font support.  If you try with wide support (using
> DejaVuSansMono.ttf in the directory expected by PDC_FONT_PATH), let me
> know.  I'd be curious to find out why font display might not be
> working on the Mac.
>
> I'm still using my patched version of PDCURSES.  Haven't had time to
> update to the latest official version, so I don't know how much the
> two differ.
>
> Sincerely,
> Laura
>