summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qplatformfontdatabase_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-11-19 10:58:59 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-11-22 13:14:19 (GMT)
commitb24c0c77610c29442d538d4d33d6e0c53e88ae00 (patch)
treedb0e663064d9d7ffb477dd6d9e71ba24c8cd6134 /src/gui/text/qplatformfontdatabase_qpa.cpp
parent292f6a9ba1b5da049e4898525974c6f0575ccd65 (diff)
downloadQt-b24c0c77610c29442d538d4d33d6e0c53e88ae00.zip
Qt-b24c0c77610c29442d538d4d33d6e0c53e88ae00.tar.gz
Qt-b24c0c77610c29442d538d4d33d6e0c53e88ae00.tar.bz2
Adding some documentation for Lighthouse
The spirit here is "something is better than nothing". Ie. its the first itteration of documenting the classes. No general Lighthouse introduction yet...
Diffstat (limited to 'src/gui/text/qplatformfontdatabase_qpa.cpp')
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index 7a89fe4..d6dff41 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -165,6 +165,23 @@ bool QSupportedWritingSystems::supported(QFontDatabase::WritingSystem writingSys
return d->vector.at(writingSystem);
}
+/*!
+ \class QSupportedWritingSystems
+ \brief The QSupportedWritingSystems class is used when registering fonts with the internal Qt
+ fontdatabase
+ \ingroup painting
+
+ Its to provide an easy to use interface for indicating what writing systems a specific font
+ supports.
+
+*/
+
+/*!
+ This function is called once at startup by Qts internal fontdatabase. Reimplement this function
+ in a subclass for a convenient place to initialise the internal fontdatabase.
+
+ The default implementation looks in the fontDir() location and registers all qpf2 fonts.
+*/
void QPlatformFontDatabase::populateFontDatabase()
{
QString fontpath = fontDir();
@@ -188,6 +205,9 @@ void QPlatformFontDatabase::populateFontDatabase()
}
}
+/*!
+
+*/
QFontEngine *QPlatformFontDatabase::fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle)
{
Q_UNUSED(script);
@@ -198,6 +218,9 @@ QFontEngine *QPlatformFontDatabase::fontEngine(const QFontDef &fontDef, QUnicode
return engine;
}
+/*!
+
+*/
QStringList QPlatformFontDatabase::fallbacksForFamily(const QString family, const QFont::Style &style, const QUnicodeTables::Script &script) const
{
Q_UNUSED(family);
@@ -219,12 +242,18 @@ QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData
return QStringList();
}
+/*!
+
+*/
void QPlatformFontDatabase::releaseHandle(void *handle)
{
QByteArray *fileDataPtr = static_cast<QByteArray *>(handle);
delete fileDataPtr;
}
+/*!
+
+*/
QString QPlatformFontDatabase::fontDir() const
{
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
@@ -238,4 +267,24 @@ QString QPlatformFontDatabase::fontDir() const
return fontpath;
}
+/*!
+ \class QPlatformFontDatabase
+ \brief The QPlatformFontDatabase makes it possible to customize how fonts are picked up, and
+ and how they are rendered
+
+ \ingroup painting
+
+ QPlatformFontDatabase is the superclass which is intended to let platform implementations use
+ native font handling.
+
+ Qt has its internal fontdatabase which it uses to pick up available fonts. To be able
+ to populate this database subclass this class, and reimplement populateFontDatabase().
+
+ Use the function registerFont to populate the internal fontdatabase.
+
+ Sometimes a specified font does not have the required glyphs, then the fallbackForFamily
+ function is called.
+
+ \sa QSupportedWritingSystems
+*/
QT_END_NAMESPACE