[DUG] vertical text in label

Rohit Gupta r.gupta at xtra.co.nz
Wed Feb 13 13:18:59 NZDT 2008


Yes, you did it for us.... here is the code and it has to be truetype

procedure CreateAngledFont (Font: TFont; const Angle: Integer );
var
FntLogRec: TLogFont { Storage area for font information } ;
begin
{ Get the current font information. We only want to modify the angle }
fillchar (FntLogRec, sizeof(FntLogRec), #0);
GetObject (Font.Handle, SizeOf(FntLogRec), Addr(FntLogRec));

{ Modify the angle. "The angle, in tenths of a degrees, between the base
line of a character and the x-axis." (Windows API Help file.) }
FntLogRec.lfEscapement := (Angle * 10);
FntLogRec.lfOrientation := (Angle * 10);
FntLogRec.lfOutPrecision := OUT_TT_PRECIS; { Request TrueType precision }

{ Delphi will handle the deallocation of the old font handle }
Font.Handle := CreateFontIndirect (FntLogRec);
end;

Myles Penlington wrote:
>
> I’ve done this before. From memory you have to use a True type? Font, 
> else it does not rotate.
>
> Myles.
>
> *From:* delphi-bounces at listserver.123.net.nz 
> [mailto:delphi-bounces at listserver.123.net.nz] *On Behalf Of *Jeremy 
> Coulter
> *Sent:* Wednesday, 13 February 2008 7:54 a.m.
> *To:* 'NZ Borland Developers Group - Delphi List'
> *Subject:* RE: [DUG] vertical text in label
>
> Take a look on www.torry.net <http://www.torry.net> (or www.torrys.net 
> <http://www.torrys.net>) as there are load of controls and examples around
>
> ------------------------------------------------------------------------
>
> *From:* delphi-bounces at listserver.123.net.nz 
> [mailto:delphi-bounces at listserver.123.net.nz] *On Behalf Of *Vikas...
> *Sent:* 12 February 2008 23:16
> *To:* NZ Borland Developers Group - Delphi List
> *Subject:* [DUG] vertical text in label
>
> Hi
>
> I have one query to rotate the text in label in delphi 5
>
> anyone have any ideas how to do it
>
> i have used to following code but dint helped me
>
>
> var
> ALogFont: TLogFont;
> hFont: THandle;
> begin
> ALogFont.lfHeight := Font.Height;
> ALogFont.lfEscapement := 900;
> ALogFont.lfOrientation := 900;
> hFont := CreateFontIndirect (ALogFont);
> Label1.Canvas.Font.Handle :=hFont;
> Label1.Canvas.TextOut(1,1 ,'hello');
>
> regards
>
> Vikas
>
> -- 
> vikas
>
> Attention:
> This communication is confidential and may be legally privileged. If 
> you are not the intended recipient, please do not use, disclose, copy 
> or distribute it, other than to return it to us with your confirmation 
> that it has been deleted from your system.
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus 
> signature database 2869 (20080212) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
> ------------------------------------------------------------------------
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 2869 (20080212) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>   



More information about the Delphi mailing list