840 #if defined(Q_WS_WINCE) 856 int bufferSize = GDI_ERROR;
857 #if !defined(Q_WS_WINCE) 858 bufferSize = GetGlyphOutline(hdc, glyph, glyphFormat, &gMetric, 0, 0, &mat);
860 if ((DWORD)bufferSize == GDI_ERROR) {
864 void *dataBuffer =
new char[bufferSize];
865 DWORD ret = GDI_ERROR;
866 #if !defined(Q_WS_WINCE) 867 ret = GetGlyphOutline(hdc, glyph, glyphFormat, &gMetric, bufferSize, dataBuffer, &mat);
869 if (ret == GDI_ERROR) {
870 delete [](
char *)dataBuffer;
882 int headerOffset = 0;
886 while (headerOffset < bufferSize) {
890 path->
moveTo(lastPoint + oset);
893 while (offset<
int(headerOffset + ttph->
cb)) {
894 curve = (
TTPOLYCURVE*)((
char*)(dataBuffer) + offset);
895 switch (curve->
wType) {
897 for (
int i=0; i<curve->
cpfx; ++i) {
907 for (
int i=0; i<curve->
cpfx - 1; ++i) {
910 if (i < curve->cpfx - 2) {
911 endPoint =
QPointF((p1.
x() + p2.
x()) / 2, (p1.
y() + p2.
y()) / 2);
916 path->
quadTo(p1, endPoint);
923 for (
int i=0; i<curve->
cpfx; ) {
932 qWarning(
"QFontEngineWin::addOutlineToPath, unhandled switch case");
937 headerOffset += ttph->
cb;
939 delete [] (
char*)dataBuffer;
The QPainterPath::Element class specifies the position and type of a subpath.
static QPointF qt_to_qpointf(const POINTFX &pt, qreal scale)
The QPointF class defines a point in the plane using floating point precision.
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
qreal y
the y coordinate of the element's position.
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
qreal x() const
Returns the x-coordinate of this point.
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
struct tagTTPOLYCURVE TTPOLYCURVE
Q_CORE_EXPORT void qWarning(const char *,...)
struct tagTTPOLYGONHEADER TTPOLYGONHEADER
void quadTo(const QPointF &ctrlPt, const QPointF &endPt)
Adds a quadratic Bezier curve between the current position and the given endPoint with the control po...
qreal x
the x coordinate of the element's position.
qreal y() const
Returns the y-coordinate of this point.
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
Adds a cubic Bezier curve between the current position and the given endPoint using the control point...
int elementCount() const
Returns the number of path elements in the painter path.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
struct tagPOINTFX POINTFX