Hi. Love BMfont. And not just because it has my initials in it. But really, the packing, the options, the using any installed system font, it does just about everything. But today I found something it does not do, Soft outlines/shadows.
I was thinking that it could be done with just a simple blur function applied to the outline (Alpha layer?) only. Directional shadows would be done by applying the blur function in just one direction only, ie a 3x3 sample matrix of:
0.25 0.25 0
0.25 0.25 0
0 0 0
Should produce a nice down and to the right shadow effect.
I spent today researching AAA games GUI's and it seems a large majority of the text is now soft directional shadowed. Same in subtitled videos. Straight outlines are sometimes used but just don't seem to look as good.
Here is an example of what the result might look like: (Taken from inside my game engine)
The top is outlines as provided by BMfont at 4x super sample and 2 pixel outline
The middle is the alpha layer shifted one pixel down and to the right.
the bottom is with an addition 1 radius box filter applied in photoshop.
I'll also note there is a small bug in that outlines overlap other characters white areas. (the op in chop and wn in down) Without doing some annoying render to texture with additive color and alpha first for every single bit of text you want to draw, its near impossible to fix that when using thicker outlines on small fonts (Add 1 pixel per outline thickness would work, but then font spacing is increased). However the directional shadow thins the outline where it would of overlapped as long as you draw the letters in a left to right order.
<edit> I guess the best way to render outlines would be two passes: Render outline on first pass, then render text afterwards.
I guess I could edit all my font files myself to get the same effect, but one of the things I love about BMfont is it produces output that I can use right away in my engine, I can even provide the config files and let my games users/modders make there own font. Telling them to do a bunch of stuff in photoshop to tweak the outlines would kind of suck IMO. I would also love to get BMfont producing a font per user resolution automatically, Scaling fonts up or down too much is ugly, 1:1 pixel fonts look so much better.
So yea. Basically what I am asking for is the following:
X/Y pixel offset of outline, and a configurable blur function for outlines only. (maybe just running a simple blur matrix of user determined size? I am not too picky about how configurable the blur is).