From ebd8ca146db023143d32ca6cba68b813b9e3da0b Mon Sep 17 00:00:00 2001 From: Josh Faust Date: Fri, 8 Mar 2013 16:06:00 -0800 Subject: [PATCH] Fix size of HB_FontRec in qharfbuzz_copy_p.h HB_FontRec was defined in qharfbuzz_copy_p.h as a void* typedef, which is incorrect, and is the wrong size. This caused things accessing QFontEngine data after an HB_FontRec to read from the wrong offset. The visible consequence of this was incorrect text rendering in OpenGL in Linux. Task-number: QTBUG-29966 Change-Id: I71e6a6c5b4ef7b2c8a92631d2b9540537afc56b1 Reviewed-by: Konstantin Ritt --- src/gui/text/qharfbuzz_copy_p.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h index 34acca3f9a3..7225ff77171 100644 --- a/src/gui/text/qharfbuzz_copy_p.h +++ b/src/gui/text/qharfbuzz_copy_p.h @@ -69,8 +69,9 @@ typedef enum { typedef QT_PREPEND_NAMESPACE(quint32) HB_Glyph; typedef void * HB_Font; typedef void * HB_Face; -typedef void * HB_FontRec; typedef QT_PREPEND_NAMESPACE(quint32) hb_uint32; +typedef QT_PREPEND_NAMESPACE(quint16) HB_UShort; +typedef QT_PREPEND_NAMESPACE(qint32) HB_16Dot16; typedef QT_PREPEND_NAMESPACE(qint32) HB_Fixed; typedef struct { @@ -88,6 +89,16 @@ typedef struct { hb_bitfield combiningClass :8; } HB_GlyphAttributes; +typedef struct HB_Font_ { + const void *klass; + + /* Metrics */ + HB_UShort x_ppem, y_ppem; + HB_16Dot16 x_scale, y_scale; + + void *userData; +} HB_FontRec; + } #endif // ifdef QT_BUILD_GUI_LIB