|
Krita Source Code Documentation
|
Implements exporting shapes to SVG. More...
#include <SvgWriter.h>
Public Member Functions | |
| bool | save (const QString &filename, const QSizeF &pageSize, bool writeInlineImages) |
| Writes svg to the specified file. | |
| bool | save (QIODevice &outputDevice, const QSizeF &pageSize) |
| Writes svg to specified output device. | |
| bool | saveDetached (QIODevice &outputDevice) |
| bool | saveDetached (SvgSavingContext &savingContext) |
| void | setDocumentDescription (QString description) |
| void | setDocumentTitle (QString title) |
| SvgWriter (const QList< KoShape * > &toplevelShapes) | |
| Creates svg writer to export specified shapes. | |
| SvgWriter (const QList< KoShapeLayer * > &layers) | |
| Creates svg writer to export specified layers. | |
| virtual | ~SvgWriter () |
| Destroys the svg writer. | |
Private Member Functions | |
| void | saveGeneric (KoShape *shape, SvgSavingContext &context) |
| void | saveGroup (KoShapeGroup *group, SvgSavingContext &context) |
| void | saveLayer (KoShapeLayer *layer, SvgSavingContext &context) |
| void | savePath (KoPathShape *path, SvgSavingContext &context) |
| void | saveShape (KoShape *shape, SvgSavingContext &context) |
| void | saveShapes (const QList< KoShape * > shapes, SvgSavingContext &savingContext) |
Private Attributes | |
| QString | m_documentDescription |
| QString | m_documentTitle |
| QList< KoShape * > | m_toplevelShapes |
| bool | m_writeInlineImages |
Implements exporting shapes to SVG.
Definition at line 32 of file SvgWriter.h.
| SvgWriter::SvgWriter | ( | const QList< KoShapeLayer * > & | layers | ) |
Creates svg writer to export specified layers.
Definition at line 47 of file SvgWriter.cpp.
References m_toplevelShapes.
Creates svg writer to export specified shapes.
Definition at line 54 of file SvgWriter.cpp.
|
virtual |
| bool SvgWriter::save | ( | const QString & | filename, |
| const QSizeF & | pageSize, | ||
| bool | writeInlineImages ) |
Writes svg to the specified file.
Definition at line 65 of file SvgWriter.cpp.
References m_writeInlineImages, and save().
| bool SvgWriter::save | ( | QIODevice & | outputDevice, |
| const QSizeF & | pageSize ) |
Writes svg to specified output device.
Definition at line 82 of file SvgWriter.cpp.
References KoXmlNS::krita, m_documentDescription, m_documentTitle, m_toplevelShapes, m_writeInlineImages, saveShapes(), and KisPortingUtils::setUtf8OnStream().
| bool SvgWriter::saveDetached | ( | QIODevice & | outputDevice | ) |
Definition at line 129 of file SvgWriter.cpp.
References m_toplevelShapes, m_writeInlineImages, and saveShapes().
| bool SvgWriter::saveDetached | ( | SvgSavingContext & | savingContext | ) |
Definition at line 140 of file SvgWriter.cpp.
References m_toplevelShapes, and saveShapes().
|
private |
HACK ALERT: Qt (and Krita 3.x) has a weird bug, it assumes that all font sizes are defined in 96 ppi resolution, even though your the resolution in QSvgGenerator is manually set to 72 ppi. So here we do a tricky thing: we set a fake resolution to (72 * 72 / 96) = 54 ppi, which guarantees that the text, when painted in 96 ppi, will be actually painted in 72 ppi.
BUG: 389802
Definition at line 242 of file SvgWriter.cpp.
References KoShape::boundingRect(), SvgSavingContext::getID(), KIS_SAFE_ASSERT_RECOVER_RETURN, KoShapePainter::paint(), SvgSavingContext::saveImage(), KoShapePainter::setShapes(), KoShape::shapeId(), SvgSavingContext::shapeWriter, and SvgUtil::toUserSpace().
|
private |
Definition at line 186 of file SvgWriter.cpp.
References KoShape::compareShapeZIndex(), SvgSavingContext::getID(), saveGroup(), SvgStyleWriter::saveMetadata(), saveShape(), SvgStyleWriter::saveSvgStyle(), KoShapeContainer::shapes(), SvgSavingContext::shapeWriter, KoShape::transformation(), and SvgUtil::writeTransformAttributeLazy().
|
private |
Definition at line 167 of file SvgWriter.cpp.
References KoShape::compareShapeZIndex(), SvgSavingContext::getID(), saveGroup(), saveShape(), KoShapeContainer::shapes(), and SvgSavingContext::shapeWriter.
|
private |
Definition at line 227 of file SvgWriter.cpp.
References SvgSavingContext::getID(), SvgStyleWriter::saveMetadata(), SvgStyleWriter::saveSvgStyle(), SvgSavingContext::shapeWriter, SvgSavingContext::userSpaceTransform(), and SvgUtil::writeTransformAttributeLazy().
|
private |
Definition at line 212 of file SvgWriter.cpp.
References saveGeneric(), savePath(), and SvgShape::saveSvg().
|
private |
Definition at line 150 of file SvgWriter.cpp.
References saveGroup(), saveLayer(), and saveShape().
| void SvgWriter::setDocumentDescription | ( | QString | description | ) |
Definition at line 310 of file SvgWriter.cpp.
References m_documentDescription.
| void SvgWriter::setDocumentTitle | ( | QString | title | ) |
Definition at line 305 of file SvgWriter.cpp.
References m_documentTitle.
|
private |
Definition at line 69 of file SvgWriter.h.
|
private |
Definition at line 68 of file SvgWriter.h.
Definition at line 66 of file SvgWriter.h.
|
private |
Definition at line 67 of file SvgWriter.h.