File: FirstLineWidth.html

package info (click to toggle)
openlayer 2.1-2.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 3,392 kB
  • ctags: 2,317
  • sloc: ansic: 10,433; cpp: 9,890; xml: 109; makefile: 90; sh: 36
file content (21 lines) | stat: -rw-r--r-- 5,644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transistional//EN"><html><head><title>OpenLayer Offline Manual</title><style type="text/css" media="all">@import "../CrystalStyle.css";</style><body bgcolor="FFFFFF" ><div align="center" style="pagestyle"><table width="60%"><tr><td><div class="parentLinks"><a href="../index.html">OpenLayer</a> | <a href="../TextRenderer.html">TextRenderer</a> | <a href="../TextRenderer/FirstLineWidth.html">FirstLineWidth</a></div><br><div class="BigHeader">FirstLineWidth</div><br><div class=""><div class="Surrounded"><table><tr valign="top"><td align="right"><div class="FuncDef"><strong><font color="#777733">int</font> <a href="../TextRenderer/FirstLineWidth.html"><font color="#0000CC">FirstLineWidth</font></a>(</strong></div></td><td><div class="FuncDef"><strong><font color="#777733">const</font> std::string &amp;text ) <font color="#777733">const</font>;
<br></strong></div></td></tr></table>
<br>Returns the width of the first text line of the given multi-lined text when printed with this TextRenderer.
<br></div>
<br>The width is in pixels. You can pass either single or multi-lined text to this function but it'll always return the width of the first text line.
<br>
<br>Notice that like any other function of <a href="../TextRenderer.html"><font color="#0000CC">TextRenderer</font></a> this function takes a reference to a string so you have to construct a string variable of the text before passing it to this function.</div><br><div class="MediumHeader">Examples</div><br><div class="Code"><a href="../TextRenderer.html"><font color="#0000CC">TextRenderer</font></a>&nbsp;renderer(&nbsp;...&nbsp;);
<br>
<br>String&nbsp;text&nbsp;=&nbsp;<font color="#CC0000">"First&nbsp;line\nSecond&nbsp;line\nThird&nbsp;line"</font>;
<br>
<br><font color="#999922">//&nbsp;Get&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;first&nbsp;line&nbsp;of&nbsp;the&nbsp;text&nbsp;("First&nbsp;line")&nbsp;//</font>
<br><font color="#777733">int</font>&nbsp;textWidth&nbsp;=&nbsp;renderer.<a href="../TextRenderer/FirstLineWidth.html"><font color="#0000CC">FirstLineWidth</font></a>(&nbsp;text&nbsp;);</div><div class=""><br><br><div class="MediumHeader">Other functions of the class <a href="../TextRenderer.html"><font color="#0000CC">TextRenderer</font></a></div><div class="Surrounded"><table size="100%" cellpadding="0" cellspacing="0"><tr><td halign="center" class="funclist"><a href="../TextRenderer/Load.html">Load</a></td><td width="65%" halign="center"><div class="smalltext">Load the font</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/Print.html">Print</a></td><td width="65%" halign="center"><div class="smalltext">Prints the given text to the screen</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/SetColor.html">SetColor</a></td><td width="65%" halign="center"><div class="smalltext">
Sets the color of the font</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/GetColor.html">GetColor</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the text color of the font</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/SetItalics.html">SetItalics</a></td><td width="65%" halign="center"><div class="smalltext">
Sets the italics angle of the text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/GetItalics.html">GetItalics</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the italics angle of the text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/Width.html">Width</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the width of the given text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/Height.html">Height</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the height of the given text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/FirstLineWidth.html">FirstLineWidth</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the width of the first text line of the given text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/FirstLineHeight.html">FirstLineHeight</a></td><td width="65%" halign="center"><div class="smalltext">
Returns the height of the first text line of the given text</div></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/IsValid.html">IsValid</a></td><td width="65%" halign="center"><div class="smalltext">
Checks if the TextRenderer was loaded correctly</div></td></tr><tr><td colspan="2"><br><div class="SmallHeader"><font color="#775500">Advanced functions</font></div><br></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/GetFace.html">GetFace</a></td><td width="65%" halign="center"></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/SendToGPU.html">SendToGPU</a></td><td width="65%" halign="center"></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/UnloadFromGPU.html">UnloadFromGPU</a></td><td width="65%" halign="center"></td></tr><tr><td halign="center" class="funclist"><a href="../TextRenderer/UseAutoDelete.html">UseAutoDelete</a></td><td width="65%" halign="center"></td></tr></table></div><br><div class=""><a href="../index.html">Back to the main page of the manual</a></div><br>Questions about FirstLineWidth? Click <a href="http://crystalstorm.ath.cx/index.php?lan=en&page=CreateFeedback&subject=FirstLineWidth">here.</a></div></td></tr></table></body></html>