Dynamically creating CFont to fit in CRect area??
Posted on 2002-05-04
What is the best way to resize a CFont to fit in a given area of my Custom Control? The cx and cy of the control both change and have to be taken into account. I guess the best way to explain, is using a CRect, I want my text to scale so it always fits in the CRect; top to bottom, left to right. I know how to tie the CFont height variable to CRect.Height() but I also need to take into accont the Width(). Anyway... There must be an easy way to accomplish my goal that I am not seeing. All suggestions welcome and code samples greatly appreciated.