Fixed imported fro, iwb text size.

Corrected imported text position.
Strokes for lines and polygons has the same color as fill color.
preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent c7107493d4
commit 5bc2d5d1e8
  1. 3
      plugins/cffadaptor/src/UBCFFAdaptor.cpp
  2. 14
      src/adaptors/UBCFFSubsetAdaptor.cpp

@ -1794,6 +1794,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZPolygon(const QDomElement &element,
if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart))
{ {
svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill));
addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element));
if (0 < iwbElementPart.attributes().count()) if (0 < iwbElementPart.attributes().count())
@ -1827,6 +1828,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZPolyline(const QDomElement &element
if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart))
{ {
svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill));
addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element));
if (0 < iwbElementPart.attributes().count()) if (0 < iwbElementPart.attributes().count())
@ -1859,6 +1861,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZLine(const QDomElement &element, QM
if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart))
{ {
svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill));
addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element));
if (0 < iwbElementPart.attributes().count()) if (0 < iwbElementPart.attributes().count())

@ -547,7 +547,7 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::readTextCharAttr(const QDomElement &
{ {
QString fontSz = element.attribute(aFontSize); QString fontSz = element.attribute(aFontSize);
if (!fontSz.isNull()) { if (!fontSz.isNull()) {
qreal fontSize = fontSz.toDouble() * 72 / QApplication::desktop()->physicalDpiY(); qreal fontSize = fontSz.remove("pt").toDouble();
format.setFontPointSize(fontSize); format.setFontPointSize(fontSize);
} }
QString fontColorText = element.attribute(aFill); QString fontColorText = element.attribute(aFill);
@ -712,12 +712,14 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement &
blockFormat.setAlignment(Qt::AlignLeft); blockFormat.setAlignment(Qt::AlignLeft);
QTextCharFormat textFormat; QTextCharFormat textFormat;
textFormat.setFontPointSize(12 * 72 / QApplication::desktop()->physicalDpiY()); // default values
textFormat.setFontPointSize(12);
textFormat.setForeground(qApp->palette().foreground().color()); textFormat.setForeground(qApp->palette().foreground().color());
textFormat.setFontFamily("Arial"); textFormat.setFontFamily("Arial");
textFormat.setFontItalic(false); textFormat.setFontItalic(false);
textFormat.setFontWeight(QFont::Normal); textFormat.setFontWeight(QFont::Normal);
// readed values
readTextBlockAttr(element, blockFormat); readTextBlockAttr(element, blockFormat);
readTextCharAttr(element, textFormat); readTextCharAttr(element, textFormat);
@ -1140,7 +1142,13 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(QGraphicsItem *ite
QTransform tr = item->sceneTransform(); QTransform tr = item->sceneTransform();
item->setTransform(rTransform.scale(fullScaleX, fullScaleY), true); item->setTransform(rTransform.scale(fullScaleX, fullScaleY), true);
tr = item->sceneTransform(); tr = item->sceneTransform();
QPoint pos ((int)((x + mShiftVector.x() + (newVector - oldVector).x()) * mVBTransFactor), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor)); QPoint pos;
if (UBGraphicsTextItem::Type == item->type())
pos = QPoint((int)((x + mShiftVector.x() + (newVector - oldVector).x())), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor));
else
pos = QPoint((int)((x + mShiftVector.x() + (newVector - oldVector).x()) * mVBTransFactor), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor));
item->setPos(pos); item->setPos(pos);
} }

Loading…
Cancel
Save