286 if (!db || db->
count)
290 #ifndef QT_FONTS_ARE_RESOURCES 294 qFatal(
"QFontDatabase: Cannot find font directory %s - is Qt installed correctly?",
326 char isitalic[10]=
"";
329 fgets(buf,200,fontdef);
333 sscanf(buf,
"%s %s %s %s %d %d %s",name,file,render,isitalic,&weight,&size,flags);
338 bool italic = isitalic[0] ==
'y';
343 }
while (!feof(fontdef));
349 for (
int i=0; i<int(dir.count()); i++) {
357 int pixelSize = dir[i].mid(u0+1,u1-u0-1).toInt()/10;
359 int weight = dir[i].mid(u1+1,u2-u1-1-(italic?1:0)).toInt();
365 #ifndef QT_NO_FREETYPE 370 for (
int i = 0; i < int(dir.count()); ++i) {
377 #ifndef QT_NO_QWS_QPF2 380 for (
int i = 0; i < int(dir.count()); ++i) {
387 #else //QT_FONTS_ARE_RESOURCES 388 #ifdef QFONTDATABASE_DEBUG 391 FriendlyResource *fr =
static_cast<FriendlyResource*
>(&fontdir);
392 qDebug() <<
"fontdir" << fr->isValid() << fr->isDir() << fr->children();
396 #ifndef QT_NO_QWS_QPF2 398 for (
int i = 0; i < int(dir.count()); ++i) {
404 #endif //QT_FONTS_ARE_RESOURCES 407 #ifdef QFONTDATABASE_DEBUG 409 for (
int f = 0; f < db->
count; f++) {
413 for (
int i = 0; i < QFont::LastPrivateScript; ++i) {
416 (family->scripts[i] & QtFontFamily::UnSupported) == QtFontFamily::UnSupported ?
417 "UnSupported" :
"Unknown"));
421 for (
int fd = 0; fd < family->
count; fd++) {
424 for (
int s = 0; s < foundry->
count; s++) {
426 FD_DEBUG(
"\t\t\tstyle: style=%d weight=%d\n" 431 FD_DEBUG(
"\t\t\t\tsmooth scalable");
433 FD_DEBUG(
"\t\t\t\tbitmap scalable");
436 for (
int z = 0; z < style->
count; ++z) {
445 #endif // QFONTDATABASE_DEBUG 447 #ifndef QT_NO_LIBRARY 450 for (
int i = 0; i < pluginFoundries.
count(); ++i) {
451 const QString foundry(pluginFoundries.
at(i));
455 qDebug() <<
"Could not load plugin for foundry" << foundry;
460 for (
int i = 0; i < fonts.
count(); ++i) {
463 int weight = info.
weight();
476 #ifndef QT_FONTS_ARE_RESOURCES 485 for (
int i = 0; i < db->
count; ++i) {
488 if (family->
count == 0)
493 if (coveredWritingSystems[
ws])
496 coveredWritingSystems[
ws] =
true;
504 #ifndef QT_FONTS_ARE_RESOURCES 508 #ifndef QT_FONTS_ARE_RESOURCES 512 binaryDb.rename(dbFileName);
The QDir class provides access to directory structures and their contents.
bool loadFromCache(const QString &fontPath)
static mach_timebase_info_data_t info
The QByteArray class provides an array of bytes.
QString qws_fontCacheDir()
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
QStringList addTTFile(const QByteArray &file, const QByteArray &fontData=QByteArray())
QString family() const
the family name of the font
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
Q_CORE_EXPORT void qDebug(const char *,...)
QStringList fallbackFamilies
The QResource class provides an interface for reading directly from resources.
static float pixelSize(const QFontDef &request, int dpi)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
QList< QFontDatabase::WritingSystem > writingSystems() const
An empty list means that any writing system is supported.
The QFontEngineInfo class describes a specific font provided by a font engine plugin.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
void clear()
Removes all items from the list.
QtFontFoundry ** foundries
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QTextStream & ws(QTextStream &stream)
Calls skipWhiteSpace() on stream and returns stream.
int version() const
Returns the version number of the data serialization format.
const char * constData() const
Returns a pointer to the data stored in the byte array.
void addFont(const QString &familyname, const char *foundryname, int weight, bool italic, int pixelSize, const QByteArray &file, int fileIndex, bool antialiased, const QList< QFontDatabase::WritingSystem > &writingSystems=QList< QFontDatabase::WritingSystem >())
QFont::Style style() const
the style of the font
Q_CORE_EXPORT void qFatal(const char *,...)
static QString qwsFontPath()
QString & append(QChar c)
The QFile class provides an interface for reading from and writing to files.
unsigned char writingSystems[QFontDatabase::WritingSystemsCount]
bool remove()
Removes the file specified by fileName().
qreal pixelSize() const
A pixel size of 0 represents a freely scalable font.
static QByteArray encodeName(const QString &fileName)
By default, this function converts fileName to the local 8-bit encoding determined by the user's loca...
int weight() const
The value should be from the QFont::Weight enumeration.
The QDataStream class provides serialization of binary data to a QIODevice.
QVector< ApplicationFont > applicationFonts
#define qPrintable(string)
void addQPF2File(const QByteArray &file)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Q_DECL_CONSTEXPR int qRound(qreal d)
QBool contains(char c) const
Returns true if the byte array contains the character ch; otherwise returns false.
The QList class is a template class that provides lists.