That library uses another piece of DWrite, a BitmapRenderTarget, to render each glyph to a memory buffer and then packs it into a Direct3D texture atlas using a bin packing algorithm. Then you have a texture atlas with various rendered glyphs, and you have positioning info, so you can just draw quads at those spots with the correct texture coordinates and it all works.
And i want to do that on this method, but i still have a few question, the first is: I can draw text with DirectWrite in other place than winapi message WM_PAINT ? I can do this in render function ? And how i can copy BitmapRenderTarget to Direct3D texture ?
I was definite if D3D9 don't support integer operations the compilator show any error, i tried multibly by 255 ant convert to int but i got bad result, now i know why.
I have last question, i rode this article http://www.gamedev.net/blog/73/entry-1692117-terrain-texturing-explained/ and i saw what data are save to lut texture, on U axis slope, on V axis altitude. This is good solution because i don't must refresh my lut texture when i change terrain geometry. But i don't know how i should save altitude data, range on V axis is 0-1, my heightmap vertex can have any height. How save and read this ? I should do somthing like this: Pixel Shader:
float3 B = tex2D(lutsampler, float2(height / LUTTextureHeight, normal.y);
float3 B = tex2D(lutsampler, float2(height / MaxTerrainHeight, normal.y);