+//
+// Return the non-rotated rectangle containing the extents of the text in
+// Cartesian coordiates (starting from <0, 0>, the lower left hand side)
+//
+Rect Painter::MeasureTextObject(QString text, double size)
+{
+ if (!painter)
+ return Rect();
+
+ painter->setFont(QFont("Arial", Global::zoom * size));
+ int textWidth = QFontMetrics(painter->font()).width(text);
+ int textHeight = QFontMetrics(painter->font()).height();
+ Point measured((double)textWidth / Global::zoom, (double)textHeight / Global::zoom);// = QtToCartesianCoords(Point(textWidth, textHeight));
+//printf("QFontMetrics w/h=%i/%i, measured=%lf/%lf\n", textWidth, textHeight, measured.x, measured.y);
+
+ return Rect(Point(0, 0), measured);
+}
+
+