whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

40 Visitors Online


 
...rotate Text?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (26):  
     




procedure TForm1.FormPaint(Sender: TObject);
var
  
lf: TLogFont;
  tf: TFont;
begin
  with 
Form1.Canvas do
  begin
    
Font.Name := 'Arial';
    Font.Size := 24;
    tf        := TFont.Create;
    try
      
tf.Assign(Font);
      GetObject(tf.Handle, SizeOf(lf), @lf);
      lf.lfEscapement  := 320;
      lf.lfOrientation := 320;
      SetBkMode(Handle, TRANSPARENT);
      tf.Handle := CreateFontIndirect(lf);
      Font.Assign(tf);
    finally
      
tf.Free;
    end;
    TextOut(10, Height div 2, 'Your Rotated Text!');
  end;
end;




The LOGFONT structure holds information about a logical font.
The various members of the structure specify properties of the logical font:

lfEscapement
The angle between the font's baseline and escapement vectors,
in units of 1/10 degrees.
Windows 95, 98: This must be equal to lfOrientation.

lfOrientation
The angle between the font's baseline and the device's x-axis,
in units of 1/10 degrees.
Windows 95, 98: This must be equal to lfEscapement.

lfWidth
The average width of the font's characters.
If 0, the font mapper tries to determine the best value

lfWeight
One of the following flags specifying the
boldness (weight) of the font:

FW_DONTCARE = 0 Default weight.
FW_THIN = 100 Thin weight.
FW_EXTRALIGHT = 200 Extra-light weight.
FW_LIGHT = 300 Light weight.
FW_NORMAL = 400 Normal weight.
FW_MEDIUM = 500 Medium weight.
FW_SEMIBOLD = 600 Semi-bold weight.
FW_BOLD = 700 bold weight.
FW_EXTRABOLD = 800 Extra-bold weight.
FW_HEAVY = 900 Heavy weight.


lfItalic
A non-zero value if the font is italicized, 0 if not.

lfUnderline
A non-zero value if the font is underlined, 0 if not.

lfStrikeOut
A non-zero value if the font is striked out, 0 if not.

 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners