Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 5674b83e4098065ec8ee4138eac12e58 > files > 783

lib64gigi-devel-0.8.0-8.1074.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>GG: Text Handling</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GG
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Text Handling </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="text_handling_unicode_support"></a>
Unicode Support</h1>
<p><a class="el" href="namespaceGG.html" title="The namespace that encloses all GG classes, functions, typedefs, enums, etc.">GG</a> supports Unicode characters. All strings that are rendered as text in <a class="el" href="namespaceGG.html" title="The namespace that encloses all GG classes, functions, typedefs, enums, etc.">GG</a> are considered to be UTF-8 encoded. <a class="el" href="namespaceGG.html" title="The namespace that encloses all GG classes, functions, typedefs, enums, etc.">GG</a> uses the utfcpp library (<a href="http://utfcpp.sourceforge.net">http://utfcpp.sourceforge.net</a>) to handle conversions from UTF-8 encoded strings to Unicode code points. A detail that you must know about utfcpp is that it throws exceptions on invalid input. Any time you pass a string to a <a class="el" href="namespaceGG.html" title="The namespace that encloses all GG classes, functions, typedefs, enums, etc.">GG</a> function, you run the risk of generating an exception if the string is not UTF-8 encoded. Note that ISO-8859-1 (commonly called "Latin-1"), Windows-1252, and other common single-byte encodings are not usable as UTF-8 strings.</p>
<h1><a class="anchor" id="text_handling_all_chars_considered_utf8"></a>
All Characters Are Considered UTF-8 Encoded</h1>
<p>Yes, all characters! Even if you call <a class="el" href="classGG_1_1Font.html#ac69a1de307fd99e663398643b82295db">GG::Font::RenderGlyph()</a> with a char parameter, that char had better conform to UTF-8 requirements for a valid codepoint (in particular, it's value must be in the range [0x0, 0x7f]).</p>
<h1><a class="anchor" id="text_handling_font_support"></a>
Font Support</h1>
<p>Be sure to use a TrueType font capable of rendering the character sets you need for whatever language(s) you need to support. Note that due to the large number of Unicode characters and the space requirements of using textured fonts, <a class="el" href="classGG_1_1Font.html" title="A bitmapped font rendering class.">GG::Font</a> requires you to supply it with the Unicode character sets you want at construction time. A useful pattern for constructing a <a class="el" href="classGG_1_1Font.html" title="A bitmapped font rendering class.">GG::Font</a> with the right character set coverage is to use <a class="el" href="namespaceGG.html#a89506eb42f2c97a8272d124b47cb0931">UnicodeCharsetsToRender()</a>. You simply pass it a string containing representative characters, and it returns a set of GG::UnicodeCharsets that covers all the characters in the string.</p>
<h1><a class="anchor" id="text_handling_user_input"></a>
User Input</h1>
<p>Unicode characters can be input by the user, as long as the input driver handles Unicode input. The SDL reference driver does. The Ogre OIS input plugin does not. <a class="el" href="namespaceGG.html" title="The namespace that encloses all GG classes, functions, typedefs, enums, etc.">GG</a> will convert any Unicode input to a multibyte UTF-8 sequence before adding it to a user-editable string (e.g. as in a <a class="el" href="classGG_1_1Edit.html" title="This is a single-line edit box control.">GG::Edit</a>). </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Jun 15 2012 15:13:31 for GG by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1
</small></address>
</body>
</html>