   blurry fonts with d3d10 *solved
  im strying to render some fonts in d3d10... however im havin a problem with the quality of the font... it gets all blurry at the edges and looks all wrong,,, what might eb causing this?#pragma once// use D3D10 API#define API_D3D10#include "Drone.hpp"#include "Win32Console.hpp"#include "Win32Window.hpp"class Demo1 : public drone::Engine{public:  void onCreateDevice()  {  thefont.reset(new drone::graphics::d3d10::Font(GetRenderDevice(),35, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Helvetica"));  }  void onFrameRender()  {  //GetRenderDevice()->BeginRendering();  thefont->Print(TEXT("This is a test string."));  //GetRenderDevice()->EndRendering();  }  void onFrameMove()  {  }  void onKeyboard(drone::win32::Keyboard*)  {    std::cout << "KEYBOARD";  }  void onMouse(drone::win32::Mouse*)  {    std::cout << "MOUSE";   }private:drone::graphics::d3d10::FontPtr thefont; };#pragma once#include "D3D10.hpp"#include "RenderDevice.hpp"#include <string>#include <boost/shared_ptr.hpp>namespace drone{  namespace graphics{    namespace d3d10{class Font{public:Font(RenderDevicePtr pDevice,  INT Height,  UINT Width,  UINT Weight,  UINT MipLevels,  BOOL Italic,  UINT CharSet,  UINT OutputPrecision, UINT Quality, UINT PitchAndFamily, LPCWSTR pFaceName){pDevice_ = pDevice;HRESULT hr = D3DX10CreateFont(pDevice_->GetDevice().get(),  Height,  Width,  Weight,  MipLevels,  Italic,  CharSet,  OutputPrecision,  Quality,  PitchAndFamily,  pFaceName,  &pFont_);if (FAILED(hr))throw std::exception("Failed to create font.");D3DX10CreateSprite(pDevice_->GetDevice().get(),512,&pSprite_);D3D10_BLEND_DESC StateDesc;ZeroMemory(&StateDesc, sizeof(D3D10_BLEND_DESC));StateDesc.AlphaToCoverageEnable = FALSE;StateDesc.BlendEnable[0] = TRUE;StateDesc.SrcBlend = D3D10_BLEND_SRC_ALPHA;StateDesc.DestBlend = D3D10_BLEND_INV_SRC_ALPHA;StateDesc.BlendOp = D3D10_BLEND_OP_ADD;StateDesc.SrcBlendAlpha = D3D10_BLEND_ZERO;StateDesc.DestBlendAlpha = D3D10_BLEND_ZERO;StateDesc.BlendOpAlpha = D3D10_BLEND_OP_ADD;StateDesc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL;pDevice_->GetDevice()->CreateBlendState(&StateDesc, &pFontBlendState10);}void Print(LPCWSTR text){FLOAT OriginalBlendFactor[4];UINT  OriginalSampleMask = 0;if (pDevice_->GetDevice()){RECT rc;SetRectEmpty(&rc);GetFontRectangle(text, &rc);pSprite_->Begin(D3DX10_SPRITE_SORT_TEXTURE);pFont_->DrawText( pSprite_.get(), text, -1, &rc, DT_LEFT, D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );pDevice_->GetDevice()->OMGetBlendState(&pOriginalBlendState10, OriginalBlendFactor, &OriginalSampleMask);if(pFontBlendState10){FLOAT NewBlendFactor[4] = {0,0,0,0};pDevice_->GetDevice()->OMSetBlendState(pFontBlendState10.get(), NewBlendFactor, 0xffffffff);}pSprite_->End();pDevice_->GetDevice()->OMSetBlendState(pOriginalBlendState10.get(), OriginalBlendFactor, OriginalSampleMask);pDevice_->GetSwapChain()->Present(0, 0);}}private:RenderDevicePtr pDevice_;void GetFontRectangle(LPCWSTR text, RECT* rect){pFont_->DrawText(NULL,text,-1,rect,DT_CALCRECT | DT_LEFT,D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f));}ID3DX10FontPtr pFont_;ID3DX10SpritePtr pSprite_;ID3D10BlendStatePtr  pOriginalBlendState10;ID3D10BlendStatePtr  pFontBlendState10;};typedef boost::shared_ptr<Font> FontPtr;} // d3d10  } // graphics} // dronethis is how it looks...the one at the top is my applicationand the one below is how it should look (got it from a sample application)....they both use exactly the same settings and as far as i could see the code was identical...i dont see whats causing this...[Edited by - Dragon_Strike on March 11, 2008 10:43:29 AM]
  Have you got antialiasing turned on by default in either your application or drivers?   ;  tried forcing it off in the drivers... no difference...   ;  ive tried copying the code from the sample directly into my code (replacing) and then it works.. soo im obviously doin something wrong somehwere...   