summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 58a860a1f043..6c25dd8697de 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -429,6 +429,14 @@ namespace cairocanvas
if (cairo_glyphs.empty())
continue;
+ vcl::Font aFont = rOutDev.GetFont();
+ long nWidth = aFont.GetWidth();
+ long nHeight = aFont.GetHeight();
+ if (nWidth == 0)
+ nWidth = nHeight;
+ if (nWidth == 0 || nHeight == 0)
+ continue;
+
/**
* Setup font
**/
@@ -463,17 +471,12 @@ namespace cairocanvas
// Font rotation and scaling
cairo_matrix_t m;
- vcl::Font aFont = rOutDev.GetFont();
cairo_matrix_init_identity(&m);
if (aSysLayoutData.orientation)
cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
- long nWidth = aFont.GetWidth();
- long nHeight = aFont.GetHeight();
- if (nWidth == 0)
- nWidth = nHeight;
cairo_matrix_scale(&m, nWidth, nHeight);
//faux italics