Qt 4.8
Classes | Public Functions | Public Variables | List of all members
QtFontStyle Struct Reference

Classes

struct  Key
 

Public Functions

QtFontSizepixelSize (unsigned short size, bool=false)
 
 QtFontStyle (const Key &k)
 
 ~QtFontStyle ()
 

Public Variables

bool antialiased
 
bool bitmapScalable: 1
 
signed int count: 30
 
Key key
 
QtFontSizepixelSizes
 
const char * setwidthName
 
bool smoothScalable: 1
 
QString styleName
 
const char * weightName
 

Detailed Description

Definition at line 217 of file qfontdatabase.cpp.

Constructors and Destructors

◆ QtFontStyle()

QtFontStyle::QtFontStyle ( const Key k)
inline

Definition at line 242 of file qfontdatabase.cpp.

Referenced by QtFontFoundry::style().

243  : key(k), bitmapScalable(false), smoothScalable(false),
244  count(0), pixelSizes(0)
245  {
246 #if defined(Q_WS_X11)
247  weightName = setwidthName = 0;
248 #endif // Q_WS_X11
249  }
signed int count
const char * setwidthName
const char * weightName
QtFontSize * pixelSizes

◆ ~QtFontStyle()

QtFontStyle::~QtFontStyle ( )
inline

Definition at line 251 of file qfontdatabase.cpp.

251  {
252 #ifdef Q_WS_X11
253  delete [] weightName;
254  delete [] setwidthName;
255 #endif
256 #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_SYMBIAN)
257  while (count) {
258  // bitfield count-- in while condition does not work correctly in mwccsym2
259  count--;
260 #ifdef Q_WS_X11
261  free(pixelSizes[count].encodings);
262 #endif
263 #if defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
265 #endif
266 #if defined (Q_WS_QPA)
267  QPlatformIntegration *integration = QApplicationPrivate::platformIntegration();
268  if (integration) { //on shut down there will be some that we don't release.
269  integration->fontDatabase()->releaseHandle(pixelSizes[count].handle);
270  }
271 #endif
272  }
273 #endif
274  free(pixelSizes);
275  }
QByteArray fileName
signed int count
virtual QPlatformFontDatabase * fontDatabase() const
Accessor for the platform integrations fontdatabase.
~QByteArray()
Destroys the byte array.
Definition: qbytearray.h:401
const char * setwidthName
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
virtual void releaseHandle(void *handle)
Releases the font handle and deletes any associated data loaded from a file.
const char * weightName
QtFontSize * pixelSizes

Functions

◆ pixelSize()

QtFontSize * QtFontStyle::pixelSize ( unsigned short  size,
bool  add = false 
)

Definition at line 308 of file qfontdatabase.cpp.

Referenced by QFontDatabasePrivate::addFont(), addFontToDatabase(), findEncoding(), initializeDb(), loadFontConfig(), loadXlfds(), and qt_registerFont().

309 {
310  for (int i = 0; i < count; i++) {
311  if (pixelSizes[i].pixelSize == size)
312  return pixelSizes + i;
313  }
314  if (!add)
315  return 0;
316 
317  if (!pixelSizes) {
318  // Most style have only one font size, we avoid waisting memory
319  QtFontSize *newPixelSizes = (QtFontSize *)malloc(sizeof(QtFontSize));
320  Q_CHECK_PTR(newPixelSizes);
321  pixelSizes = newPixelSizes;
322  } else if (!(count % 8) || count == 1) {
323  QtFontSize *newPixelSizes = (QtFontSize *)
324  realloc(pixelSizes,
325  (((count+8) >> 3) << 3) * sizeof(QtFontSize));
326  Q_CHECK_PTR(newPixelSizes);
327  pixelSizes = newPixelSizes;
328  }
329  pixelSizes[count].pixelSize = size;
330 #ifdef Q_WS_X11
331  pixelSizes[count].count = 0;
333 #endif
334 #if defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
337 #endif
338 #if defined(Q_WS_QPA)
339  pixelSizes[count].handle = 0;
340 #endif
341  return pixelSizes + (count++);
342 }
unsigned short pixelSize
QByteArray fileName
#define add(aName)
signed int count
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_CHECK_PTR(p)
Definition: qglobal.h:1853
QtFontSize * pixelSize(unsigned short size, bool=false)
unsigned short count
QtFontEncoding * encodings
QtFontSize * pixelSizes

Properties

◆ antialiased

bool QtFontStyle::antialiased

◆ bitmapScalable

bool QtFontStyle::bitmapScalable

◆ count

signed int QtFontStyle::count

◆ key

Key QtFontStyle::key

◆ pixelSizes

QtFontSize* QtFontStyle::pixelSizes

◆ setwidthName

const char* QtFontStyle::setwidthName

Definition at line 286 of file qfontdatabase.cpp.

Referenced by initializeDb(), QFontDatabase::loadXlfd(), and loadXlfds().

◆ smoothScalable

bool QtFontStyle::smoothScalable

◆ styleName

QString QtFontStyle::styleName

◆ weightName

const char* QtFontStyle::weightName

Definition at line 285 of file qfontdatabase.cpp.

Referenced by initializeDb(), QFontDatabase::loadXlfd(), and loadXlfds().


The documentation for this struct was generated from the following file: