From: Alvin Penner Date: Fri, 7 Jan 2011 23:44:43 +0000 (-0500) Subject: Export. add emf text rotation (Bug 681262) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6f02beb72f1612b1a9c1e03b97f3912aac61ae63;p=inkscape.git Export. add emf text rotation (Bug 681262) --- diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index c7f8e3d4c..e1ef77ae5 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -863,6 +863,8 @@ PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char const *text, Geom if (!hdc) return 0; HFONT hfont = NULL; + Geom::Matrix tf = m_tr_stack.top(); + double rot = 1800.0*std::atan2(tf[1], tf[0])/M_PI; // 0.1 degree rotation #ifdef USE_PANGO_WIN32 /* @@ -883,8 +885,8 @@ PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char const *text, Geom lf->lfHeight = style->font_size.computed * IN_PER_PX * dwDPI; lf->lfWidth = 0; - lf->lfEscapement = 0; - lf->lfOrientation = 0; + lf->lfEscapement = rot; + lf->lfOrientation = rot; lf->lfWeight = style->font_weight.computed == SP_CSS_FONT_WEIGHT_100 ? FW_THIN : style->font_weight.computed == SP_CSS_FONT_WEIGHT_200 ? FW_EXTRALIGHT : @@ -919,8 +921,8 @@ PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char const *text, Geom lf->lfHeight = style->font_size.computed * IN_PER_PX * dwDPI; lf->lfWidth = 0; - lf->lfEscapement = 0; - lf->lfOrientation = 0; + lf->lfEscapement = rot; + lf->lfOrientation = rot; lf->lfWeight = style->font_weight.computed == SP_CSS_FONT_WEIGHT_100 ? FW_THIN : style->font_weight.computed == SP_CSS_FONT_WEIGHT_200 ? FW_EXTRALIGHT : @@ -964,8 +966,6 @@ PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char const *text, Geom // Transparent text background SetBkMode(hdc, TRANSPARENT); - Geom::Matrix tf = m_tr_stack.top(); - p = p * tf; p[Geom::X] = (p[Geom::X] * IN_PER_PX * dwDPI); p[Geom::Y] = (p[Geom::Y] * IN_PER_PX * dwDPI);