void GetTextExtent(char *string, float *w, float *h, float *descent = NULL, float *externalLeading = NULL)
Gets the dimensions of the string using the currently selected font. string is the text string to measure, w and h are the total width and height respectively, descent is the dimension from the baseline of the font to the bottom of the descender, and externalLeading is any extra vertical space added to the font by the font designer (usually is zero).
See also wxFont, wxDC::SetFont.