From 23e559473594b4d671405923ecd07d0f04047239 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 12 Oct 2011 08:25:45 +0200 Subject: Add QGlyphRun::SplitLigature flag If the glyph run is generated based on characters which split a ligature glyph, it needs to include the ligature glyph in the run, and when painting, we need to clip the painter to the reported bounding rect of the run in order to avoid painting too much of the ligature. To make it possible to reduce clipping to a minimum, we need a flag to inform of whether the glyph run contains a split ligature or not. Change-Id: Id787e0bec6d6e8e06cc818700ae0fca22cf81e98 Reviewed-by: Jiang Jiang --- src/gui/text/qglyphrun.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui/text/qglyphrun.cpp') diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp index a4e9048678..0457202a18 100644 --- a/src/gui/text/qglyphrun.cpp +++ b/src/gui/text/qglyphrun.cpp @@ -100,6 +100,14 @@ QT_BEGIN_NAMESPACE \value RightToLeft Indicates that the glyphs are ordered right to left. This can affect the positioning of other screen elements that are relative to the glyph run, such as an inline text object. + \value SplitLigature Indicates that the glyph run splits a ligature glyph. This means + that a ligature glyph is included in the run, but the characters represented by it corresponds + only to part of that ligature. The glyph run's boundingRect() function can in this case be used + to retrieve the area covered by glyphs that correspond to the characters represented by the + glyph run. When visualizing the glyphs, care needs to be taken to clip to this bounding rect to + ensure that only the corresponding part of the ligature is painted. In particular, this can be + the case when retrieving a glyph run from a QTextLayout for a specific character range, e.g. + when retrieving the selected area of a QTextLayout. */ /*! -- cgit v1.2.3