 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Steve Guest
|
Posted: Thu Apr 29, 2004 3:23 pm Post subject: Writing text |
|
|
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
|
Posted: Thu Apr 29, 2004 3:45 pm Post subject: Re: Writing text |
|
|
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 |
|
 |
|
|
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
|
|