diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-04-05 11:20:27 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-04-05 11:20:27 (GMT) |
commit | 29763aa66334a68011ddcc0fb817514ac67cd248 (patch) | |
tree | c64e7f614be4ca4d2021d72501d5f3ca0294fa8f /src/gui/text | |
parent | f2625271f7c878c00fea38291cd11c34c80550fa (diff) | |
download | Qt-29763aa66334a68011ddcc0fb817514ac67cd248.zip Qt-29763aa66334a68011ddcc0fb817514ac67cd248.tar.gz Qt-29763aa66334a68011ddcc0fb817514ac67cd248.tar.bz2 |
Implementing QFontEngineS60::getSfntTableData()
That function was not yet implementing. Its absense caused some
Harfbuzz based shaping not to happen.
See Robert DeWolf's comment on task QTBUG-5857
Since QFontEngineS60 is private implementation and generally not
exported, no symbols need to be added to the .def files for this patch.
Task-number: QTBUG-5857
Reviewed-by: trustme
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 30 | ||||
-rw-r--r-- | src/gui/text/qfontengine_s60_p.h | 2 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 3ea084b..c9ff661 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -79,6 +79,31 @@ QByteArray QFontEngineS60Extensions::getSfntTable(uint tag) const return result; } +bool QFontEngineS60Extensions::getSfntTableData(uint tag, uchar *buffer, uint *length) const +{ + if (!m_trueTypeExtension->HasTrueTypeTable(tag)) + return false; + + bool result = true; + TInt error = KErrNone; + TInt tableByteLength; + TAny *table = + q_check_ptr(m_trueTypeExtension->GetTrueTypeTable(error, tag, &tableByteLength)); + + if (error != KErrNone) { + return false; + } else if (*length > 0 && *length < tableByteLength) { + result = false; // Caller did not allocate enough memory + } else { + *length = tableByteLength; + if (buffer) + qMemCopy(buffer, table, tableByteLength); + } + + m_trueTypeExtension->ReleaseTrueTypeTable(table); + return result; +} + const unsigned char *QFontEngineS60Extensions::cmap() const { if (!m_cmap) { @@ -326,6 +351,11 @@ QByteArray QFontEngineS60::getSfntTable(uint tag) const return m_extensions->getSfntTable(tag); } +bool QFontEngineS60::getSfntTableData(uint tag, uchar *buffer, uint *length) const +{ + return m_extensions->getSfntTableData(tag, buffer, length); +} + QFontEngine::Type QFontEngineS60::type() const { return QFontEngine::S60FontEngine; diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 5834cc4..a80af4d 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -69,6 +69,7 @@ public: QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font); QByteArray getSfntTable(uint tag) const; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; const unsigned char *cmap() const; QPainterPath glyphOutline(glyph_t glyph) const; CFont *fontOwner() const; @@ -106,6 +107,7 @@ public: qreal minRightBearing() const { return 0; } QByteArray getSfntTable(uint tag) const; + bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; static qreal pixelsToPoints(qreal pixels, Qt::Orientation orientation = Qt::Horizontal); static qreal pointsToPixels(qreal points, Qt::Orientation orientation = Qt::Horizontal); |