MrDeathStar Posted October 26, 2015 Share Posted October 26, 2015 I am using the Canvas component to center some text features among custom graphics. I call Draw.SetFont() and Draw.GetTextExtent() to calculate text positions before drawing. However, GetTextExtent() seems to report the same pixel size regardless of the font size chosen. Since SetFont() does not use a DC argument, I tried a dummy TextOut() using the chosen font to see if that would set the DC before calling GetTextExtent. It did not work either, so any help is appreciated. Thanks. (ver. 2203/2224/2229) Link to comment Share on other sites More sharing options...
AzeoTech Posted October 27, 2015 Share Posted October 27, 2015 We have that fixed. Email us for a link to a prerelease build (or if you've already used a prerelease, its in the same spot as before). You were on the right track trying to do a dummy TextOut(). The issue was that the system wasn't setting the font into the DC before calling GetTextExtent(). It does it now.... Link to comment Share on other sites More sharing options...
MrDeathStar Posted October 28, 2015 Author Share Posted October 28, 2015 I figured it might have been a simple SelectObject related thing. The dummy TextOut was a stab in the dark, but if it had worked I would have probably questioned potential DC object leaks from not selecting it out. Since the forum did not have much regarding GetTextExtent, I gather it is a seldom used/tested feature. So, thanks again for a speedy fix with the 2230 update! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.