BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

vertical text

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Lutz Kutscher
Guest





PostPosted: Tue Sep 14, 2004 4:55 pm    Post subject: vertical text Reply with quote



Hi,

maybe I'm just missing something obvious, but I just can't seem to find a
(simple) way to draw rotated (vertical) text onto a canvas.

Thanks

Lutz
Back to top
Michael Koop
Guest





PostPosted: Tue Sep 14, 2004 6:21 pm    Post subject: Re: vertical text Reply with quote



Try this one
http://www.delphipages.com/threads/thread.cfm?ID=38386&G=38380
Best regards
Michael

Lutz Kutscher schrieb:

Quote:
Hi,

maybe I'm just missing something obvious, but I just can't seem to find a
(simple) way to draw rotated (vertical) text onto a canvas.

Thanks

Lutz


Back to top
Peter Below (TeamB)
Guest





PostPosted: Wed Sep 15, 2004 6:17 pm    Post subject: Re: vertical text Reply with quote



In article <opsebs92pgabzsfn (AT) lutzkutscher (DOT) preussgmbh.local>, Lutz Kutscher
wrote:
Quote:
maybe I'm just missing something obvious, but I just can't seem to find a
(simple) way to draw rotated (vertical) text onto a canvas.

You have to mix in a little API stuff:

procedure TForm1.Button3Click(Sender: TObject);
var
lf: TLogfont;
begin
with printer do begin
begindoc;
canvas.font.Name := 'Arial';
canvas.font.Size := 24;
canvas.textout( 100, 100, 'Das ist normaler Text' );
GetObject( canvas.font.handle, Sizeof(lf), @lf);
lf.lfescapement := 450;
lf.lforientation := 450;
Canvas.Font.handle := CreateFontIndirect( lf );
canvas.TextOut( 100, 1500, 'Das ist gedrehter Text');
Canvas.Font.Handle := 0;
EndDoc;
end;
end;


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Lutz Kutscher
Guest





PostPosted: Thu Sep 16, 2004 1:36 pm    Post subject: Re: vertical text Reply with quote

Thanks to you both,

it took me a while though, to get it working in my component:
The moment I removed that one line "canvas.font.name='arial'" the text
suddenly came out horizontally. After trashing a few monitors I found out,
that the problem wasn't removing that line, but that the default font of
the canvas I tried to draw on used font "MS Sans Serif" as a default. I
changed this font to arial (or any other ttf font) and it works fine. Did
I miss anything else, or is it true, that the system fonts can't be drawn
vertical?

(no need to answer, this was just meant as a comment, the question purely
retorical)

Lutz


On Wed, 15 Sep 2004 20:17:59 +0200, Peter Below (TeamB)
<100113.1101 (AT) compuXXserve (DOT) com> wrote:

Quote:
In article <opsebs92pgabzsfn (AT) lutzkutscher (DOT) preussgmbh.local>, Lutz
Kutscher
wrote:
maybe I'm just missing something obvious, but I just can't seem to find
a
(simple) way to draw rotated (vertical) text onto a canvas.

You have to mix in a little API stuff:

procedure TForm1.Button3Click(Sender: TObject);
var
lf: TLogfont;
begin
with printer do begin
begindoc;
canvas.font.Name := 'Arial';
canvas.font.Size := 24;
canvas.textout( 100, 100, 'Das ist normaler Text' );
GetObject( canvas.font.handle, Sizeof(lf), @lf);
lf.lfescapement := 450;
lf.lforientation := 450;
Canvas.Font.handle := CreateFontIndirect( lf );
canvas.TextOut( 100, 1500, 'Das ist gedrehter Text');
Canvas.Font.Handle := 0;
EndDoc;
end;
end;


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be




Back to top
Peter Below (TeamB)
Guest





PostPosted: Thu Sep 16, 2004 5:13 pm    Post subject: Re: vertical text Reply with quote

In article <opsee9fclzabzsfn (AT) lutzkutscher (DOT) preussgmbh.local>, Lutz Kutscher
wrote:
Quote:
it took me a while though, to get it working in my component:
The moment I removed that one line "canvas.font.name='arial'" the text
suddenly came out horizontally. After trashing a few monitors I found out,
that the problem wasn't removing that line, but that the default font of
the canvas I tried to draw on used font "MS Sans Serif" as a default. I
changed this font to arial (or any other ttf font) and it works fine. Did
I miss anything else, or is it true, that the system fonts can't be drawn
vertical?

Yes, you can only rotate TT fonts (basically outline or vector fonts), the GDI
cannot rotate bitmap fonts.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.