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 

Textheight with wingdings

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





PostPosted: Tue May 08, 2007 2:51 am    Post subject: Textheight with wingdings Reply with quote



I'm trying to get the text height of these two characters in the WingDing
font family.

û = x
ü = checkmark

When they are displayed on the screen the 'x' is visibly shorter than the
checkmark but using textheight() they come out the same height. Is there a
way to get the exact height of the different characters for fonts like this?
--
Best regards,
Harold
Back to top
Herre de Jonge
Guest





PostPosted: Tue May 08, 2007 4:28 am    Post subject: Re: Textheight with wingdings Reply with quote



Does GetTextExtentPoint32() do the trick?

Harold wrote:
Quote:
I'm trying to get the text height of these two characters in the WingDing
font family.

û = x
ü = checkmark

When they are displayed on the screen the 'x' is visibly shorter than the
checkmark but using textheight() they come out the same height. Is there a
way to get the exact height of the different characters for fonts like this?
Back to top
Harold
Guest





PostPosted: Tue May 08, 2007 6:42 am    Post subject: Re: Textheight with wingdings Reply with quote



"Herre de Jonge" <hdejonge (AT) ravelin (DOT) nl> wrote in message

Quote:
Does GetTextExtentPoint32() do the trick?

Nope, it reports the same thing for size.cy for any character that is
passed.

Harold
Back to top
quick
Guest





PostPosted: Tue May 08, 2007 9:44 pm    Post subject: Re: Textheight with wingdings Reply with quote

I checked several fonts
they have all had a fixed height
even when the width is variable

Harold wrote:
Quote:
"Herre de Jonge" <hdejonge (AT) ravelin (DOT) nl> wrote in message

Does GetTextExtentPoint32() do the trick?

Nope, it reports the same thing for size.cy for any character that is
passed.

Harold

Back to top
Peter Below (TeamB)
Guest





PostPosted: Tue May 08, 2007 10:15 pm    Post subject: Re: Textheight with wingdings Reply with quote

Harold wrote:

Quote:
I'm trying to get the text height of these two characters in the
WingDing font family.

û = x
ü = checkmark

When they are displayed on the screen the 'x' is visibly shorter than
the checkmark but using textheight() they come out the same height.
Is there a way to get the exact height of the different characters
for fonts like this?

It can be done but it is not so straightforward. GetOutlineTextMetrics
gives you more information about a fonts character cell layout than
just using the total text height, but getting data for a specific
character is cumbersome. You can use GetGlyphOutline for that, but the
data format is not easy to analyze.

If you really need a character height representing the distance from
the topmost to the bottommost pixel rendered on a canvas the simplest
way to get that may be to render the character in the required font
size to a bitmap filled with white and then scan the pixel lines for
the first and last containing at least one black pixel.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Back to top
Harold
Guest





PostPosted: Wed May 09, 2007 12:07 am    Post subject: Re: Textheight with wingdings Reply with quote

Quote:
If you really need a character height representing the distance from
the topmost to the bottommost pixel rendered on a canvas the simplest
way to get that may be to render the character in the required font
size to a bitmap filled with white and then scan the pixel lines for
the first and last containing at least one black pixel.

Almost more work than its worth<g>. I wanted to center a wingding/webding
type character on a button. Because of the height differences some appear
centered and some don't.

Harold
Back to top
Nils Haeck
Guest





PostPosted: Fri May 11, 2007 7:12 pm    Post subject: Re: Textheight with wingdings Reply with quote

GetGlyphOutline returns information about a character in a GLYPHMETRICS
record. Look at the gmBlackboxX, gmBlackboxY, and gmptGlyphOrigin fields.
Using these fields you are able to reconstruct the exact bounding box of the
character (although I agree with Peter Below that getting it all working
correctly is a bit tricky).

Nils

"Harold" <h.holmes (AT) n (DOT) o.spam.lincolnbeach.com> schreef in bericht
news:463f9f5d$1 (AT) newsgroups (DOT) borland.com...
Quote:
I'm trying to get the text height of these two characters in the WingDing
font family.

û = x
ü = checkmark

When they are displayed on the screen the 'x' is visibly shorter than the
checkmark but using textheight() they come out the same height. Is there a
way to get the exact height of the different characters for fonts like
this?
--
Best regards,
Harold

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.