[try Beta version]
Not logged in

 
TextMetrics

Jul 5, 2022 at 6:22pm
I've never noticed this before, but when using GetTextMetrics() to get the height of the font to display the next line with proper spacing, if I use '(' or ')', they get chopped off when displaying the next line. Does GetTextMetrics() only give height for alphanumeric characters? Not sure if other fonts do the same thing.
Jul 6, 2022 at 7:29am
Does GetTextMetrics() only give height for alphanumeric characters?
I don't think that would make sense. The member tmHeight is supposed to give the maximum height of all characters.

Maybe you need to consider the tmExternalLeading member?
Jul 6, 2022 at 11:00am
GetTextMetrics() fills in a structure about the font. For all fonts I am using, I am using tmHeight+tmExternalLeading as my total character height. tmExternalLeading is 0 for some reason and so it is chopping off certain special characters when displaying the next line. Alphanumerics seem OK. If I add 2 to the total character height, then special characters display fine, but that seems like a hack.
Last edited on Jul 6, 2022 at 11:00am
Jul 6, 2022 at 11:26am
Found the problem. I was redefining a font to be a little larger at specific times, but not recalling GetTextMetrics() to get the new parameters. Thus, user error.
Topic archived. No new replies allowed.