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 

Writing text

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





PostPosted: Thu Apr 29, 2004 3:23 pm    Post subject: Writing text Reply with quote



Hello,

I would like to write a text with a specific height.
I mean that, If I write a text with this height I dont want any empty lines
at the botom and at the top of the Text.
My goal is to fit (verticaly) a bitmap with a specific height with a font.

I have tryed this :

Canvas.Font.Height := Trunc(SizeEdit.Value);
Canvas.TextOut(0, 0, MyText);

but I have some empty lines at the top and the bottom.

Any idea of how to solve this?

Steve


Back to top
Gary Williams
Guest





PostPosted: Thu Apr 29, 2004 3:45 pm    Post subject: Re: Writing text Reply with quote




Steve wrote:
Quote:
I would like to write a text with a specific height.
I mean that, If I write a text with this height I dont want any empty
lines
at the botom and at the top of the Text.
My goal is to fit (verticaly) a bitmap with a specific height with a font.

The empty space you're referring to is called the font's "leading". You
might be able to determine the leading of a given font (expressed in
points), convert that to pixels, then adjust the plot position up by the
same amount.

The Windows API function "GetTextMetrics" may help you to find the leading
of a given font.

-Gary



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.