<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/doc/scripts.doc:1 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Qt's Text Engine</title> <style type="text/css"><!-- h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>Qt's Text Engine</h1> <p> Qt 3 comes with a completely redesigned text processing and layout engine that is used throughout the whole library. <p> It has support for most writing systems that are used throughout the world, including <p> <ul> <li> Arabic <li> Chinese <li> Cyrillic (Russian) <li> Greek <li> Hebrew <li> Japanese <li> Korean <li> Latin languages (e.g. English and many other European languages) <li> Thai <li> Vietnamese </ul> <p> Many of these writing systems exhibit special features: <p> <ul> <p> <li> Special line breaking behaviour. Some of the Asian languages are written without spaces between words. Line breaking can occur either after every character (with exceptions) as in Chinese, Japanese and Korean, or after logical word boundaries as in Thai. <p> <li> Bidirectional writing. Arabic and Hebrew are written from right to left, except for numbers and embedded English text which is written left to right. The exact behaviour is defined in the <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Technical Report #9</a>. <p> <li> Non spacing or diacritical marks (accents or umlauts in European languages). Some languages such as Vietnamese make extensive use of these marks and some characters can have a few marks at the same time to clarify pronunciation. <p> <li> Ligatures. In special contexts, some characters following each other directly get replaced by a combined glyph forming a ligature. Common examples are the ff and fi ligatures used in typesetting US and European books. <p> </ul> <p> Except for ligatures which are currently only supported for the special case of Arabic, Qt tries to take care of all the special features listed above. You will usually never have to worry about these features as long as you use Qt's input (e.g. <a href="qlineedit.html">QLineEdit</a>, QTextView or derived classes) and displaying controls (e.g. <a href="qlabel.html">QLabel</a>). <p> Support for these writing systems is transparent to the programmer and completely encapsulated in Qt's text engine. This implies that you don't need to have any knowledge about the writing system used in a particular language, except for a couple of small things listed below. <p> <ul> <p> <li> <a href="qpainter.html#drawText">QPainter::drawText</a>( int x, int y, const <a href="qstring.html">QString</a> &str ) will always draw the string with it's left edge at the position specified with the x, y parameters. This will usually give you left aligned strings. Arabic and Hebrew application strings are usually right aligned, so for these languages use the version of drawText() that takes a <a href="qrect.html">QRect</a> since this will align in accordance with the language. <p> <li> When you write your own text input controls, use <a href="qfontmetrics.html#charWidth">QFontMetrics::charWidth</a>() to determine the width of a character in a string. In some langauges (mainly Arabic), the width and shape of a glyph changes depending on the surrounding characters. Writing input controls usually requires a certain knowledge of the scripts it is going to be used in. Usually the easiest way is to subclass <a href="qlineedit.html">QLineEdit</a> or QTextView. <p> </ul> <p> <!-- eof --> <p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>