Add initial directwrite to svg conversion.
This commit is contained in:
parent
2c825adc1d
commit
b7f75f903e
15 changed files with 571 additions and 7 deletions
|
@ -17,7 +17,7 @@ SvgDocument::SvgDocument()
|
|||
setRoot(std::move(root));
|
||||
}
|
||||
|
||||
void SvgDocument::setViewBox(unsigned x, unsigned y, unsigned w, unsigned h)
|
||||
void SvgDocument::setViewBox(double x, double y, double w, double h)
|
||||
{
|
||||
auto viewbox = std::make_unique<XmlAttribute>("viewBox");
|
||||
std::stringstream sstr;
|
||||
|
|
|
@ -6,5 +6,5 @@ class SvgDocument : public XmlDocument
|
|||
{
|
||||
public:
|
||||
SvgDocument();
|
||||
void setViewBox(unsigned x, unsigned y, unsigned w, unsigned h);
|
||||
void setViewBox(double x, double y, double w, double h);
|
||||
};
|
||||
|
|
|
@ -104,3 +104,23 @@ void SvgPolyline::setPoints(const std::vector<DiscretePoint>& locs)
|
|||
addAttribute(std::move(points));
|
||||
}
|
||||
|
||||
|
||||
SvgPath::SvgPath()
|
||||
: SvgShapeElement("path")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SvgPath::setPath(const std::string& mPath)
|
||||
{
|
||||
auto path = std::make_unique<XmlAttribute>("d");
|
||||
path->setValue(mPath);
|
||||
addAttribute(std::move(path));
|
||||
}
|
||||
|
||||
void SvgPath::setFillRule(const std::string& fillRule)
|
||||
{
|
||||
auto rule = std::make_unique<XmlAttribute>("fill-rule");
|
||||
rule->setValue(fillRule);
|
||||
addAttribute(std::move(rule));
|
||||
}
|
||||
|
|
|
@ -42,3 +42,12 @@ public:
|
|||
|
||||
void setPoints(const std::vector<DiscretePoint>& loc);
|
||||
};
|
||||
|
||||
class SvgPath : public SvgShapeElement
|
||||
{
|
||||
public:
|
||||
SvgPath();
|
||||
|
||||
void setPath(const std::string& mPath);
|
||||
void setFillRule(const std::string& fillRule);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue