Creating a white outline around text texture Open-ES 2.0

Hi, I have just learned how to render text on to the screen. This text is rendered on top of a map. For clarity, what I would like to do is make a white outline or glow (just a couple of pixels wide) around the rendered text.

The fonts come from a ttf file and get transformed into a bitmap texture atlas.

You could first draw the text with the bold form of the font in white and then draw the regular text on top of it. Valve's technique using distance fields to store the font glyphs (paper) also allows adding an outline in a shader.

Hmm, what exactly is your question?
As a simpler alternative and since (if I read it correctly) you are only using the alpha channel of your texture you could implement a simple edge detection in your fragment shader and use a different colour if you detect an edge texel. For the edge detection, in addition to sampling at the fragment's texture location sample neighbouring texels and determine if the values are "similar enough" - you should be able to find lots of material on this, since it is used for many post processing effects as well as a whole bunch of anti-aliasing techniques.

PS: source code is usually easier to read in a monospace font, [code][/code] tags should take care of that.

I have altered this so ResS = 17, ResT = 24 for my own texture size.
After testing this however it just displays a black box, I guess this is caused by the fact that it is not using alpha?

My questions are:
What do I need to change to get it to work with alpha.
and
What is the process, do I do two draws first to draw the white edge I am after, then do a second draw for the actual text itself?

If I'm reading it correctly it converts each RGB sample to a luminance value (with the dot product with W). I suppose you could try getting rid of that and just use the alpha component of the texture. What also looks odd is the mix() call at the bottom, since the last parameter is a constant it does not really interpolate between irgb and target, but always uses the value of target.

I have modified things to be a little simpler, or so I thought.
I have tried creating a bitmap with the same fonts, except bold and white. This is going to provide me with a white outline(background) for my black text.

I save out the bitmap to a png file to check that it is correct, it is correct. Below is the screen shot from opening the png in fireworks)

Somewhere in between the loading of the texture and the rendering it is sticking in grey on the edges. Below is a screenshot, I have only rendered the white background in the bottom left corner.

Below is my texture loader, shader and the third is the draw function which has the blend I'm using.

At the moment I just trying to get the white background rendering correctly.
How do I get rid of the grey?