1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qglyphrun.cpp -->
<title>Qt 4.8: QGlyphRun Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QGlyphRun</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QGlyphRun Class Reference</h1>
<!-- $$$QGlyphRun-brief -->
<p>The QGlyphRun class provides direct access to the internal glyphs in a font. <a href="#details">More...</a></p>
<!-- @@@QGlyphRun -->
<pre class="cpp"> <span class="preprocessor">#include <QGlyphRun></span></pre><p>This class was introduced in Qt 4.8.</p>
<ul>
<li><a href="qglyphrun-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#QGlyphRun">QGlyphRun</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#QGlyphRun-2">QGlyphRun</a></b> ( const QGlyphRun & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#dtor.QGlyphRun">~QGlyphRun</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector<quint32> </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#glyphIndexes">glyphIndexes</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#overline">overline</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector<QPointF> </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#positions">positions</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRawFont </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#rawFont">rawFont</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setGlyphIndexes">setGlyphIndexes</a></b> ( const QVector<quint32> & <i>glyphIndexes</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setOverline">setOverline</a></b> ( bool <i>overline</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setPositions">setPositions</a></b> ( const QVector<QPointF> & <i>positions</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setRawData">setRawData</a></b> ( const quint32 * <i>glyphIndexArray</i>, const QPointF * <i>glyphPositionArray</i>, int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setRawFont">setRawFont</a></b> ( const QRawFont & <i>rawFont</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setStrikeOut">setStrikeOut</a></b> ( bool <i>strikeOut</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#setUnderline">setUnderline</a></b> ( bool <i>underline</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#strikeOut">strikeOut</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#underline">underline</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#operator-not-eq">operator!=</a></b> ( const QGlyphRun & <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGlyphRun & </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#operator-eq">operator=</a></b> ( const QGlyphRun & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglyphrun.html#operator-eq-eq">operator==</a></b> ( const QGlyphRun & <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QGlyphRun-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QGlyphRun class provides direct access to the internal glyphs in a font.</p>
<p>When Qt displays a string of text encoded in Unicode, it will first convert the Unicode points into a list of glyph indexes and a list of positions based on one or more fonts. The Unicode representation of the text and the <a href="qfont.html">QFont</a> object will in this case serve as a convenient abstraction that hides the details of what actually takes place when displaying the text on-screen. For instance, by the time the text actually reaches the screen, it may be represented by a set of fonts in addition to the one specified by the user, e.g. in case the originally selected font did not support all the writing systems contained in the text.</p>
<p>Under certain circumstances, it can be useful as an application developer to have more low-level control over which glyphs in a specific font are drawn to the screen. This could for instance be the case in applications that use an external font engine and text shaper together with Qt. QGlyphRun provides an interface to the raw data needed to get text on the screen. It contains a list of glyph indexes, a position for each glyph and a font.</p>
<p>It is the user's responsibility to ensure that the selected font actually contains the provided glyph indexes.</p>
<p><a href="qtextlayout.html#glyphRuns">QTextLayout::glyphRuns</a>() or <a href="qtextfragment.html#glyphRuns">QTextFragment::glyphRuns</a>() can be used to convert unicode encoded text into a list of QGlyphRun objects, and <a href="qpainter.html#drawGlyphRun">QPainter::drawGlyphRun</a>() can be used to draw the glyphs.</p>
<p><b>Note:</b> Please note that <a href="qrawfont.html">QRawFont</a> is considered local to the thread in which it is constructed. This in turn means that a new <a href="qrawfont.html">QRawFont</a> will have to be created and set on the QGlyphRun if it is moved to a different thread. If the QGlyphRun contains a reference to a <a href="qrawfont.html">QRawFont</a> from a different thread than the current, it will not be possible to draw the glyphs using a <a href="qpainter.html">QPainter</a>, as the <a href="qrawfont.html">QRawFont</a> is considered invalid and inaccessible in this case.</p>
</div>
<!-- @@@QGlyphRun -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGlyphRun[overload1]$$$QGlyphRun -->
<h3 class="fn"><a name="QGlyphRun"></a>QGlyphRun::<span class="name">QGlyphRun</span> ()</h3>
<p>Constructs an empty <a href="qglyphrun.html">QGlyphRun</a> object.</p>
<!-- @@@QGlyphRun -->
<!-- $$$QGlyphRun$$$QGlyphRunconstQGlyphRun& -->
<h3 class="fn"><a name="QGlyphRun-2"></a>QGlyphRun::<span class="name">QGlyphRun</span> ( const <span class="type">QGlyphRun</span> & <i>other</i> )</h3>
<p>Constructs a <a href="qglyphrun.html">QGlyphRun</a> object which is a copy of <i>other</i>.</p>
<!-- @@@QGlyphRun -->
<!-- $$$~QGlyphRun[overload1]$$$~QGlyphRun -->
<h3 class="fn"><a name="dtor.QGlyphRun"></a>QGlyphRun::<span class="name">~QGlyphRun</span> ()</h3>
<p>Destroys the <a href="qglyphrun.html">QGlyphRun</a>.</p>
<!-- @@@~QGlyphRun -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QGlyphRun::<span class="name">clear</span> ()</h3>
<p>Clears all data in the <a href="qglyphrun.html">QGlyphRun</a> object.</p>
<!-- @@@clear -->
<!-- $$$glyphIndexes[overload1]$$$glyphIndexes -->
<h3 class="fn"><a name="glyphIndexes"></a><span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span>> QGlyphRun::<span class="name">glyphIndexes</span> () const</h3>
<p>Returns the glyph indexes for this <a href="qglyphrun.html">QGlyphRun</a> object.</p>
<p><b>See also </b><a href="qglyphrun.html#setGlyphIndexes">setGlyphIndexes</a>() and <a href="qglyphrun.html#setPositions">setPositions</a>().</p>
<!-- @@@glyphIndexes -->
<!-- $$$overline[overload1]$$$overline -->
<h3 class="fn"><a name="overline"></a><span class="type">bool</span> QGlyphRun::<span class="name">overline</span> () const</h3>
<p>Returns true if this <a href="qglyphrun.html">QGlyphRun</a> should be painted with an overline decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#setOverline">setOverline</a>().</p>
<!-- @@@overline -->
<!-- $$$positions[overload1]$$$positions -->
<h3 class="fn"><a name="positions"></a><span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qpointf.html">QPointF</a></span>> QGlyphRun::<span class="name">positions</span> () const</h3>
<p>Returns the position of the edge of the baseline for each glyph in this set of glyph indexes.</p>
<p><b>See also </b><a href="qglyphrun.html#setPositions">setPositions</a>().</p>
<!-- @@@positions -->
<!-- $$$rawFont[overload1]$$$rawFont -->
<h3 class="fn"><a name="rawFont"></a><span class="type"><a href="qrawfont.html">QRawFont</a></span> QGlyphRun::<span class="name">rawFont</span> () const</h3>
<p>Returns the font selected for this <a href="qglyphrun.html">QGlyphRun</a> object.</p>
<p><b>See also </b><a href="qglyphrun.html#setRawFont">setRawFont</a>().</p>
<!-- @@@rawFont -->
<!-- $$$setGlyphIndexes[overload1]$$$setGlyphIndexesconstQVector<quint32>& -->
<h3 class="fn"><a name="setGlyphIndexes"></a><span class="type">void</span> QGlyphRun::<span class="name">setGlyphIndexes</span> ( const <span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span>> & <i>glyphIndexes</i> )</h3>
<p>Set the glyph indexes for this <a href="qglyphrun.html">QGlyphRun</a> object to <i>glyphIndexes</i>. The glyph indexes must be valid for the selected font.</p>
<p><b>See also </b><a href="qglyphrun.html#glyphIndexes">glyphIndexes</a>().</p>
<!-- @@@setGlyphIndexes -->
<!-- $$$setOverline[overload1]$$$setOverlinebool -->
<h3 class="fn"><a name="setOverline"></a><span class="type">void</span> QGlyphRun::<span class="name">setOverline</span> ( <span class="type">bool</span> <i>overline</i> )</h3>
<p>Indicates that this <a href="qglyphrun.html">QGlyphRun</a> should be painted with an overline decoration if <i>overline</i> is true. Otherwise the <a href="qglyphrun.html">QGlyphRun</a> should be painted with no overline decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#overline">overline</a>().</p>
<!-- @@@setOverline -->
<!-- $$$setPositions[overload1]$$$setPositionsconstQVector<QPointF>& -->
<h3 class="fn"><a name="setPositions"></a><span class="type">void</span> QGlyphRun::<span class="name">setPositions</span> ( const <span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qpointf.html">QPointF</a></span>> & <i>positions</i> )</h3>
<p>Sets the positions of the edge of the baseline for each glyph in this set of glyph indexes to <i>positions</i>.</p>
<p><b>See also </b><a href="qglyphrun.html#positions">positions</a>().</p>
<!-- @@@setPositions -->
<!-- $$$setRawData[overload1]$$$setRawDataconstquint32*constQPointF*int -->
<h3 class="fn"><a name="setRawData"></a><span class="type">void</span> QGlyphRun::<span class="name">setRawData</span> ( const <span class="type"><a href="qtglobal.html#quint32-typedef">quint32</a></span> * <i>glyphIndexArray</i>, const <span class="type"><a href="qpointf.html">QPointF</a></span> * <i>glyphPositionArray</i>, <span class="type">int</span> <i>size</i> )</h3>
<p>Sets the glyph indexes and positions of this <a href="qglyphrun.html">QGlyphRun</a> to use the first <i>size</i> elements in the arrays <i>glyphIndexArray</i> and <i>glyphPositionArray</i>. The data is <i>not</i> copied. The caller must guarantee that the arrays are not deleted as long as this <a href="qglyphrun.html">QGlyphRun</a> and any copies of it exists.</p>
<p><b>See also </b><a href="qglyphrun.html#setGlyphIndexes">setGlyphIndexes</a>() and <a href="qglyphrun.html#setPositions">setPositions</a>().</p>
<!-- @@@setRawData -->
<!-- $$$setRawFont[overload1]$$$setRawFontconstQRawFont& -->
<h3 class="fn"><a name="setRawFont"></a><span class="type">void</span> QGlyphRun::<span class="name">setRawFont</span> ( const <span class="type"><a href="qrawfont.html">QRawFont</a></span> & <i>rawFont</i> )</h3>
<p>Sets the font specified by <i>rawFont</i> to be the font used to look up the glyph indexes.</p>
<p><b>See also </b><a href="qglyphrun.html#rawFont">rawFont</a>() and <a href="qglyphrun.html#setGlyphIndexes">setGlyphIndexes</a>().</p>
<!-- @@@setRawFont -->
<!-- $$$setStrikeOut[overload1]$$$setStrikeOutbool -->
<h3 class="fn"><a name="setStrikeOut"></a><span class="type">void</span> QGlyphRun::<span class="name">setStrikeOut</span> ( <span class="type">bool</span> <i>strikeOut</i> )</h3>
<p>Indicates that this <a href="qglyphrun.html">QGlyphRun</a> should be painted with an strike out decoration if <i>strikeOut</i> is true. Otherwise the <a href="qglyphrun.html">QGlyphRun</a> should be painted with no strike out decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#strikeOut">strikeOut</a>().</p>
<!-- @@@setStrikeOut -->
<!-- $$$setUnderline[overload1]$$$setUnderlinebool -->
<h3 class="fn"><a name="setUnderline"></a><span class="type">void</span> QGlyphRun::<span class="name">setUnderline</span> ( <span class="type">bool</span> <i>underline</i> )</h3>
<p>Indicates that this <a href="qglyphrun.html">QGlyphRun</a> should be painted with an underline decoration if <i>underline</i> is true. Otherwise the <a href="qglyphrun.html">QGlyphRun</a> should be painted with no underline decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#underline">underline</a>().</p>
<!-- @@@setUnderline -->
<!-- $$$strikeOut[overload1]$$$strikeOut -->
<h3 class="fn"><a name="strikeOut"></a><span class="type">bool</span> QGlyphRun::<span class="name">strikeOut</span> () const</h3>
<p>Returns true if this <a href="qglyphrun.html">QGlyphRun</a> should be painted with a strike out decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#setStrikeOut">setStrikeOut</a>().</p>
<!-- @@@strikeOut -->
<!-- $$$underline[overload1]$$$underline -->
<h3 class="fn"><a name="underline"></a><span class="type">bool</span> QGlyphRun::<span class="name">underline</span> () const</h3>
<p>Returns true if this <a href="qglyphrun.html">QGlyphRun</a> should be painted with an underline decoration.</p>
<p><b>See also </b><a href="qglyphrun.html#setUnderline">setUnderline</a>().</p>
<!-- @@@underline -->
<!-- $$$operator!=[overload1]$$$operator!=constQGlyphRun& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QGlyphRun::<span class="name">operator!=</span> ( const <span class="type">QGlyphRun</span> & <i>other</i> ) const</h3>
<p>Compares <i>other</i> to this <a href="qglyphrun.html">QGlyphRun</a> object. Returns true if any of the list of glyph indexes, the list of positions or the font are different, otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQGlyphRun& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QGlyphRun</span> & QGlyphRun::<span class="name">operator=</span> ( const <span class="type">QGlyphRun</span> & <i>other</i> )</h3>
<p>Assigns <i>other</i> to this <a href="qglyphrun.html">QGlyphRun</a> object.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQGlyphRun& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QGlyphRun::<span class="name">operator==</span> ( const <span class="type">QGlyphRun</span> & <i>other</i> ) const</h3>
<p>Compares <i>other</i> to this <a href="qglyphrun.html">QGlyphRun</a> object. Returns true if the list of glyph indexes, the list of positions and the font are all equal, otherwise returns false.</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|