Qt 4.8
Typedefs | Functions | Variables
qrawfont_win.cpp File Reference
#include "qrawfont_p.h"
#include <private/qsystemlibrary_p.h>
#include "qfontenginedirectwrite_p.h"
#include <dwrite.h>

Go to the source code of this file.

Typedefs

typedef HANDLE(WINAPI * PtrAddFontMemResourceEx) (PVOID, DWORD, PVOID, DWORD *)
 
typedef BOOL(WINAPI * PtrRemoveFontMemResourceEx) (HANDLE)
 

Functions

QFontEngineqt_load_font_engine_win (const QFontDef &request)
 
static void resolveGdi32 ()
 
QFont::Weight weightFromInteger (int weight)
 

Variables

static PtrAddFontMemResourceEx ptrAddFontMemResourceEx = 0
 
static PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx = 0
 

Typedef Documentation

◆ PtrAddFontMemResourceEx

typedef HANDLE(WINAPI * PtrAddFontMemResourceEx) (PVOID, DWORD, PVOID, DWORD *)

Definition at line 523 of file qrawfont_win.cpp.

◆ PtrRemoveFontMemResourceEx

typedef BOOL(WINAPI * PtrRemoveFontMemResourceEx) (HANDLE)

Definition at line 525 of file qrawfont_win.cpp.

Function Documentation

◆ qt_load_font_engine_win()

QFontEngine* qt_load_font_engine_win ( const QFontDef request)

Definition at line 998 of file qfontdatabase_win.cpp.

Referenced by resolveGdi32().

999 {
1000  // From qfont.cpp
1001  extern int qt_defaultDpi();
1002 
1005  if (fe != 0)
1006  return fe;
1007  else
1008  return loadEngine(QUnicodeTables::Common, request, 0, qt_defaultDpi(), false, 0,
1009  QStringList());
1010 }
static QFontCache * instance()
Definition: qfont.cpp:2919
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
static QFontEngine * loadEngine(int script, const QFontDef &request, HDC fontHdc, int dpi, bool rawMode, const QtFontDesc *desc, const QStringList &family_list)
Q_GUI_EXPORT int qt_defaultDpi()
Definition: qfont.cpp:240
int key
QFontEngine * findEngine(const Key &key)
Definition: qfont.cpp:3054

◆ resolveGdi32()

static void resolveGdi32 ( )
static

Definition at line 528 of file qrawfont_win.cpp.

529 {
530  static bool triedResolve = false;
531  if (!triedResolve) {
532  QSystemLibrary gdi32(QLatin1String("gdi32"));
533  if (gdi32.load()) {
534  ptrAddFontMemResourceEx = (PtrAddFontMemResourceEx)gdi32.resolve("AddFontMemResourceEx");
535  ptrRemoveFontMemResourceEx = (PtrRemoveFontMemResourceEx)gdi32.resolve("RemoveFontMemResourceEx");
536  }
537 
538  triedResolve = true;
539  }
540 }
static PtrAddFontMemResourceEx ptrAddFontMemResourceEx
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
BOOL(WINAPI * PtrRemoveFontMemResourceEx)(HANDLE)
HANDLE(WINAPI * PtrAddFontMemResourceEx)(PVOID, DWORD, PVOID, DWORD *)
static PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx

◆ weightFromInteger()

QFont::Weight weightFromInteger ( int  weight)

Definition at line 142 of file qfontdatabase.cpp.

Referenced by resolveGdi32().

143 {
144  if (weight < 400)
145  return QFont::Light;
146  else if (weight < 600)
147  return QFont::Normal;
148  else if (weight < 700)
149  return QFont::DemiBold;
150  else if (weight < 800)
151  return QFont::Bold;
152  else
153  return QFont::Black;
154 }

Variable Documentation

◆ ptrAddFontMemResourceEx

PtrAddFontMemResourceEx ptrAddFontMemResourceEx = 0
static

Definition at line 524 of file qrawfont_win.cpp.

Referenced by registerFont(), and resolveGdi32().

◆ ptrRemoveFontMemResourceEx

PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx = 0
static

Definition at line 526 of file qrawfont_win.cpp.

Referenced by registerFont(), and resolveGdi32().