Solved

Tlogfont unicode

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

11 Experts available now in Live!

Get 1:1 Help Now