Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tlogfont unicode

Posted on 2007-03-31
3
Medium Priority
?
904 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

722 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