Scott, > What happens now is that I use GetClientRect() to find out how big the > area is, and simply divide it by the columns/rows that I need. I pass > these sizes to CreateFont() which returns a font that doesn't always match > the dimensions I gave it, so sometimes the font is too small, and > despite documentation to the contrary, sometimes it's too big. This > leaves me with a font that doesn't actually fit in the Window, so > characters are getting chopped off.
What I do (in similar situation) is, enumerate all font sizes starting with some really low size 2 upwards and calculate width/height of a "sample" text with GetTextExtentPoint32 and make sure it fits in my window, I stop at the largest font that fits my text inside the window and use it. I draw a blank border inside unused area of my window around my rectangle of text to fill the space, never resize client window, it just looks odd to me. All happens inside WM_SIZE event. I use only fixed width fonts (Lucida Console is perfect), so any sample text should do, for example "WWWWW....WWW" (80 of them). Alex _______________________________________________ This is the Linux 5250 Development Project (LINUX5250) mailing list To post a message email: [EMAIL PROTECTED] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/linux5250 or email: [EMAIL PROTECTED] Before posting, please take a moment to review the archives at http://archive.midrange.com/linux5250.