Add initial directwrite to svg conversion.

This commit is contained in:
jmsgrogan 2023-01-10 17:24:37 +00:00
parent 2c825adc1d
commit b7f75f903e
15 changed files with 571 additions and 7 deletions

View file

@ -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;

View file

@ -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);
};

View file

@ -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));
}

View file

@ -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);
};