27 #include "../../../common/StringUtils.h" 28 #include "../../../maptools/Utils.h" 29 #include "../../../se/Mark.h" 43 m_brush.setStyle(Qt::SolidPattern);
59 font.setFamily(fontName);
60 font.setPixelSize(static_cast<int>(size));
63 QPainterPath charPath;
64 charPath.addText(0.0, 0.0, font, ch);
66 QRectF bounds = charPath.boundingRect();
67 double invMax = 1 / std::max(bounds.width(), bounds.height());
69 t.scale(invMax, invMax);
70 t.translate(-bounds.center().x(), -bounds.center().y());
71 charPath = t.map(charPath);
74 QImage* img =
new QImage(static_cast<int>(size), static_cast<int>(size), QImage::Format_ARGB32_Premultiplied);
75 img->fill(Qt::transparent);
93 std::vector<std::string>& )
const 100 result +=
"://" + font +
"#0x" + QString::number(charCode, 16);
107 QString pattern(name);
109 if(!pattern.contains(
"#"))
113 QStringList myParams = pattern.split(
"#", QString::SkipEmptyParts);
114 if(myParams.size() < 2)
118 bool wasConverted =
false;
120 charCode = myParams[1].toInt(&wasConverted, 0);
131 m_painter.setRenderHints(QPainter::Antialiasing);
148 double s = img->width() -
m_pen.width() - 1;
149 double t = img->width() * 0.5;
151 QTransform transform;
152 QPainterPath transformedPath = transform.translate(t, t).scale(s, s).map(path);
163 ch = charCode.toInt(&isOk, 0);
A concrete renderer based on Qt4 for conversion of Symbology Enconding Mark elements to an image patt...
A Mark specifies a geometric shape and applies coloring to it.
const std::string * getWellKnownName() const
const Stroke * getStroke() const
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
#define TE_SE_DEFAULT_FILL_BASIC_COLOR
It specifies the default color used by basic fill (solid colors).
#define TE_SE_DEFAULT_STROKE_BASIC_COLOR
It specifies the default color used by stroke basic (solid colors).
const Fill * getFill() const