Solved

Tlogfont unicode

Posted on 2007-03-31
3
882 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

939 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now