|
-
March 29th, 1999, 10:47 AM
#1
How to get the "adjusted" LOGFONT info after a CreatFont(Indirect) call?
When I create a font with CFont.CreateFontIndirect or CFont.CreateFont the system takes the settings of the LOGFONT structure and creates a font as close as possible from the settings. However sometimes it need to use a different facename for this. How can I get the "adjusted" LOGFONT settings?
Example:
- I read a file for which the code set can be any Windows code set.
- I map the code set info to the correct lfCharset member of LOGFONT (for example 128 when the code set is cp932 (Japanese))
- I use "Tahoma" as the default facename.
When calling CreateFont or CreateFontIndirect the system smartly detects that Tahoma is not going to be OK for a lfcharset=128 (japanese is not supported in the Tahoma font) and use instead MS Gothic (a Japanese font). I'm really happy with that.
But now I want to get the "adjusted" settings really used. If I do a GetLogFont call I get the same info i passed, in this case "Tahoma" is still the facename rather than "MS Gothic".
In other words: How can you detect the font created has been adjusted and how do you get the new settings?
Thanks
-yves
-
March 30th, 1999, 01:21 PM
#2
Re: How to get the "adjusted" LOGFONT info after a CreatFont(Indirect) call?
Can GetTextMetrics help ?
-
March 30th, 1999, 05:40 PM
#3
Re: How to get the "adjusted" LOGFONT info after a CreatFont(Indirect) call?
Actually it does a little, some of the parameters are adjusted.
Thanks for pointing this out.
But I cannot get the new facename from TEXTMETRICS, just the font family name.
and that "adjusted" facename is what I need.
-yves
-
March 30th, 1999, 05:46 PM
#4
Re: How to get the "adjusted" LOGFONT info after a CreatFont(Indirect) call?
Actually, digging further from your answer I found that GetOutlineTextMetrics gives the adjusted information.
Thanks a bunch.
-yves
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|