+#endif
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ double dHeightPixels = height * m_iPhysicalYSize;
+ double dHeightPoints = dHeightPixels * m_dPointsPerPixel;
+ m_pFont->SetPointSize (nearest<int>(dHeightPoints));
+ m_driver.idWX()->SetFont (*m_pFont);
+ }
+#endif
+}
+
+void
+SGP::setTextNDCSize (double height)
+{
+ double dHeightPixels = height * m_iPhysicalYSize;
+#if HAVE_G2_H
+ if (m_driver.isG2())
+ g2_set_font_size(m_driver.idG2(), nearest<int>(dHeightPixels));
+#endif
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ double dHeightPoints = dHeightPixels * m_dPointsPerPixel;
+ m_pFont->SetPointSize (nearest<int>(dHeightPoints));
+ m_driver.idWX()->SetFont (*m_pFont);
+ }
+#endif
+}
+
+void
+SGP::setTextPointSize (double height)
+{
+#if HAVE_G2_H
+ // if (m_driver.isG2())
+ // g2_set_font_size(m_driver.idG2(), (height * m_iPhysicalYSize));
+#endif
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ m_pFont->SetPointSize (static_cast<int>(height+0.5));
+ m_driver.idWX()->SetFont (*m_pFont);
+ }
+#endif
+}
+
+void
+SGP::getTextExtent (const char* szText, double* worldW, double* worldH)
+{
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ wxString sText (szText);
+ wxCoord deviceW, deviceH;
+ m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH);
+ if (m_dTextAngle == 90 || m_dTextAngle == -90) {
+ wxCoord temp = deviceW;
+ deviceW = deviceH;
+ deviceH = temp;
+ }
+ *worldW = (xw_max - xw_min) * deviceW / static_cast<double>(m_iPhysicalXSize);;
+ *worldH = (yw_max - yw_min) * deviceH / static_cast<double>(m_iPhysicalYSize);
+ }
+#endif
+}
+
+double
+SGP::getCharHeight ()
+{
+ double dHeight = (1. / 25.);
+
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ dHeight = m_driver.idWX()->GetCharHeight();
+ dHeight /= static_cast<double>(m_iPhysicalYSize);
+ dHeight /= (yv_max - yv_min); // scale to viewport;
+ }
+#endif
+ dHeight *= (yw_max - yw_min); // scale to world coordinates
+ return dHeight;
+}
+
+double
+SGP::getCharWidth ()
+{
+ double dWidth = (1. / 80.);
+
+#if HAVE_WXWINDOWS
+ if (m_driver.isWX()) {
+ dWidth = m_driver.idWX()->GetCharWidth();
+ dWidth /= static_cast<double>(m_iPhysicalXSize);
+ dWidth /= (xv_max - xv_min); // scale to viewport
+ }
+#endif
+ dWidth *= (xw_max - xw_min); //scale to world coordinates
+ return dWidth;