Languages: C, C++, Java or Delphi (with/without WinAPIs)
Question: I need a function (inbuilt or custom) which gives the exact width
of a given string and given Font.
Like: int GetStringWidth(char *str, CFont font)
1) GetTextMetrics to get average width * strlen(str)
-- does not work for non-fixed-width-fonts, for long strings
-- very close, but not accurate.
Note: Could not get how to use GetKerningPairs to find the string width.
Some code would be very useful.
Thank You for all your help, in advance.