diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index d098f6466ab95ba25ddabb62deb3e0523f2d5208..e1ef77ae51c24ea2b59334a5bafa37ab5cc47220 100644 (file)
*/
/* Authors:
* Ulf Erikson <ulferikson@users.sf.net>
+ * Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
*
* Copyright (C) 2006-2009 Authors
*
WCHAR *unicode_uri = (WCHAR *) unicode_fn;
// width and height in px
- _width = sp_document_width(doc);
- _height = sp_document_height(doc);
+ _width = doc->getWidth();
+ _height = doc->getHeight();
NRRect d;
bool pageBoundingBox;
d.x1 = _width;
d.y1 = _height;
} else {
- SPItem* doc_item = SP_ITEM(sp_document_root(doc));
- sp_item_invoke_bbox(doc_item, &d, sp_item_i2d_affine(doc_item), TRUE);
+ SPItem* doc_item = SP_ITEM(doc->getRoot());
+ doc_item->invoke_bbox(&d, doc_item->i2d_affine(), TRUE);
}
d.x0 *= IN_PER_PX;
g_free(local_fn);
g_free(unicode_fn);
- m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, sp_document_height(doc)));
+ m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight()));
return 0;
}
@@ -679,24 +681,24 @@ PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom::Mat
if (moves == 1 && moves+lines == nodes && closed) {
polygon = true;
- if (nodes==5) {
- if (lpPoints[0].x == lpPoints[3].x && lpPoints[1].x == lpPoints[2].x &&
- lpPoints[0].y == lpPoints[1].y && lpPoints[2].y == lpPoints[3].y)
- {
- rectangle = true;
- }
- }
+// if (nodes==5) { // disable due to LP Bug 407394
+// if (lpPoints[0].x == lpPoints[3].x && lpPoints[1].x == lpPoints[2].x &&
+// lpPoints[0].y == lpPoints[1].y && lpPoints[2].y == lpPoints[3].y)
+// {
+// rectangle = true;
+// }
+// }
}
else if (moves == 1 && nodes == 5 && moves+curves == nodes && closed) {
- if (lpPoints[0].x == lpPoints[1].x && lpPoints[1].x == lpPoints[11].x &&
- lpPoints[5].x == lpPoints[6].x && lpPoints[6].x == lpPoints[7].x &&
- lpPoints[2].x == lpPoints[10].x && lpPoints[3].x == lpPoints[9].x && lpPoints[4].x == lpPoints[8].x &&
- lpPoints[2].y == lpPoints[3].y && lpPoints[3].y == lpPoints[4].y &&
- lpPoints[8].y == lpPoints[9].y && lpPoints[9].y == lpPoints[10].y &&
- lpPoints[5].y == lpPoints[1].y && lpPoints[6].y == lpPoints[0].y && lpPoints[7].y == lpPoints[11].y)
- {
- ellipse = true;
- }
+// if (lpPoints[0].x == lpPoints[1].x && lpPoints[1].x == lpPoints[11].x &&
+// lpPoints[5].x == lpPoints[6].x && lpPoints[6].x == lpPoints[7].x &&
+// lpPoints[2].x == lpPoints[10].x && lpPoints[3].x == lpPoints[9].x && lpPoints[4].x == lpPoints[8].x &&
+// lpPoints[2].y == lpPoints[3].y && lpPoints[3].y == lpPoints[4].y &&
+// lpPoints[8].y == lpPoints[9].y && lpPoints[9].y == lpPoints[10].y &&
+// lpPoints[5].y == lpPoints[1].y && lpPoints[6].y == lpPoints[0].y && lpPoints[7].y == lpPoints[11].y)
+// { // disable due to LP Bug 407394
+// ellipse = true;
+// }
}
if (polygon || ellipse) {
@@ -861,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
/*
@@ -881,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 :
@@ -917,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 :
@@ -962,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);
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :