Original Post
🔒 Locked
How GetCharWidth works?
Advertisement
In my experience it doesn''t. (work, that is)
Check out my previous experience:
[url]http://www.gamedev.net/community/forums/topic.asp?topic_id=165540[/url]
Check out my previous experience:
[url]http://www.gamedev.net/community/forums/topic.asp?topic_id=165540[/url]
quote:
Original post by Sailorstick
In my experience it doesn't. (work, that is)
Check out my previous experience:
[url]http://www.gamedev.net/community/forums/topic.asp?topic_id=165540[/url]
What windows you got?
I have 98 SE and GetCharWidth32() doesnt work in that so Im using GetCharWidth() wich works and returns somehow sensible values... So now they should be converted...
The main queston isnt yet answerd, what is logical width? And how to convert?
[edited by - Craazer on May 9, 2004 12:33:51 PM]
So far no good. However this is how I understand the conversion should work from the docs:
So "quess" what, that doesnt work.
The window and viewport x's are both 1, wich I know nothing about, but character widths are still too short or unaccurate.
[edited by - Craazer on May 9, 2004 2:25:46 PM]
SIZE wext,vext;
GetWindowExtEx(mhdc,&wext);
GetViewportExtEx(mhdc,&vext);
for(int x = 0; x < NUM_CHARS;x++)
{
// cwidths are gained by GetCharWidth()
pcharwidths[x] = (MulDiv(cwidths[x],vext.cx,wext.cx));
}
So "quess" what, that doesnt work.
The window and viewport x's are both 1, wich I know nothing about, but character widths are still too short or unaccurate.
[edited by - Craazer on May 9, 2004 2:25:46 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement