Solved

Tlogfont unicode

Posted on 2007-03-31
3
894 Views
Last Modified: 2008-01-09
Experts,
    I try to rotate unicode text by using Tlogfont   in delphi 7.But it seems can't run. Needs help.Thanks.
My code show below.

procedure TForm1.Button1Click(Sender: TObject);
var
  lf,flogfont:logfont;
begin
   with tntimage1.Canvas  do
   begin
     FillChar(LF,Sizeof(LF),0);
              With   lF  do
              begin
                lfHeight:=60;
                lfWidth:=40;
                //lfEscapement:=iAnc;
                lforientation:=lfEscapement;
                lfWeight:=Fw_Normal;
                lfItalic:=0;
                lfUnderline:=0;
                lfStrikeOut:=0;
                //lfCharSet:=CHINESEBig5_CHARSET;
                //StrPCopy(lfFaceName,'');
                lfQuality:=PROOF_QUALITY;
                lfOutPrecision:=OUT_TT_ONLY_PRECIS;
                lfClipPrecision:=CLIP_DEFAULT_PRECIS;
                lfPitchAndFamily:=Variable_Pitch;
              end;
              Font.Handle:=CreateFontIndirect(LF);
              TextOut(10,100,tntedit1.text);

     end;
end;
0
Comment
Question by:Cheng_sam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 18828320
What doesn't work?
This works for me.

     FillChar(LF,Sizeof(LF),0);
              With   lF  do
              begin
                lfFaceName := 'Arial Black';       // specify some true type font
                lfHeight:=60;
                lfWidth:=40;
                lfEscapement:=450;                 // this is for 45 degrees
                lforientation:=lfEscapement;
                lfWeight:=Fw_Normal;
                lfItalic:=0;
                lfUnderline:=0;
                lfStrikeOut:=0;
                //lfCharSet:=CHINESEBig5_CHARSET;
                //StrPCopy(lfFaceName,'');
                lfQuality:=PROOF_QUALITY;
                lfOutPrecision:=OUT_TT_ONLY_PRECIS;
                lfClipPrecision:=CLIP_DEFAULT_PRECIS;
                lfPitchAndFamily:=Variable_Pitch;
              end;
              Font.Handle:=CreateFontIndirect(LF);
              TextOut(10,100,'ABAK');
0
 
LVL 17

Accepted Solution

by:
mokule earned 250 total points
ID: 18828322
I didn't test with unicode.
Maybe You should replace TextOut with

    TextOutW(tntimage1.Canvas.Handle,10,100,tntedit1.text,Length(tntedit1.text));
0
 

Author Comment

by:Cheng_sam
ID: 18831688
It works fine.Thanks mokule.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question