diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-12-09 18:23:04 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-12-09 18:23:04 (GMT) |
commit | 4c870f3fe88d14e2efa19b924d9f89dea0a6931c (patch) | |
tree | cb2147f7edbd440869019a99367ded9a5e0e206a /src/gui/text/qfontengine_s60_p.h | |
parent | 1b41444e13d3e9e2f0733129675d0c2996e7df57 (diff) | |
download | Qt-4c870f3fe88d14e2efa19b924d9f89dea0a6931c.zip Qt-4c870f3fe88d14e2efa19b924d9f89dea0a6931c.tar.gz Qt-4c870f3fe88d14e2efa19b924d9f89dea0a6931c.tar.bz2 |
Runtime dependency on Symbians Font Table API
The Symbian Font Table API is a feature from (the former)
Symbian^4 which will be backported into Symbian^3 in a
random minor OS version. In order to keep Qt source and binary
compatible between these minor versions, we cannot decide at
compile time whether or not to use the new Font Table API.
This patch changes many "#ifdef Q_SYMBIAN_HAS_FONTTABLE_API"
into "if (symbianFontTableApiAvailable())". The Font Table
feature is detected at runtime. Currently, CFeatureDiscovery
is not used, because at the time of writing, that feature flag
test would give false positives or false negatives. Instead,
CFont::ExtendedFunction() is called with KFontGetFontTable to
see if the return value is KErrNone, which indicates that the
feature is available. The avalibility information gets cached,
so the hack happens only once per application run.
The font table Api feature comes with helper classes such as
"RFontTable" and "TGetFontTableParam". But we cannot use those,
because we want to stay source and binary compatible across the
Symbian(^3) versions without the Font table API and those with.
So, in Qt, RFontTable is simply not used and TGetFontTableParam
is replicated as "QSymbianTGetFontTableParam". Same for
KFontGetFontTable, KFontReleaseFontTable and later also
FfFontTable.
This patch has been looked at by colleagues, who verified the
overall #ifdef to if() conversion, but did not feel entitled to
give their official Reviewed-By for an obscure topic like Qt
font support on Symbian. (It sucks to be the only creature in
this universe who -kind of- knows how Qt text handling and
Symbian text handling interact)
Task-Number: QTBUG-15515
Diffstat (limited to 'src/gui/text/qfontengine_s60_p.h')
-rw-r--r-- | src/gui/text/qfontengine_s60_p.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index c65ce55..cdf2185 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -58,13 +58,11 @@ #include "qsize.h" #include <openfont.h> -#ifdef SYMBIAN_GDI_GLYPHDATA -#define Q_SYMBIAN_HAS_FONTTABLE_API -#endif - -#ifdef Q_SYMBIAN_HAS_FONTTABLE_API +// The glyph outline code is intentionally disabled. It will be reactivated as +// soon as the glyph outline API is backported from Symbian(^4) to Symbian(^3). +#if 0 #define Q_SYMBIAN_HAS_GLYPHOUTLINE_API -#endif // Q_SYMBIAN_HAS_FONTTABLE_API +#endif class CFont; @@ -83,16 +81,18 @@ public: CFont *fontOwner() const; bool isSymbolCMap() const; QFixed unitsPerEm() const; + static bool symbianFontTableApiAvailable(); private: CFont* m_cFont; mutable bool m_symbolCMap; mutable QByteArray m_cmapTable; mutable QFixed m_unitsPerEm; -#ifndef Q_SYMBIAN_HAS_FONTTABLE_API + + // m_openFont and m_openFont are used if Symbian does not provide + // the Font Table API COpenFont *m_openFont; mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; -#endif // Q_SYMBIAN_HAS_FONTTABLE_API }; class QFontEngineS60 : public QFontEngine |