• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

Text orientation

I want to print a number '10' on a form canvas. I wish to it to be rotated 90 degree.

How can I do this?

PeterShaw
0
petershaw8
Asked:
petershaw8
  • 3
  • 3
  • 2
1 Solution
 
kretzschmarCommented:
0
 
kretzschmarCommented:
or from borland,
(just the same)

Creating a rotated font. - by Borland Developer Support Staff



 Question and Answer Database

FAQ615D.txt   Creating a rotated font.
Category   :Windows API
Platform    :All
Product    :All 32 bit  

Question:
How do I create a rotated font?


Answer:
Rotating fonts is a straight forward process, so long as the Windows
font mapper can supply a rotated font based on the font you request.
Note: Using a TrueType font virturally guarantees success.

Here is an example of creating a font that is rotated 45 degrees:

procedure TForm1.Button1Click(Sender: TObject);
var
  lf : TLogFont;
  tf : TFont;
begin
  with Form1.Canvas do begin
    Font.Name := 'Arial';
    Font.Size := 24;
    tf := TFont.Create;
    tf.Assign(Font);
    GetObject(tf.Handle, sizeof(lf), @lf);
    lf.lfEscapement := 450;
    lf.lfOrientation := 450;
    tf.Handle := CreateFontIndirect(lf);
    Font.Assign(tf);
    tf.Free;
    TextOut(20, Height div 2, 'Rotated Text!');
  end;
end;


7/16/98 4:31:28 PM
 
meikl ;-)
0
 
gemartiCommented:
Or you could buy Raize Components.

http:\\www.raize.com
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
YodaMageCommented:
Or you could use the woll2woll 1st Class component TfcLabel
0
 
kretzschmarCommented:
or you could rotate your monitor on the side :-))
no code needed
0
 
gemartiCommented:
hmmmm...why not draw your form on a piece of paper with the label exactly the way you want it.. Make several copies and distribute them to your customers?  Instructions would read...

Past on screen to use.

  :)


0
 
YodaMageCommented:
With that in mind:

Type up label
Scan
Rotate image 90 degrees in editor
Slap TImage on form

: )
0
 
gemartiCommented:
I guess this q is degenerating pretty quick. No?

I'd say meikl  got the q. What do you say YodaMage?
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now