42 #if _WIN32_WINNT < 0x0500 44 #define _WIN32_WINNT 0x0500 51 #include <private/qapplication_p.h> 53 #include <private/qsystemlibrary_p.h> 62 #include <private/qunicodetables_p.h> 65 #include <private/qpainter_p.h> 68 #include <private/qpaintengine_raster_p.h> 69 #include <private/qnativeimage_p.h> 71 #if defined(Q_WS_WINCE) 76 #ifndef TT_PRIM_CSPLINE 77 #define TT_PRIM_CSPLINE 3 84 #define MAKE_TAG(ch1, ch2, ch3, ch4) (\ 85 (((quint32)(ch4)) << 24) | \ 86 (((quint32)(ch3)) << 16) | \ 87 (((quint32)(ch2)) << 8) | \ 102 _hdc = CreateCompatibleDC(displayDC);
103 ReleaseDC(0, displayDC);
120 QtHDC *&
hdc = local_shared_dc()->localData();
133 typedef BOOL (WINAPI *PtrGetCharWidthI)(HDC, UINT, UINT, LPWORD, LPINT);
134 static PtrGetCharWidthI ptrGetCharWidthI = 0;
135 static bool resolvedGetCharWidthI =
false;
137 static void resolveGetCharWidthI()
139 if (resolvedGetCharWidthI)
143 ptrGetCharWidthI = (PtrGetCharWidthI)gdi32.
resolve(
"GetCharWidthI");
145 resolvedGetCharWidthI =
true;
147 #endif // !defined(Q_WS_WINCE) 187 size = GetOutlineTextMetrics(hdc, 0, 0);
188 OUTLINETEXTMETRIC *otm = (OUTLINETEXTMETRIC *)malloc(size);
189 GetOutlineTextMetrics(hdc, size, otm);
195 ttf = (bool)(
tm.tmPitchAndFamily & TMPF_TRUETYPE);
197 SelectObject(hdc, hfont);
203 cmapTable.size(), &symb, &size);
214 designToDevice =
QFixed((
int)otm->otmEMSquare)/int(otm->otmTextMetrics.tmHeight);
215 unitsPerEm = otm->otmEMSquare;
216 x_height = (int)otm->otmsXHeight;
217 loadKerningPairs(designToDevice);
219 lineWidth = otm->otmsUnderscoreSize;
220 fsType = otm->otmfsType;
223 unitsPerEm =
tm.tmHeight;
231 if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) {
243 #if defined(Q_WS_WINCE) 247 for (; i < numChars; ++i, ++glyph_pos) {
248 unsigned int uc =
getChar(str, i, numChars);
249 glyphs->
glyphs[glyph_pos] = getTrueTypeGlyphIndex(
cmap, uc);
250 if (!glyphs->
glyphs[glyph_pos] && uc < 0x100)
251 glyphs->
glyphs[glyph_pos] = getTrueTypeGlyphIndex(
cmap, uc + 0xf000);
254 for (; i < numChars; ++i, ++glyph_pos) {
255 unsigned int uc =
getChar(str, i, numChars);
260 wchar_t first =
tm.tmFirstChar;
261 wchar_t last =
tm.tmLastChar;
263 for (; i < numChars; ++i, ++glyph_pos) {
267 tm.tmFirstChar > 60000 ||
269 ucs >= first && ucs <= last)
270 glyphs->
glyphs[glyph_pos] = ucs;
272 glyphs->
glyphs[glyph_pos] = 0;
276 #if defined(Q_WS_WINCE) 280 for (; i < numChars; ++i, ++glyph_pos) {
281 unsigned int uc =
getChar(str, i, numChars);
282 glyphs->
glyphs[i] = getTrueTypeGlyphIndex(
cmap, uc);
283 if(!glyphs->
glyphs[glyph_pos] && uc < 0x100)
284 glyphs->
glyphs[glyph_pos] = getTrueTypeGlyphIndex(
cmap, uc + 0xf000);
287 for (; i < numChars; ++i, ++glyph_pos) {
288 unsigned int uc =
getChar(str, i, numChars);
289 glyphs->
glyphs[glyph_pos] = getTrueTypeGlyphIndex(
cmap, uc);
293 wchar_t first =
tm.tmFirstChar;
294 wchar_t last =
tm.tmLastChar;
296 for (; i < numChars; ++i, ++glyph_pos) {
300 tm.tmFirstChar > 60000 ||
302 uc >= first && uc <= last)
303 glyphs->
glyphs[glyph_pos] = uc;
305 glyphs->
glyphs[glyph_pos] = 0;
324 SelectObject(hdc, hfont);
325 this->stockFont = stockFont;
326 fontDef.pixelSize = -lf.lfHeight;
330 synthesized_flags = -1;
334 BOOL res = GetTextMetrics(hdc, &
tm);
335 fontDef.fixedPitch = !(
tm.tmPitchAndFamily & TMPF_FIXED_PITCH);
338 ZeroMemory(&
tm,
sizeof(TEXTMETRIC));
341 cache_cost =
tm.tmHeight *
tm.tmAveCharWidth * 2000;
347 designAdvancesSize = 0;
350 if (!resolvedGetCharWidthI)
351 resolveGetCharWidthI();
358 free(designAdvances);
364 SelectObject(
shared_dc(), (HFONT)GetStockObject(SYSTEM_FONT));
367 if (!DeleteObject(hfont))
368 qErrnoWarning(
"QFontEngineWin: failed to delete non-stock font...");
375 f.lfHeight = unitsPerEm;
376 HFONT designFont = CreateFontIndirect(&f);
377 return SelectObject(
shared_dc(), designFont);
382 if (*nglyphs < len) {
392 recalcAdvances(glyphs, flags);
398 #if defined(Q_WS_WINCE) 399 GetCharWidth32(hdc, glyph, glyph, &width);
401 if (ptrGetCharWidthI)
402 ptrGetCharWidthI(hdc, glyph, 1, 0, &width);
411 for(
int i = 0; i < glyphs->
numGlyphs; i++) {
412 unsigned int glyph = glyphs->
glyphs[i];
413 if(
int(glyph) >= designAdvancesSize) {
414 int newSize = (glyph + 256) >> 8 << 8;
417 for(
int i = designAdvancesSize; i < newSize; ++i)
418 designAdvances[i] = -1000000;
419 designAdvancesSize = newSize;
421 if (designAdvances[glyph] < -999999) {
423 oldFont = selectDesignFont();
427 designAdvances[glyph] =
QFixed(width) / designToDevice;
429 glyphs->
advances_x[i] = designAdvances[glyph];
433 DeleteObject(SelectObject(hdc, oldFont));
435 for(
int i = 0; i < glyphs->
numGlyphs; i++) {
436 unsigned int glyph = glyphs->
glyphs[i];
440 if (glyph >= widthCacheSize) {
441 int newSize = (glyph + 256) >> 8 << 8;
442 widthCache =
q_check_ptr((
unsigned char *)realloc(widthCache,
444 memset(widthCache + widthCacheSize, 0, newSize - widthCacheSize);
445 widthCacheSize = newSize;
452 oldFont = SelectObject(hdc, hfont);
457 if (glyph > 0xffff) {
463 GetTextExtentPoint32(hdc, (
wchar_t *)ch, chrLen, &size);
470 if (width > 0 && width < 0x100)
471 widthCache[glyph] = width;
476 SelectObject(hdc, oldFont);
486 for (
int i = 0; i < glyphs.
numGlyphs; ++i)
513 xform.eM11 = t.
m11();
514 xform.eM12 = t.
m12();
515 xform.eM21 = t.
m21();
516 xform.eM22 = t.
m22();
519 SetGraphicsMode(hdc, GM_ADVANCED);
520 SetWorldTransform(hdc, &xform);
526 res = GetGlyphOutline(hdc, glyph, format, &gm, 0, 0, &mat);
530 xform.eM11 = xform.eM22 = 1;
531 xform.eM12 = xform.eM21 = xform.eDx = xform.eDy = 0;
532 SetWorldTransform(hdc, &xform);
533 SetGraphicsMode(hdc, GM_COMPATIBLE);
536 if (res != GDI_ERROR) {
550 SelectObject(hdc, hfont);
553 bool success = getOutlineMetrics(glyph, t, &glyphMetrics);
555 if (!ttf && !success) {
559 GetCharABCWidthsFloat(hdc, ch, ch, &abc);
560 int width =
qRound(abc.abcfB);
568 HGDIOBJ oldFont = SelectObject(hdc, hfont);
573 #ifdef GWES_MGTT // true type fonts 574 if (GetCharABCWidths(hdc, glyph, glyph, &abc)) {
575 width =
qAbs(abc.abcA) + abc.abcB +
qAbs(abc.abcC);
576 advance = abc.abcA + abc.abcB + abc.abcC;
580 #if defined(GWES_MGRAST) || defined(GWES_MGRAST2) // raster fonts 581 if (GetCharWidth32(hdc, glyph, glyph, &width)) {
587 width =
tm.tmMaxCharWidth;
591 SelectObject(hdc, oldFont);
605 return tm.tmDescent - 1;
610 return tm.tmExternalLeading;
623 return tm.tmAveCharWidth;
628 return tm.tmMaxCharWidth;
660 SelectObject(hdc, hfont);
668 GetCharABCWidthsI(hdc, glyph, 1, 0, &abcWidths);
670 *leftBearing = abcWidths.abcA;
672 *rightBearing = abcWidths.abcC;
685 if (lbearing == SHRT_MIN)
694 if (rbearing == SHRT_MIN) {
698 SelectObject(hdc, hfont);
701 int n =
tm.tmLastChar -
tm.tmFirstChar;
704 GetCharABCWidths(hdc,
tm.tmFirstChar,
tm.tmLastChar, abc);
706 abc =
new ABC[char_table_entries+1];
708 GetCharABCWidths(hdc, char_table[i], char_table[i], abc+i);
713 for (
int i = 1; i < n; i++) {
714 if (abc[i].abcA + abc[i].abcB + abc[i].abcC != 0) {
715 ml =
qMin(ml,abc[i].abcA);
716 mr =
qMin(mr,abc[i].abcC);
727 if (rbearing == SHRT_MIN) {
731 SelectObject(hdc, hfont);
734 int n =
tm.tmLastChar -
tm.tmFirstChar;
737 GetCharABCWidths(hdc,
tm.tmFirstChar,
tm.tmLastChar, abc);
739 abc =
new ABC[char_table_entries+1];
741 GetCharABCWidths(hdc, char_table[i], char_table[i], abc + i);
746 for (
int i = 1; i < n; i++) {
747 if (abc[i].abcA + abc[i].abcB + abc[i].abcC != 0) {
748 ml =
qMin(ml,abc[i].abcA);
749 mr =
qMin(mr,abc[i].abcC);
755 int n =
tm.tmLastChar -
tm.tmFirstChar+1;
757 abc =
new ABCFLOAT[n];
758 GetCharABCWidthsFloat(hdc,
tm.tmFirstChar,
tm.tmLastChar, abc);
762 GetCharABCWidthsFloat(hdc, char_table[i], char_table[i], abc+i);
765 float fml = abc[0].abcfA;
766 float fmr = abc[0].abcfC;
767 for (
int i=1; i<n; i++) {
768 if (abc[i].abcfA + abc[i].abcfB + abc[i].abcfC != 0) {
769 fml =
qMin(fml,abc[i].abcfA);
770 fmr =
qMin(fmr,abc[i].abcfC);
773 ml = int(fml - 0.9999);
774 mr = int(fmr - 0.9999);
794 for (
int i = 0; i < len; ++i) {
795 unsigned int uc =
getChar(
string, i, len);
796 if (getTrueTypeGlyphIndex(
cmap, uc) == 0) {
798 if (getTrueTypeGlyphIndex(
cmap, uc + 0xf000) == 0)
806 for (
int i = 0; i < len; ++i) {
807 unsigned int uc =
getChar(
string, i, len);
808 if (getTrueTypeGlyphIndex(
cmap, uc) == 0)
813 if (
tm.tmFirstChar > string->
unicode() ||
tm.tmLastChar <
string->unicode())
834 #define GGO_UNHINTED 0x0100 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;
947 LOGFONT lf = logfont;
952 lf.lfHeight = -unitsPerEm;
954 HFONT hf = CreateFontIndirect(&lf);
956 HGDIOBJ oldfont = SelectObject(hdc, hf);
958 for(
int i = 0; i < nglyphs; ++i) {
960 qreal(fontDef.pixelSize) / unitsPerEm)) {
969 DeleteObject(SelectObject(hdc, oldfont));
975 #if !defined(Q_WS_WINCE) 976 if(
tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) {
1001 if(synthesized_flags == -1) {
1002 synthesized_flags = 0;
1004 const DWORD HEAD =
MAKE_TAG(
'h',
'e',
'a',
'd');
1006 SelectObject(hdc, hfont);
1008 GetFontData(hdc, HEAD, 44, &data, 4);
1010 if (
tm.tmItalic && !(macStyle & 2))
1011 synthesized_flags = SynthesizedItalic;
1012 if (fontDef.stretch != 100 && ttf)
1013 synthesized_flags |= SynthesizedStretch;
1014 if (
tm.tmWeight >= 500 && !(macStyle & 1))
1015 synthesized_flags |= SynthesizedBold;
1020 return synthesized_flags;
1030 LOGFONT lf = logfont;
1031 lf.lfHeight = unitsPerEm;
1032 HFONT hf = CreateFontIndirect(&lf);
1034 HGDIOBJ oldfont = SelectObject(hdc, hf);
1043 otm->otmrcFontBox.right - otm->otmrcFontBox.left,
1044 otm->otmrcFontBox.top - otm->otmrcFontBox.bottom);
1045 p.
ascent = otm->otmAscent;
1047 p.
leading = (int)otm->otmLineGap;
1051 DeleteObject(SelectObject(hdc, oldfont));
1057 LOGFONT lf = logfont;
1058 lf.lfHeight = unitsPerEm;
1059 int flags = synthesized();
1060 if(flags & SynthesizedItalic)
1061 lf.lfItalic =
false;
1063 HFONT hf = CreateFontIndirect(&lf);
1065 HGDIOBJ oldfont = SelectObject(hdc, hf);
1070 DeleteObject(SelectObject(hdc, oldfont));
1078 SelectObject(hdc, hfont);
1080 *length = GetFontData(hdc, t, 0, buffer, *length);
1081 return *length != GDI_ERROR;
1084 #if !defined(CLEARTYPE_QUALITY) 1085 # define CLEARTYPE_QUALITY 5 1103 if (iw <= 0 || iw <= 0)
1112 if (has_transformation) {
1113 xform.eM11 = t.
m11();
1114 xform.eM12 = t.
m12();
1115 xform.eM21 = t.
m21();
1116 xform.eM22 = t.
m22();
1121 HDC hdc = qthdc.
hdc();
1123 SetGraphicsMode(hdc, GM_ADVANCED);
1124 SetWorldTransform(hdc, &xform);
1125 HGDIOBJ old_font = SelectObject(hdc, font);
1130 memset(&mat, 0,
sizeof(mat));
1133 if (GetGlyphOutline(hdc, glyph, ggo_options, &tgm, 0, 0, &mat) == GDI_ERROR) {
1134 qWarning(
"QWinFontEngine: unable to query transformed glyph metrics...");
1144 SetGraphicsMode(hdc, GM_COMPATIBLE);
1145 SelectObject(hdc, old_font);
1148 unsigned int options = 0;
1157 ih + 2 * margin + 4,
1167 SelectObject(hdc, GetStockObject(NULL_BRUSH));
1168 SelectObject(hdc, GetStockObject(BLACK_PEN));
1169 SetTextColor(hdc, RGB(0,0,0));
1170 SetBkMode(hdc, TRANSPARENT);
1171 SetTextAlign(hdc, TA_BASELINE);
1173 HGDIOBJ old_font = SelectObject(hdc, font);
1176 if (has_transformation) {
1177 SetGraphicsMode(hdc, GM_ADVANCED);
1178 SetWorldTransform(hdc, &xform);
1179 ExtTextOut(hdc, 0, 0, options, 0, (LPCWSTR) &glyph, 1, 0);
1183 ExtTextOut(hdc, -gx + margin, -gy + margin, options, 0, (LPCWSTR) &glyph, 1, 0);
1186 SelectObject(hdc, old_font);
1196 if (qt_cleartype_enabled) {
1197 LOGFONT lf = logfont;
1198 lf.lfQuality = ANTIALIASED_QUALITY;
1199 font = CreateFontIndirect(&lf);
1206 QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform, mask_format);
1215 for (
int i=0; i<256; ++i)
1216 colors[i] =
qRgba(0, 0, 0, i);
1217 indexed.setColorTable(colors);
1221 for (
int y=0; y<mask->
height(); ++y) {
1222 uchar *dest = indexed.scanLine(y);
1225 for (
int x=0; x<mask->
width(); ++x)
1226 dest[x] = 255 -
qGray(src[x]);
1229 for (
int x=0; x<mask->
width(); ++x) {
1231 dest[x] = 255 -
qGray(src[x]);
1234 dest[x] = 255 -
qGray(src[x]);
1236 dest[x] = 255 - (qt_pow_gamma[
qGray(src[x])] * 255. / 2047.);
1244 if (qt_cleartype_enabled) {
1251 #define SPI_GETFONTSMOOTHINGCONTRAST 0x200C 1252 #define SPI_SETFONTSMOOTHINGCONTRAST 0x200D 1274 for (
int y=0; y<mask->
height(); ++y) {
1277 for (
int x=0; x<mask->
width(); ++x) {
1278 dest[x] = 0xffffffff - (0x00ffffff & src[x]);
1293 if (!uniqueFamilyName.isEmpty())
1294 request.
family = uniqueFamilyName;
1297 QFontEngine *fontEngine = qt_load_font_engine_win(request);
1298 if (fontEngine != NULL)
1308 fallbacks(fallbacks)
1324 memcpy(lf.lfFaceName, fam.utf16(),
sizeof(wchar_t) *
qMin(fam.length() + 1, 32));
1325 HFONT hfont = CreateFontIndirect(&lf);
1327 bool stockFont =
false;
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
virtual QFixed lineThickness() const
The QPainterPath::Element class specifies the position and type of a subpath.
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
virtual qreal minRightBearing() const
Format
The following image formats are available in Qt.
static double qt_fixed_to_double(const FIXED &p)
static QPointF qt_to_qpointf(const POINTFX &pt, qreal scale)
static const ushort char_table[]
QIntegerForSizeof< void * >::Unsigned quintptr
virtual QFixed lineThickness() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
virtual QFixed ascent() const
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
bool canRender(const QChar *string, int len)
#define at(className, varName)
void fill(uint pixel)
Fills the entire image with the given pixelValue.
virtual QImage alphaMapForGlyph(glyph_t t)
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
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 ...
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
static const uchar * getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
virtual QFixed descent() const
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QImage::Format systemFormat()
static quint16 getUShort(unsigned char *p)
bool ref()
Atomically increments the value of this QAtomicInt.
virtual qreal minLeftBearing() const
qreal y
the y coordinate of the element's position.
The QString class provides a Unicode character string.
static QFixed fromReal(qreal r)
Q_DECL_CONSTEXPR T qAbs(const T &t)
QFontEngineMultiWin(QFontEngine *first, const QStringList &fallbacks)
The QChar class provides a 16-bit Unicode character.
#define SIZE(large, small, mini)
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.
Format format() const
Returns the format of the image.
HGDIOBJ selectDesignFont() const
virtual QFixed xHeight() const
qreal x() const
Returns the x-coordinate of this point.
static ushort highSurrogate(uint ucs4)
Returns the high surrogate value of a ucs4 code point.
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
static ushort lowSurrogate(uint ucs4)
Returns the low surrogate value of a ucs4 code point.
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags) const
struct tagTTPOLYCURVE TTPOLYCURVE
#define MAKE_TAG(ch1, ch2, ch3, ch4)
#define SPI_SETFONTSMOOTHINGCONTRAST
#define QT_BEGIN_NAMESPACE
This macro expands to.
glyph_metrics_t transformed(const QTransform &xform) const
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
The QRectF class defines a rectangle in the plane using floating point precision. ...
virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform)
virtual QFixed leading() const
static const int char_table_entries
static float pixelSize(const QFontDef &request, int dpi)
QNativeImage * drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, QImage::Format mask_format)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
QChar mirroredChar() const
Returns the mirrored character if this character is a mirrored character; otherwise returns the chara...
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
virtual const char * name() const
static const char * data(const QByteArray &arr)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
int depth() const
Returns the depth of the image.
virtual QFixed averageCharWidth() const
static quint32 getUInt(unsigned char *p)
void calculateTTFGlyphWidth(HDC hdc, UINT glyph, int &width)
const T & at(int i) const
Returns the item at index position i in the vector.
virtual QFixed xHeight() const
QVector< QFontEngine * > engines
QByteArray postscriptName
unsigned int getChar(const QChar *str, int &i, const int len)
QFontEngineWin(const QString &name, HFONT, bool, LOGFONT)
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
HRESULT(WINAPI * fScriptFreeCache)(SCRIPT_CACHE *)
void * resolve(const char *symbol)
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
struct tagTTPOLYGONHEADER TTPOLYGONHEADER
fScriptFreeCache ScriptFreeCache
#define SPI_GETFONTSMOOTHINGCONTRAST
virtual qreal maxCharWidth() const
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily)
static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc, QPainterPath *path, bool ttf, glyph_metrics_t *metric=0, qreal scale=1)
int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const
virtual QFixed emSquareSize() const
virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const
static uint surrogateToUcs4(ushort high, ushort low)
Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point...
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...
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
QFixed effectiveAdvance(int item) const
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
static OUTLINETEXTMETRIC * getOutlineTextMetric(HDC hdc)
int elementCount() const
Returns the number of path elements in the painter path.
QFontEngine * qt_load_font_engine_win(const QFontDef &request)
quint32 qbswap< quint32 >(quint32 source)
virtual QFontEngine * cloneWithSize(qreal pixelSize) const
virtual Properties properties() const
virtual int synthesized() const
The QThreadStorage class provides per-thread data storage.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
struct tagPOINTFX POINTFX
void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
Q_DECL_CONSTEXPR int qRound(qreal d)
virtual FaceId faceId() const
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
bool qt_cleartype_enabled
void qErrnoWarning(const char *msg,...)