Qt 4.8
Classes | Functions
qplatformfontdatabase_qpa.cpp File Reference
#include "qplatformfontdatabase_qpa.h"
#include <QtGui/private/qfontengine_p.h>
#include <QtGui/private/qfontengine_qpa_p.h>
#include <QtCore/QLibraryInfo>
#include <QtCore/QDir>

Go to the source code of this file.

Classes

class  QWritingSystemsPrivate
 

Functions

void qt_registerFont (const QString &familyname, const QString &foundryname, int weight, QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, const QSupportedWritingSystems &writingSystems, void *hanlde)
 

Function Documentation

◆ qt_registerFont()

void qt_registerFont ( const QString familyname,
const QString foundryname,
int  weight,
QFont::Style  style,
int  stretch,
bool  antialiased,
bool  scalable,
int  pixelSize,
const QSupportedWritingSystems writingSystems,
void *  hanlde 
)

Definition at line 55 of file qfontdatabase_qpa.cpp.

Referenced by QPlatformFontDatabase::registerFont().

58 {
59  QFontDatabasePrivate *d = privateDb();
60  // qDebug() << "Adding font" << familyname << weight << italic << pixelSize << file << fileIndex << antialiased;
61  QtFontStyle::Key styleKey;
62  styleKey.style = style;
63  styleKey.weight = weight;
64  styleKey.stretch = stretch;
65  QtFontFamily *f = d->family(familyName, true);
66 
67  for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) {
68  if (writingSystems.supported(QFontDatabase::WritingSystem(i))) {
70  } else {
72  }
73  }
74 
75  QtFontFoundry *foundry = f->foundry(foundryname, true);
76  QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true);
77  fontStyle->smoothScalable = scalable;
78  fontStyle->antialiased = antialiased;
79  QtFontSize *size = fontStyle->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
80  size->handle = handle;
81 }
double d
Definition: qnumeric_p.h:62
QtFontStyle * style(const QtFontStyle::Key &, const QString &=QString(), bool=false)
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool supported(QFontDatabase::WritingSystem) const
Returns true if the writing system given by writingSystem is supported; otherwise returns false...
#define SMOOTH_SCALABLE
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
QtFontFamily * family(const QString &f, bool=false)
unsigned char writingSystems[QFontDatabase::WritingSystemsCount]
QtFontSize * pixelSize(unsigned short size, bool=false)
QtFontFoundry * foundry(const QString &f, bool=false)