# ID3DXFont with Thai Text

## Recommended Posts

When I try to display Thai text with ID3DXFont , I've got 'Access Violation' error. This is how I initiate the ID3DXFont
if(FAILED(D3DXCreateFont(dev,14,10,FW_DONTCARE,10,FALSE,THAI_CHARSET,OUT_TT_ONLY_PRECIS,10,TMPF_TRUETYPE,"Arial",&font))){
MessageBox(handle,"Create Font Error","error",0);
return FALSE;
}

and I use DrawText method to draw text :-
font->DrawTextW(NULL,L"Hi ... What's up ?",-1,&textRect,DT_LEFT|DT_TOP,D3DCOLOR_RGBA(0,0,0,255));
This is run fine, even I change the text to "·´ÊÍº" . But when I change the text to "·´ÊÍº¢éÍ¤ÇÒÁ" (notice the upper level charator 'äÁéâ·') , I got Access Violation Error. I have tried the managed DirectX version (with C#) , it run fine with no error. Of course , this is international community, and there are only few people here knows thai, but here is my last resort. If anyone have any comment or suggestion, please help me. Sorry for my not-so-good English (quite bad, actually ). ^^'

##### Share on other sites
OK, I've got solution. The font that is used is not support thai charset (sound odd, this font is support thai and this is standard thai font), so I just change to Arial.

^^'

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628383
• Total Posts
2982384

• 10
• 9
• 15
• 24
• 11