wx Issues
We've got code to handle these issues in wxWebKit trunk, but they should be cleaned up, reworked, and moved to wx itself.
- Cross-platform
- GetTextExtents currently requires a valid wxWindow or wxDC to work, but it is too costly to create a wxWindow or wxScreenDC on Mac just to work around this. The valid DC requirement only applies to Windows, and there we can just do GetDC(0) when there is no DC or native window. So we could move this method to wxFont, and just use the optional wxDC argument in the wxWindow version of the method to pass in a DC if we have one.
- There is currently no way to get certain font metrics, such as line spacing. Further, it's costly to calculate these metrics each time we want to get text properties, as GetTextExtents does - we should cache the results and only re-calculate if text properties have changed. (e.g. font size, font, etc.) Again, these should either be methods of the font, or maybe a helper class such as wxFontMetrics or wxFontProperties.