Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fonts at Big Sizes

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,311
US
One of the things I'm working on at the moment involves drawing fonts at big sizes onto the screen (think Teleprompter and you're close). Right now, I'm using a TBitmap, drawing my text, and then sizing it onto the screen. I'm doing this okay, but the problem I'm running into is the usual text guttering (or whatever the proper name for it is, it's the space in pixels between lines of text). I drop my drawn text to file and find about 300 pixels of white space between each line, which (obviously) is a gulf of space.

The main question is if there's some setting on TFont or the Canvas that I'm missing to reduce this, or if I need to crop the text after I draw it initially before I put it out to screen?

 
I don't have expert knowledge, but my understanding is that the line spacing is defined as part of the font, as each character will include space at the top and bottom eg. consider the letters 'Ey' which shows that uppercase letters still have empty space below them to handle lowercase letters in the font. And there is sure to be extra space as well which is magnified by the font size.

The way around this as I see it is to render your bitmaps as single lines with transparent backgrounds and overlay as appropriate for the font you're using.
 
That's what it's looking like I'll have to do. I'll probably play a bit more once I get the other problem(s) taken care of - mainly how to resize the form without leaving momentary "ghosts" on the form in other sizes, some outside the proper drawing area.

Thanks for your thoughts.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top