I am working on a cross platform library that needs to draw text using fonts into a device context. The width of the text combined with the user selected font is proving difficult to calculate.
In Windows we use BOOL GetTextExtentPoint32(HDC hdc, LPCTSTR lpString, int cbString, LPSIZE lpSize) this works without problem. On Mac OS X we used StringWidth(ConstStr255Param s), however since OS X 10.4 this has been deprecated. So my question is, how would one go about successfully calculating the width of a string on OS X 10.4 and higher.