var<br> r:string; <br> LogFont:TLogFont;<br> NewFont,OldFont:THandle;<br>begin<br> SetBkMode(Canvas.Handle,Transparent);<br> LogFont.lfHeight :=20; <br> LogFont.lfWidth :=10;<br> LogFont.lfEscapement :=900; // 这一句是要旋转的角度*10<br> LogFont.lfWeight :=0;<br> LogFont.lfItalic :=0;<br> LogFont.lfUnderline :=0;<br> LogFont.lfStrikeOut :=0;<br> LogFont.lfCharSet :=DEFAULT_CHARSET;<br> r :='宋体'#0;<br> move(r[1],LogFont.lfFaceName[0],length(r)+1);<br> NewFont :=CreateFontIndirect(LogFont);<br> OldFont :=SelectObject(Canvas.Handle,NewFont);<br> Canvas.TextOut(100,100,'test');<br> SelectObject(Canvas.Handle,OldFont);<br> DeleteObject(NewFont);<br>end;<br>