Solved

Tlogfont unicode

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

Technology Partners: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 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