Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QRawFontPrivate Class Reference

#include <qrawfont_p.h>

Public Functions

void cleanUp ()
 
bool isValid () const
 
void platformCleanUp ()
 
void platformLoadFromData (const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
 
 QRawFontPrivate ()
 
 QRawFontPrivate (const QRawFontPrivate &other)
 
 ~QRawFontPrivate ()
 

Static Public Functions

static QRawFontPrivateget (const QRawFont &font)
 

Public Variables

QFontEnginefontEngine
 
HANDLE fontHandle
 
QFont::HintingPreference hintingPreference
 
QAtomicInt ref
 
QThreadthread
 

Detailed Description

Definition at line 67 of file qrawfont_p.h.

Constructors and Destructors

◆ QRawFontPrivate() [1/2]

QRawFontPrivate::QRawFontPrivate ( )
inline

Definition at line 70 of file qrawfont_p.h.

71  : fontEngine(0)
73  , thread(0)
74 #if defined(Q_WS_WIN)
75  , fontHandle(NULL)
76 #endif
77  {}
HANDLE fontHandle
Definition: qrawfont_p.h:117
QFont::HintingPreference hintingPreference
Definition: qrawfont_p.h:112
QFontEngine * fontEngine
Definition: qrawfont_p.h:111
QThread * thread
Definition: qrawfont_p.h:113

◆ QRawFontPrivate() [2/2]

QRawFontPrivate::QRawFontPrivate ( const QRawFontPrivate other)
inline

Definition at line 79 of file qrawfont_p.h.

80  : fontEngine(other.fontEngine)
82  , thread(other.thread)
83 #if defined(Q_WS_WIN)
84  , fontHandle(NULL)
85 #endif
86  {
87  if (fontEngine != 0)
88  fontEngine->ref.ref();
89  }
QAtomicInt ref
bool ref()
Atomically increments the value of this QAtomicInt.
HANDLE fontHandle
Definition: qrawfont_p.h:117
QFont::HintingPreference hintingPreference
Definition: qrawfont_p.h:112
QFontEngine * fontEngine
Definition: qrawfont_p.h:111
QThread * thread
Definition: qrawfont_p.h:113

◆ ~QRawFontPrivate()

QRawFontPrivate::~QRawFontPrivate ( )
inline

Definition at line 91 of file qrawfont_p.h.

92  {
93  Q_ASSERT(ref == 0);
94  cleanUp();
95  }
QAtomicInt ref
Definition: qrawfont_p.h:114
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ cleanUp()

void QRawFontPrivate::cleanUp ( )
Warning
This function is not part of the public interface.

Definition at line 705 of file qrawfont.cpp.

Referenced by QRawFont::loadFromData().

706 {
707  platformCleanUp();
708  if (fontEngine != 0) {
709  fontEngine->ref.deref();
710  if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
711  delete fontEngine;
712  fontEngine = 0;
713  }
715 }
QAtomicInt ref
bool deref()
Atomically decrements the value of this QAtomicInt.
void platformCleanUp()
Definition: qrawfont_ft.cpp:98
QFont::HintingPreference hintingPreference
Definition: qrawfont_p.h:112
QFontEngine * fontEngine
Definition: qrawfont_p.h:111

◆ get()

static QRawFontPrivate* QRawFontPrivate::get ( const QRawFont font)
inlinestatic

Definition at line 109 of file qrawfont_p.h.

Referenced by QPainter::drawGlyphRun(), QPainterPrivate::drawGlyphs(), QTextLine::glyphs(), and QPainterReplayer::process().

109 { return font.d.data(); }
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
QExplicitlySharedDataPointer< QRawFontPrivate > d
Definition: qrawfont.h:138

◆ isValid()

bool QRawFontPrivate::isValid ( ) const
inline

◆ platformCleanUp()

void QRawFontPrivate::platformCleanUp ( )

Definition at line 98 of file qrawfont_ft.cpp.

Referenced by resolveGdi32().

99 {
100  // Font engine handles all resources
101 }

◆ platformLoadFromData()

void QRawFontPrivate::platformLoadFromData ( const QByteArray fontData,
qreal  pixelSize,
QFont::HintingPreference  hintingPreference 
)

Definition at line 103 of file qrawfont_ft.cpp.

Referenced by QRawFont::loadFromData(), releaseFontData(), and resolveGdi32().

105 {
106  Q_ASSERT(fontEngine == 0);
107 
108  QFontDef fontDef;
109  fontDef.pixelSize = pixelSize;
110 
111  QFontEngineFTRawFont *fe = new QFontEngineFTRawFont(fontDef);
112  if (!fe->initFromData(fontData)) {
113  delete fe;
114  return;
115  }
116 
118 
119  switch (hintingPreference) {
122  break;
125  break;
128  break;
129  default:
130  // Leave it as it is
131  break;
132  }
133 
134  fontEngine = fe;
135  fontEngine->ref.ref();
136 }
QAtomicInt ref
bool ref()
Atomically increments the value of this QAtomicInt.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool initFromData(const QByteArray &fontData)
Definition: qrawfont_ft.cpp:86
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
void updateFamilyNameAndStyle()
Definition: qrawfont_ft.cpp:75
qreal pixelSize
Definition: qfont_p.h:90
void setDefaultHintStyle(HintStyle style)
QFont::HintingPreference hintingPreference
Definition: qrawfont_p.h:112
QFontEngine * fontEngine
Definition: qrawfont_p.h:111

Properties

◆ fontEngine

QFontEngine* QRawFontPrivate::fontEngine

◆ fontHandle

HANDLE QRawFontPrivate::fontHandle

Definition at line 117 of file qrawfont_p.h.

◆ hintingPreference

QFont::HintingPreference QRawFontPrivate::hintingPreference

◆ ref

QAtomicInt QRawFontPrivate::ref

Definition at line 114 of file qrawfont_p.h.

◆ thread

QThread* QRawFontPrivate::thread

Definition at line 113 of file qrawfont_p.h.

Referenced by QRawFont::loadFromData().


The documentation for this class was generated from the following files: