summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-11-09 11:38:11 +0100
committerThorsten Behrens <tbehrens@suse.com>2012-11-09 16:02:11 +0100
commit78cb2c6368d0fdcdbcd1b2f3e4d033774e1b4b60 (patch)
tree6b8d09500a627e7d2de9eb174062688353ef6344 /canvas
parentcad7a5814775adf458f8a490700fa5ef6b8f8638 (diff)
bnc#681110: Fix squashed glyphs with Cairo canvas.
I suppose it is the same misconception as in fdo#55931 - I am convinced that the font metrics should not be used here. Looks to me as if in the past, the font width computation was broken somewhere deep inside OOo, and everyone instead of fixing the root cause was just working that around by using the FontMetric; and then one day the root cause was fixed, and all the workarounds broke ;-) - but that is just a theory. Change-Id: I741bf8f4eaea4f7d8bc698dc9a8124109dfb8c20 Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx25
1 files changed, 2 insertions, 23 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index d6de60a3cf1b..f4254366f6e2 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -554,32 +554,13 @@ namespace cairocanvas
// Font rotation and scaling
cairo_matrix_t m;
Font aFont = rOutDev.GetFont();
- FontMetric aMetric( rOutDev.GetFontMetric(aFont) );
- long nWidth = 0;
-
- // width calculation is deep magic and platform/font dependant.
- // width == 0 means no scaling, and usually width == height means the same.
- // Other values mean horizontal scaling (narrow or stretching)
- // see issue #101566
-
- //proper scale calculation across platforms
- if (aFont.GetWidth() == 0)
- {
- nWidth = aFont.GetHeight();
- }
- else
- {
- // any scaling needs to be relative to the platform-dependent definition
- // of height of the font
- nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
- }
cairo_matrix_init_identity(&m);
if (aSysLayoutData.orientation)
cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
- cairo_matrix_scale(&m, nWidth, aFont.GetHeight());
+ cairo_matrix_scale(&m, aFont.GetWidth(), aFont.GetHeight());
//faux italics
if (rSysFontData.bFakeItalic)
@@ -592,11 +573,9 @@ namespace cairocanvas
#else
# define TEMP_TRACE_FONT ::rtl::OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr()
#endif
- OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), W:%d->%d, Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
+ OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
aFont.GetWidth(),
aFont.GetHeight(),
- aMetric.GetWidth(),
- nWidth,
(int) rOutpos.X(),
(int) rOutpos.Y(),
cairo_glyphs.size() > 0 ? cairo_glyphs[0].index : -1,