Terminal.Gui.TextFormatter.html 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class TextFormatter
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class TextFormatter
  11. ">
  12. <meta name="generator" content="docfx 2.56.7.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <meta property="docfx:navrel" content="../../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../../index.html">
  34. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list">Search Results for <span></span></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Terminal.Gui.TextFormatter">
  73. <h1 id="Terminal_Gui_TextFormatter" data-uid="Terminal.Gui.TextFormatter" class="text-break">Class TextFormatter
  74. </h1>
  75. <div class="markdown level0 summary">
  76. Provides text formatting capabilities for console apps. Supports, hotkeys, horizontal alignment, multiple lines, and word-based line wrap.
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritance">
  80. <h5>Inheritance</h5>
  81. <div class="level0"><span class="xref">System.Object</span></div>
  82. <div class="level1"><span class="xref">TextFormatter</span></div>
  83. </div>
  84. <div class="inheritedMembers">
  85. <h5>Inherited Members</h5>
  86. <div>
  87. <span class="xref">System.Object.Equals(System.Object)</span>
  88. </div>
  89. <div>
  90. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  91. </div>
  92. <div>
  93. <span class="xref">System.Object.GetHashCode()</span>
  94. </div>
  95. <div>
  96. <span class="xref">System.Object.GetType()</span>
  97. </div>
  98. <div>
  99. <span class="xref">System.Object.MemberwiseClone()</span>
  100. </div>
  101. <div>
  102. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  103. </div>
  104. <div>
  105. <span class="xref">System.Object.ToString()</span>
  106. </div>
  107. </div>
  108. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  109. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  110. <h5 id="Terminal_Gui_TextFormatter_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public class TextFormatter</code></pre>
  113. </div>
  114. <h3 id="properties">Properties
  115. </h3>
  116. <a id="Terminal_Gui_TextFormatter_Alignment_" data-uid="Terminal.Gui.TextFormatter.Alignment*"></a>
  117. <h4 id="Terminal_Gui_TextFormatter_Alignment" data-uid="Terminal.Gui.TextFormatter.Alignment">Alignment</h4>
  118. <div class="markdown level1 summary">
  119. Controls the horizontal text-alignment property.
  120. </div>
  121. <div class="markdown level1 conceptual"></div>
  122. <h5 class="decalaration">Declaration</h5>
  123. <div class="codewrapper">
  124. <pre><code class="lang-csharp hljs">public TextAlignment Alignment { get; set; }</code></pre>
  125. </div>
  126. <h5 class="propertyValue">Property Value</h5>
  127. <table class="table table-bordered table-striped table-condensed">
  128. <thead>
  129. <tr>
  130. <th>Type</th>
  131. <th>Description</th>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. <tr>
  136. <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
  137. <td>The text alignment.</td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. <a id="Terminal_Gui_TextFormatter_CursorPosition_" data-uid="Terminal.Gui.TextFormatter.CursorPosition*"></a>
  142. <h4 id="Terminal_Gui_TextFormatter_CursorPosition" data-uid="Terminal.Gui.TextFormatter.CursorPosition">CursorPosition</h4>
  143. <div class="markdown level1 summary">
  144. Gets the cursor position from <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_HotKey">HotKey</a>. If the <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_HotKey">HotKey</a> is defined, the cursor will be positioned over it.
  145. </div>
  146. <div class="markdown level1 conceptual"></div>
  147. <h5 class="decalaration">Declaration</h5>
  148. <div class="codewrapper">
  149. <pre><code class="lang-csharp hljs">public int CursorPosition { get; set; }</code></pre>
  150. </div>
  151. <h5 class="propertyValue">Property Value</h5>
  152. <table class="table table-bordered table-striped table-condensed">
  153. <thead>
  154. <tr>
  155. <th>Type</th>
  156. <th>Description</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <tr>
  161. <td><span class="xref">System.Int32</span></td>
  162. <td></td>
  163. </tr>
  164. </tbody>
  165. </table>
  166. <a id="Terminal_Gui_TextFormatter_Direction_" data-uid="Terminal.Gui.TextFormatter.Direction*"></a>
  167. <h4 id="Terminal_Gui_TextFormatter_Direction" data-uid="Terminal.Gui.TextFormatter.Direction">Direction</h4>
  168. <div class="markdown level1 summary">
  169. Controls the text-direction property.
  170. </div>
  171. <div class="markdown level1 conceptual"></div>
  172. <h5 class="decalaration">Declaration</h5>
  173. <div class="codewrapper">
  174. <pre><code class="lang-csharp hljs">public TextDirection Direction { get; set; }</code></pre>
  175. </div>
  176. <h5 class="propertyValue">Property Value</h5>
  177. <table class="table table-bordered table-striped table-condensed">
  178. <thead>
  179. <tr>
  180. <th>Type</th>
  181. <th>Description</th>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr>
  186. <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
  187. <td>The text vertical alignment.</td>
  188. </tr>
  189. </tbody>
  190. </table>
  191. <a id="Terminal_Gui_TextFormatter_HotKey_" data-uid="Terminal.Gui.TextFormatter.HotKey*"></a>
  192. <h4 id="Terminal_Gui_TextFormatter_HotKey" data-uid="Terminal.Gui.TextFormatter.HotKey">HotKey</h4>
  193. <div class="markdown level1 summary">
  194. Gets the hotkey. Will be an upper case letter or digit.
  195. </div>
  196. <div class="markdown level1 conceptual"></div>
  197. <h5 class="decalaration">Declaration</h5>
  198. <div class="codewrapper">
  199. <pre><code class="lang-csharp hljs">public Key HotKey { get; }</code></pre>
  200. </div>
  201. <h5 class="propertyValue">Property Value</h5>
  202. <table class="table table-bordered table-striped table-condensed">
  203. <thead>
  204. <tr>
  205. <th>Type</th>
  206. <th>Description</th>
  207. </tr>
  208. </thead>
  209. <tbody>
  210. <tr>
  211. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  212. <td></td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. <a id="Terminal_Gui_TextFormatter_HotKeyPos_" data-uid="Terminal.Gui.TextFormatter.HotKeyPos*"></a>
  217. <h4 id="Terminal_Gui_TextFormatter_HotKeyPos" data-uid="Terminal.Gui.TextFormatter.HotKeyPos">HotKeyPos</h4>
  218. <div class="markdown level1 summary">
  219. The position in the text of the hotkey. The hotkey will be rendered using the hot color.
  220. </div>
  221. <div class="markdown level1 conceptual"></div>
  222. <h5 class="decalaration">Declaration</h5>
  223. <div class="codewrapper">
  224. <pre><code class="lang-csharp hljs">public int HotKeyPos { get; set; }</code></pre>
  225. </div>
  226. <h5 class="propertyValue">Property Value</h5>
  227. <table class="table table-bordered table-striped table-condensed">
  228. <thead>
  229. <tr>
  230. <th>Type</th>
  231. <th>Description</th>
  232. </tr>
  233. </thead>
  234. <tbody>
  235. <tr>
  236. <td><span class="xref">System.Int32</span></td>
  237. <td></td>
  238. </tr>
  239. </tbody>
  240. </table>
  241. <a id="Terminal_Gui_TextFormatter_HotKeySpecifier_" data-uid="Terminal.Gui.TextFormatter.HotKeySpecifier*"></a>
  242. <h4 id="Terminal_Gui_TextFormatter_HotKeySpecifier" data-uid="Terminal.Gui.TextFormatter.HotKeySpecifier">HotKeySpecifier</h4>
  243. <div class="markdown level1 summary">
  244. The specifier character for the hotkey (e.g. &apos;_&apos;). Set to &apos;\xffff&apos; to disable hotkey support for this View instance. The default is &apos;\xffff&apos;.
  245. </div>
  246. <div class="markdown level1 conceptual"></div>
  247. <h5 class="decalaration">Declaration</h5>
  248. <div class="codewrapper">
  249. <pre><code class="lang-csharp hljs">public Rune HotKeySpecifier { get; set; }</code></pre>
  250. </div>
  251. <h5 class="propertyValue">Property Value</h5>
  252. <table class="table table-bordered table-striped table-condensed">
  253. <thead>
  254. <tr>
  255. <th>Type</th>
  256. <th>Description</th>
  257. </tr>
  258. </thead>
  259. <tbody>
  260. <tr>
  261. <td><span class="xref">System.Rune</span></td>
  262. <td></td>
  263. </tr>
  264. </tbody>
  265. </table>
  266. <a id="Terminal_Gui_TextFormatter_HotKeyTagMask_" data-uid="Terminal.Gui.TextFormatter.HotKeyTagMask*"></a>
  267. <h4 id="Terminal_Gui_TextFormatter_HotKeyTagMask" data-uid="Terminal.Gui.TextFormatter.HotKeyTagMask">HotKeyTagMask</h4>
  268. <div class="markdown level1 summary">
  269. Specifies the mask to apply to the hotkey to tag it as the hotkey. The default value of <code>0x100000</code> causes
  270. the underlying Rune to be identified as a &quot;private use&quot; Unicode character.
  271. </div>
  272. <div class="markdown level1 conceptual"></div>
  273. <h5 class="decalaration">Declaration</h5>
  274. <div class="codewrapper">
  275. <pre><code class="lang-csharp hljs">public uint HotKeyTagMask { get; set; }</code></pre>
  276. </div>
  277. <h5 class="propertyValue">Property Value</h5>
  278. <table class="table table-bordered table-striped table-condensed">
  279. <thead>
  280. <tr>
  281. <th>Type</th>
  282. <th>Description</th>
  283. </tr>
  284. </thead>
  285. <tbody>
  286. <tr>
  287. <td><span class="xref">System.UInt32</span></td>
  288. <td></td>
  289. </tr>
  290. </tbody>
  291. </table>
  292. <a id="Terminal_Gui_TextFormatter_Lines_" data-uid="Terminal.Gui.TextFormatter.Lines*"></a>
  293. <h4 id="Terminal_Gui_TextFormatter_Lines" data-uid="Terminal.Gui.TextFormatter.Lines">Lines</h4>
  294. <div class="markdown level1 summary">
  295. Gets the formatted lines.
  296. </div>
  297. <div class="markdown level1 conceptual"></div>
  298. <h5 class="decalaration">Declaration</h5>
  299. <div class="codewrapper">
  300. <pre><code class="lang-csharp hljs">public List&lt;ustring&gt; Lines { get; }</code></pre>
  301. </div>
  302. <h5 class="propertyValue">Property Value</h5>
  303. <table class="table table-bordered table-striped table-condensed">
  304. <thead>
  305. <tr>
  306. <th>Type</th>
  307. <th>Description</th>
  308. </tr>
  309. </thead>
  310. <tbody>
  311. <tr>
  312. <td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">NStack.ustring</span>&gt;</td>
  313. <td></td>
  314. </tr>
  315. </tbody>
  316. </table>
  317. <h5 id="Terminal_Gui_TextFormatter_Lines_remarks">Remarks</h5>
  318. <div class="markdown level1 remarks">
  319. <p>
  320. Upon a &apos;get&apos; of this property, if the text needs to be formatted (if <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_NeedsFormat">NeedsFormat</a> is <code>true</code>)
  321. <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32_">Format(ustring, Int32, Boolean, Boolean, Boolean, Int32)</a> will be called internally.
  322. </p>
  323. </div>
  324. <a id="Terminal_Gui_TextFormatter_NeedsFormat_" data-uid="Terminal.Gui.TextFormatter.NeedsFormat*"></a>
  325. <h4 id="Terminal_Gui_TextFormatter_NeedsFormat" data-uid="Terminal.Gui.TextFormatter.NeedsFormat">NeedsFormat</h4>
  326. <div class="markdown level1 summary">
  327. Gets or sets whether the <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> needs to format the text when <a class="xref" href="Terminal.Gui.TextFormatter.html#Terminal_Gui_TextFormatter_Draw_Terminal_Gui_Rect_Terminal_Gui_Attribute_Terminal_Gui_Attribute_">Draw(Rect, Attribute, Attribute)</a> is called.
  328. If it is <code>false</code> when Draw is called, the Draw call will be faster.
  329. </div>
  330. <div class="markdown level1 conceptual"></div>
  331. <h5 class="decalaration">Declaration</h5>
  332. <div class="codewrapper">
  333. <pre><code class="lang-csharp hljs">public bool NeedsFormat { get; set; }</code></pre>
  334. </div>
  335. <h5 class="propertyValue">Property Value</h5>
  336. <table class="table table-bordered table-striped table-condensed">
  337. <thead>
  338. <tr>
  339. <th>Type</th>
  340. <th>Description</th>
  341. </tr>
  342. </thead>
  343. <tbody>
  344. <tr>
  345. <td><span class="xref">System.Boolean</span></td>
  346. <td></td>
  347. </tr>
  348. </tbody>
  349. </table>
  350. <h5 id="Terminal_Gui_TextFormatter_NeedsFormat_remarks">Remarks</h5>
  351. <div class="markdown level1 remarks">
  352. <p>
  353. This is set to true when the properties of <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> are set.
  354. </p>
  355. </div>
  356. <a id="Terminal_Gui_TextFormatter_Size_" data-uid="Terminal.Gui.TextFormatter.Size*"></a>
  357. <h4 id="Terminal_Gui_TextFormatter_Size" data-uid="Terminal.Gui.TextFormatter.Size">Size</h4>
  358. <div class="markdown level1 summary">
  359. Gets or sets the size of the area the text will be constrained to when formatted.
  360. </div>
  361. <div class="markdown level1 conceptual"></div>
  362. <h5 class="decalaration">Declaration</h5>
  363. <div class="codewrapper">
  364. <pre><code class="lang-csharp hljs">public Size Size { get; set; }</code></pre>
  365. </div>
  366. <h5 class="propertyValue">Property Value</h5>
  367. <table class="table table-bordered table-striped table-condensed">
  368. <thead>
  369. <tr>
  370. <th>Type</th>
  371. <th>Description</th>
  372. </tr>
  373. </thead>
  374. <tbody>
  375. <tr>
  376. <td><a class="xref" href="Terminal.Gui.Size.html">Size</a></td>
  377. <td></td>
  378. </tr>
  379. </tbody>
  380. </table>
  381. <a id="Terminal_Gui_TextFormatter_Text_" data-uid="Terminal.Gui.TextFormatter.Text*"></a>
  382. <h4 id="Terminal_Gui_TextFormatter_Text" data-uid="Terminal.Gui.TextFormatter.Text">Text</h4>
  383. <div class="markdown level1 summary">
  384. The text to be displayed. This text is never modified.
  385. </div>
  386. <div class="markdown level1 conceptual"></div>
  387. <h5 class="decalaration">Declaration</h5>
  388. <div class="codewrapper">
  389. <pre><code class="lang-csharp hljs">public virtual ustring Text { get; set; }</code></pre>
  390. </div>
  391. <h5 class="propertyValue">Property Value</h5>
  392. <table class="table table-bordered table-striped table-condensed">
  393. <thead>
  394. <tr>
  395. <th>Type</th>
  396. <th>Description</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. <tr>
  401. <td><span class="xref">NStack.ustring</span></td>
  402. <td></td>
  403. </tr>
  404. </tbody>
  405. </table>
  406. <a id="Terminal_Gui_TextFormatter_VerticalAlignment_" data-uid="Terminal.Gui.TextFormatter.VerticalAlignment*"></a>
  407. <h4 id="Terminal_Gui_TextFormatter_VerticalAlignment" data-uid="Terminal.Gui.TextFormatter.VerticalAlignment">VerticalAlignment</h4>
  408. <div class="markdown level1 summary">
  409. Controls the vertical text-alignment property.
  410. </div>
  411. <div class="markdown level1 conceptual"></div>
  412. <h5 class="decalaration">Declaration</h5>
  413. <div class="codewrapper">
  414. <pre><code class="lang-csharp hljs">public VerticalTextAlignment VerticalAlignment { get; set; }</code></pre>
  415. </div>
  416. <h5 class="propertyValue">Property Value</h5>
  417. <table class="table table-bordered table-striped table-condensed">
  418. <thead>
  419. <tr>
  420. <th>Type</th>
  421. <th>Description</th>
  422. </tr>
  423. </thead>
  424. <tbody>
  425. <tr>
  426. <td><a class="xref" href="Terminal.Gui.VerticalTextAlignment.html">VerticalTextAlignment</a></td>
  427. <td>The text vertical alignment.</td>
  428. </tr>
  429. </tbody>
  430. </table>
  431. <h3 id="methods">Methods
  432. </h3>
  433. <a id="Terminal_Gui_TextFormatter_CalcRect_" data-uid="Terminal.Gui.TextFormatter.CalcRect*"></a>
  434. <h4 id="Terminal_Gui_TextFormatter_CalcRect_System_Int32_System_Int32_NStack_ustring_" data-uid="Terminal.Gui.TextFormatter.CalcRect(System.Int32,System.Int32,NStack.ustring)">CalcRect(Int32, Int32, ustring)</h4>
  435. <div class="markdown level1 summary">
  436. Calculates the rectangle required to hold text, assuming no word wrapping.
  437. </div>
  438. <div class="markdown level1 conceptual"></div>
  439. <h5 class="decalaration">Declaration</h5>
  440. <div class="codewrapper">
  441. <pre><code class="lang-csharp hljs">public static Rect CalcRect(int x, int y, ustring text)</code></pre>
  442. </div>
  443. <h5 class="parameters">Parameters</h5>
  444. <table class="table table-bordered table-striped table-condensed">
  445. <thead>
  446. <tr>
  447. <th>Type</th>
  448. <th>Name</th>
  449. <th>Description</th>
  450. </tr>
  451. </thead>
  452. <tbody>
  453. <tr>
  454. <td><span class="xref">System.Int32</span></td>
  455. <td><span class="parametername">x</span></td>
  456. <td>The x location of the rectangle</td>
  457. </tr>
  458. <tr>
  459. <td><span class="xref">System.Int32</span></td>
  460. <td><span class="parametername">y</span></td>
  461. <td>The y location of the rectangle</td>
  462. </tr>
  463. <tr>
  464. <td><span class="xref">NStack.ustring</span></td>
  465. <td><span class="parametername">text</span></td>
  466. <td>The text to measure</td>
  467. </tr>
  468. </tbody>
  469. </table>
  470. <h5 class="returns">Returns</h5>
  471. <table class="table table-bordered table-striped table-condensed">
  472. <thead>
  473. <tr>
  474. <th>Type</th>
  475. <th>Description</th>
  476. </tr>
  477. </thead>
  478. <tbody>
  479. <tr>
  480. <td><a class="xref" href="Terminal.Gui.Rect.html">Rect</a></td>
  481. <td></td>
  482. </tr>
  483. </tbody>
  484. </table>
  485. <a id="Terminal_Gui_TextFormatter_ClipAndJustify_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify*"></a>
  486. <h4 id="Terminal_Gui_TextFormatter_ClipAndJustify_NStack_ustring_System_Int32_System_Boolean_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify(NStack.ustring,System.Int32,System.Boolean)">ClipAndJustify(ustring, Int32, Boolean)</h4>
  487. <div class="markdown level1 summary">
  488. Justifies text within a specified width.
  489. </div>
  490. <div class="markdown level1 conceptual"></div>
  491. <h5 class="decalaration">Declaration</h5>
  492. <div class="codewrapper">
  493. <pre><code class="lang-csharp hljs">public static ustring ClipAndJustify(ustring text, int width, bool justify)</code></pre>
  494. </div>
  495. <h5 class="parameters">Parameters</h5>
  496. <table class="table table-bordered table-striped table-condensed">
  497. <thead>
  498. <tr>
  499. <th>Type</th>
  500. <th>Name</th>
  501. <th>Description</th>
  502. </tr>
  503. </thead>
  504. <tbody>
  505. <tr>
  506. <td><span class="xref">NStack.ustring</span></td>
  507. <td><span class="parametername">text</span></td>
  508. <td>The text to justify.</td>
  509. </tr>
  510. <tr>
  511. <td><span class="xref">System.Int32</span></td>
  512. <td><span class="parametername">width</span></td>
  513. <td>If the text length is greater that <code>width</code> it will be clipped.</td>
  514. </tr>
  515. <tr>
  516. <td><span class="xref">System.Boolean</span></td>
  517. <td><span class="parametername">justify</span></td>
  518. <td>Justify.</td>
  519. </tr>
  520. </tbody>
  521. </table>
  522. <h5 class="returns">Returns</h5>
  523. <table class="table table-bordered table-striped table-condensed">
  524. <thead>
  525. <tr>
  526. <th>Type</th>
  527. <th>Description</th>
  528. </tr>
  529. </thead>
  530. <tbody>
  531. <tr>
  532. <td><span class="xref">NStack.ustring</span></td>
  533. <td>Justified and clipped text.</td>
  534. </tr>
  535. </tbody>
  536. </table>
  537. <a id="Terminal_Gui_TextFormatter_ClipAndJustify_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify*"></a>
  538. <h4 id="Terminal_Gui_TextFormatter_ClipAndJustify_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_" data-uid="Terminal.Gui.TextFormatter.ClipAndJustify(NStack.ustring,System.Int32,Terminal.Gui.TextAlignment)">ClipAndJustify(ustring, Int32, TextAlignment)</h4>
  539. <div class="markdown level1 summary">
  540. Justifies text within a specified width.
  541. </div>
  542. <div class="markdown level1 conceptual"></div>
  543. <h5 class="decalaration">Declaration</h5>
  544. <div class="codewrapper">
  545. <pre><code class="lang-csharp hljs">public static ustring ClipAndJustify(ustring text, int width, TextAlignment talign)</code></pre>
  546. </div>
  547. <h5 class="parameters">Parameters</h5>
  548. <table class="table table-bordered table-striped table-condensed">
  549. <thead>
  550. <tr>
  551. <th>Type</th>
  552. <th>Name</th>
  553. <th>Description</th>
  554. </tr>
  555. </thead>
  556. <tbody>
  557. <tr>
  558. <td><span class="xref">NStack.ustring</span></td>
  559. <td><span class="parametername">text</span></td>
  560. <td>The text to justify.</td>
  561. </tr>
  562. <tr>
  563. <td><span class="xref">System.Int32</span></td>
  564. <td><span class="parametername">width</span></td>
  565. <td>If the text length is greater that <code>width</code> it will be clipped.</td>
  566. </tr>
  567. <tr>
  568. <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
  569. <td><span class="parametername">talign</span></td>
  570. <td>Alignment.</td>
  571. </tr>
  572. </tbody>
  573. </table>
  574. <h5 class="returns">Returns</h5>
  575. <table class="table table-bordered table-striped table-condensed">
  576. <thead>
  577. <tr>
  578. <th>Type</th>
  579. <th>Description</th>
  580. </tr>
  581. </thead>
  582. <tbody>
  583. <tr>
  584. <td><span class="xref">NStack.ustring</span></td>
  585. <td>Justified and clipped text.</td>
  586. </tr>
  587. </tbody>
  588. </table>
  589. <a id="Terminal_Gui_TextFormatter_Draw_" data-uid="Terminal.Gui.TextFormatter.Draw*"></a>
  590. <h4 id="Terminal_Gui_TextFormatter_Draw_Terminal_Gui_Rect_Terminal_Gui_Attribute_Terminal_Gui_Attribute_" data-uid="Terminal.Gui.TextFormatter.Draw(Terminal.Gui.Rect,Terminal.Gui.Attribute,Terminal.Gui.Attribute)">Draw(Rect, Attribute, Attribute)</h4>
  591. <div class="markdown level1 summary">
  592. Draws the text held by <a class="xref" href="Terminal.Gui.TextFormatter.html">TextFormatter</a> to <a class="xref" href="Terminal.Gui.Application.html#Terminal_Gui_Application_Driver">Driver</a> using the colors specified.
  593. </div>
  594. <div class="markdown level1 conceptual"></div>
  595. <h5 class="decalaration">Declaration</h5>
  596. <div class="codewrapper">
  597. <pre><code class="lang-csharp hljs">public void Draw(Rect bounds, Attribute normalColor, Attribute hotColor)</code></pre>
  598. </div>
  599. <h5 class="parameters">Parameters</h5>
  600. <table class="table table-bordered table-striped table-condensed">
  601. <thead>
  602. <tr>
  603. <th>Type</th>
  604. <th>Name</th>
  605. <th>Description</th>
  606. </tr>
  607. </thead>
  608. <tbody>
  609. <tr>
  610. <td><a class="xref" href="Terminal.Gui.Rect.html">Rect</a></td>
  611. <td><span class="parametername">bounds</span></td>
  612. <td>Specifies the screen-relative location and maximum size for drawing the text.</td>
  613. </tr>
  614. <tr>
  615. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  616. <td><span class="parametername">normalColor</span></td>
  617. <td>The color to use for all text except the hotkey</td>
  618. </tr>
  619. <tr>
  620. <td><a class="xref" href="Terminal.Gui.Attribute.html">Attribute</a></td>
  621. <td><span class="parametername">hotColor</span></td>
  622. <td>The color to use to draw the hotkey</td>
  623. </tr>
  624. </tbody>
  625. </table>
  626. <a id="Terminal_Gui_TextFormatter_FindHotKey_" data-uid="Terminal.Gui.TextFormatter.FindHotKey*"></a>
  627. <h4 id="Terminal_Gui_TextFormatter_FindHotKey_NStack_ustring_System_Rune_System_Boolean_System_Int32__Terminal_Gui_Key__" data-uid="Terminal.Gui.TextFormatter.FindHotKey(NStack.ustring,System.Rune,System.Boolean,System.Int32@,Terminal.Gui.Key@)">FindHotKey(ustring, Rune, Boolean, out Int32, out Key)</h4>
  628. <div class="markdown level1 summary">
  629. Finds the hotkey and its location in text.
  630. </div>
  631. <div class="markdown level1 conceptual"></div>
  632. <h5 class="decalaration">Declaration</h5>
  633. <div class="codewrapper">
  634. <pre><code class="lang-csharp hljs">public static bool FindHotKey(ustring text, Rune hotKeySpecifier, bool firstUpperCase, out int hotPos, out Key hotKey)</code></pre>
  635. </div>
  636. <h5 class="parameters">Parameters</h5>
  637. <table class="table table-bordered table-striped table-condensed">
  638. <thead>
  639. <tr>
  640. <th>Type</th>
  641. <th>Name</th>
  642. <th>Description</th>
  643. </tr>
  644. </thead>
  645. <tbody>
  646. <tr>
  647. <td><span class="xref">NStack.ustring</span></td>
  648. <td><span class="parametername">text</span></td>
  649. <td>The text to look in.</td>
  650. </tr>
  651. <tr>
  652. <td><span class="xref">System.Rune</span></td>
  653. <td><span class="parametername">hotKeySpecifier</span></td>
  654. <td>The hotkey specifier (e.g. &apos;_&apos;) to look for.</td>
  655. </tr>
  656. <tr>
  657. <td><span class="xref">System.Boolean</span></td>
  658. <td><span class="parametername">firstUpperCase</span></td>
  659. <td>If <code>true</code> the legacy behavior of identifying the first upper case character as the hotkey will be enabled.
  660. Regardless of the value of this parameter, <code>hotKeySpecifier</code> takes precedence.</td>
  661. </tr>
  662. <tr>
  663. <td><span class="xref">System.Int32</span></td>
  664. <td><span class="parametername">hotPos</span></td>
  665. <td>Outputs the Rune index into <code>text</code>.</td>
  666. </tr>
  667. <tr>
  668. <td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
  669. <td><span class="parametername">hotKey</span></td>
  670. <td>Outputs the hotKey.</td>
  671. </tr>
  672. </tbody>
  673. </table>
  674. <h5 class="returns">Returns</h5>
  675. <table class="table table-bordered table-striped table-condensed">
  676. <thead>
  677. <tr>
  678. <th>Type</th>
  679. <th>Description</th>
  680. </tr>
  681. </thead>
  682. <tbody>
  683. <tr>
  684. <td><span class="xref">System.Boolean</span></td>
  685. <td><code>true</code> if a hotkey was found; <code>false</code> otherwise.</td>
  686. </tr>
  687. </tbody>
  688. </table>
  689. <a id="Terminal_Gui_TextFormatter_Format_" data-uid="Terminal.Gui.TextFormatter.Format*"></a>
  690. <h4 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.Format(NStack.ustring,System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Int32)">Format(ustring, Int32, Boolean, Boolean, Boolean, Int32)</h4>
  691. <div class="markdown level1 summary">
  692. Reformats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries.
  693. </div>
  694. <div class="markdown level1 conceptual"></div>
  695. <h5 class="decalaration">Declaration</h5>
  696. <div class="codewrapper">
  697. <pre><code class="lang-csharp hljs">public static List&lt;ustring&gt; Format(ustring text, int width, bool justify, bool wordWrap, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
  698. </div>
  699. <h5 class="parameters">Parameters</h5>
  700. <table class="table table-bordered table-striped table-condensed">
  701. <thead>
  702. <tr>
  703. <th>Type</th>
  704. <th>Name</th>
  705. <th>Description</th>
  706. </tr>
  707. </thead>
  708. <tbody>
  709. <tr>
  710. <td><span class="xref">NStack.ustring</span></td>
  711. <td><span class="parametername">text</span></td>
  712. <td></td>
  713. </tr>
  714. <tr>
  715. <td><span class="xref">System.Int32</span></td>
  716. <td><span class="parametername">width</span></td>
  717. <td>The width to bound the text to for word wrapping and clipping.</td>
  718. </tr>
  719. <tr>
  720. <td><span class="xref">System.Boolean</span></td>
  721. <td><span class="parametername">justify</span></td>
  722. <td>Specifies whether the text should be justified.</td>
  723. </tr>
  724. <tr>
  725. <td><span class="xref">System.Boolean</span></td>
  726. <td><span class="parametername">wordWrap</span></td>
  727. <td>If <code>true</code>, the text will be wrapped to new lines as need. If <code>false</code>, forces text to fit a single line. Line breaks are converted to spaces. The text will be clipped to <code>width</code></td>
  728. </tr>
  729. <tr>
  730. <td><span class="xref">System.Boolean</span></td>
  731. <td><span class="parametername">preserveTrailingSpaces</span></td>
  732. <td>If <code>true</code> and &apos;wordWrap&apos; also true, the wrapped text will keep the trailing spaces. If <code>false</code>, the trailing spaces will be trimmed.</td>
  733. </tr>
  734. <tr>
  735. <td><span class="xref">System.Int32</span></td>
  736. <td><span class="parametername">tabWidth</span></td>
  737. <td>The tab width.</td>
  738. </tr>
  739. </tbody>
  740. </table>
  741. <h5 class="returns">Returns</h5>
  742. <table class="table table-bordered table-striped table-condensed">
  743. <thead>
  744. <tr>
  745. <th>Type</th>
  746. <th>Description</th>
  747. </tr>
  748. </thead>
  749. <tbody>
  750. <tr>
  751. <td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">NStack.ustring</span>&gt;</td>
  752. <td>A list of word wrapped lines.</td>
  753. </tr>
  754. </tbody>
  755. </table>
  756. <h5 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Int32__remarks">Remarks</h5>
  757. <div class="markdown level1 remarks">
  758. <p>
  759. An empty <code>text</code> string will result in one empty line.
  760. </p>
  761. <p>
  762. If <code>width</code> is 0, a single, empty line will be returned.
  763. </p>
  764. <p>
  765. If <code>width</code> is int.MaxValue, the text will be formatted to the maximum width possible.
  766. </p>
  767. </div>
  768. <a id="Terminal_Gui_TextFormatter_Format_" data-uid="Terminal.Gui.TextFormatter.Format*"></a>
  769. <h4 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_System_Boolean_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.Format(NStack.ustring,System.Int32,Terminal.Gui.TextAlignment,System.Boolean,System.Boolean,System.Int32)">Format(ustring, Int32, TextAlignment, Boolean, Boolean, Int32)</h4>
  770. <div class="markdown level1 summary">
  771. Reformats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries.
  772. </div>
  773. <div class="markdown level1 conceptual"></div>
  774. <h5 class="decalaration">Declaration</h5>
  775. <div class="codewrapper">
  776. <pre><code class="lang-csharp hljs">public static List&lt;ustring&gt; Format(ustring text, int width, TextAlignment talign, bool wordWrap, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
  777. </div>
  778. <h5 class="parameters">Parameters</h5>
  779. <table class="table table-bordered table-striped table-condensed">
  780. <thead>
  781. <tr>
  782. <th>Type</th>
  783. <th>Name</th>
  784. <th>Description</th>
  785. </tr>
  786. </thead>
  787. <tbody>
  788. <tr>
  789. <td><span class="xref">NStack.ustring</span></td>
  790. <td><span class="parametername">text</span></td>
  791. <td></td>
  792. </tr>
  793. <tr>
  794. <td><span class="xref">System.Int32</span></td>
  795. <td><span class="parametername">width</span></td>
  796. <td>The width to bound the text to for word wrapping and clipping.</td>
  797. </tr>
  798. <tr>
  799. <td><a class="xref" href="Terminal.Gui.TextAlignment.html">TextAlignment</a></td>
  800. <td><span class="parametername">talign</span></td>
  801. <td>Specifies how the text will be aligned horizontally.</td>
  802. </tr>
  803. <tr>
  804. <td><span class="xref">System.Boolean</span></td>
  805. <td><span class="parametername">wordWrap</span></td>
  806. <td>If <code>true</code>, the text will be wrapped to new lines as need. If <code>false</code>, forces text to fit a single line. Line breaks are converted to spaces. The text will be clipped to <code>width</code></td>
  807. </tr>
  808. <tr>
  809. <td><span class="xref">System.Boolean</span></td>
  810. <td><span class="parametername">preserveTrailingSpaces</span></td>
  811. <td>If <code>true</code> and &apos;wordWrap&apos; also true, the wrapped text will keep the trailing spaces. If <code>false</code>, the trailing spaces will be trimmed.</td>
  812. </tr>
  813. <tr>
  814. <td><span class="xref">System.Int32</span></td>
  815. <td><span class="parametername">tabWidth</span></td>
  816. <td>The tab width.</td>
  817. </tr>
  818. </tbody>
  819. </table>
  820. <h5 class="returns">Returns</h5>
  821. <table class="table table-bordered table-striped table-condensed">
  822. <thead>
  823. <tr>
  824. <th>Type</th>
  825. <th>Description</th>
  826. </tr>
  827. </thead>
  828. <tbody>
  829. <tr>
  830. <td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">NStack.ustring</span>&gt;</td>
  831. <td>A list of word wrapped lines.</td>
  832. </tr>
  833. </tbody>
  834. </table>
  835. <h5 id="Terminal_Gui_TextFormatter_Format_NStack_ustring_System_Int32_Terminal_Gui_TextAlignment_System_Boolean_System_Boolean_System_Int32__remarks">Remarks</h5>
  836. <div class="markdown level1 remarks">
  837. <p>
  838. An empty <code>text</code> string will result in one empty line.
  839. </p>
  840. <p>
  841. If <code>width</code> is 0, a single, empty line will be returned.
  842. </p>
  843. <p>
  844. If <code>width</code> is int.MaxValue, the text will be formatted to the maximum width possible.
  845. </p>
  846. </div>
  847. <a id="Terminal_Gui_TextFormatter_IsHorizontalDirection_" data-uid="Terminal.Gui.TextFormatter.IsHorizontalDirection*"></a>
  848. <h4 id="Terminal_Gui_TextFormatter_IsHorizontalDirection_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsHorizontalDirection(Terminal.Gui.TextDirection)">IsHorizontalDirection(TextDirection)</h4>
  849. <div class="markdown level1 summary">
  850. Check if it is a horizontal direction
  851. </div>
  852. <div class="markdown level1 conceptual"></div>
  853. <h5 class="decalaration">Declaration</h5>
  854. <div class="codewrapper">
  855. <pre><code class="lang-csharp hljs">public static bool IsHorizontalDirection(TextDirection textDirection)</code></pre>
  856. </div>
  857. <h5 class="parameters">Parameters</h5>
  858. <table class="table table-bordered table-striped table-condensed">
  859. <thead>
  860. <tr>
  861. <th>Type</th>
  862. <th>Name</th>
  863. <th>Description</th>
  864. </tr>
  865. </thead>
  866. <tbody>
  867. <tr>
  868. <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
  869. <td><span class="parametername">textDirection</span></td>
  870. <td></td>
  871. </tr>
  872. </tbody>
  873. </table>
  874. <h5 class="returns">Returns</h5>
  875. <table class="table table-bordered table-striped table-condensed">
  876. <thead>
  877. <tr>
  878. <th>Type</th>
  879. <th>Description</th>
  880. </tr>
  881. </thead>
  882. <tbody>
  883. <tr>
  884. <td><span class="xref">System.Boolean</span></td>
  885. <td></td>
  886. </tr>
  887. </tbody>
  888. </table>
  889. <a id="Terminal_Gui_TextFormatter_IsLeftToRight_" data-uid="Terminal.Gui.TextFormatter.IsLeftToRight*"></a>
  890. <h4 id="Terminal_Gui_TextFormatter_IsLeftToRight_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsLeftToRight(Terminal.Gui.TextDirection)">IsLeftToRight(TextDirection)</h4>
  891. <div class="markdown level1 summary">
  892. Check if it is Left to Right direction
  893. </div>
  894. <div class="markdown level1 conceptual"></div>
  895. <h5 class="decalaration">Declaration</h5>
  896. <div class="codewrapper">
  897. <pre><code class="lang-csharp hljs">public static bool IsLeftToRight(TextDirection textDirection)</code></pre>
  898. </div>
  899. <h5 class="parameters">Parameters</h5>
  900. <table class="table table-bordered table-striped table-condensed">
  901. <thead>
  902. <tr>
  903. <th>Type</th>
  904. <th>Name</th>
  905. <th>Description</th>
  906. </tr>
  907. </thead>
  908. <tbody>
  909. <tr>
  910. <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
  911. <td><span class="parametername">textDirection</span></td>
  912. <td></td>
  913. </tr>
  914. </tbody>
  915. </table>
  916. <h5 class="returns">Returns</h5>
  917. <table class="table table-bordered table-striped table-condensed">
  918. <thead>
  919. <tr>
  920. <th>Type</th>
  921. <th>Description</th>
  922. </tr>
  923. </thead>
  924. <tbody>
  925. <tr>
  926. <td><span class="xref">System.Boolean</span></td>
  927. <td></td>
  928. </tr>
  929. </tbody>
  930. </table>
  931. <a id="Terminal_Gui_TextFormatter_IsTopToBottom_" data-uid="Terminal.Gui.TextFormatter.IsTopToBottom*"></a>
  932. <h4 id="Terminal_Gui_TextFormatter_IsTopToBottom_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsTopToBottom(Terminal.Gui.TextDirection)">IsTopToBottom(TextDirection)</h4>
  933. <div class="markdown level1 summary">
  934. Check if it is Top to Bottom direction
  935. </div>
  936. <div class="markdown level1 conceptual"></div>
  937. <h5 class="decalaration">Declaration</h5>
  938. <div class="codewrapper">
  939. <pre><code class="lang-csharp hljs">public static bool IsTopToBottom(TextDirection textDirection)</code></pre>
  940. </div>
  941. <h5 class="parameters">Parameters</h5>
  942. <table class="table table-bordered table-striped table-condensed">
  943. <thead>
  944. <tr>
  945. <th>Type</th>
  946. <th>Name</th>
  947. <th>Description</th>
  948. </tr>
  949. </thead>
  950. <tbody>
  951. <tr>
  952. <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
  953. <td><span class="parametername">textDirection</span></td>
  954. <td></td>
  955. </tr>
  956. </tbody>
  957. </table>
  958. <h5 class="returns">Returns</h5>
  959. <table class="table table-bordered table-striped table-condensed">
  960. <thead>
  961. <tr>
  962. <th>Type</th>
  963. <th>Description</th>
  964. </tr>
  965. </thead>
  966. <tbody>
  967. <tr>
  968. <td><span class="xref">System.Boolean</span></td>
  969. <td></td>
  970. </tr>
  971. </tbody>
  972. </table>
  973. <a id="Terminal_Gui_TextFormatter_IsVerticalDirection_" data-uid="Terminal.Gui.TextFormatter.IsVerticalDirection*"></a>
  974. <h4 id="Terminal_Gui_TextFormatter_IsVerticalDirection_Terminal_Gui_TextDirection_" data-uid="Terminal.Gui.TextFormatter.IsVerticalDirection(Terminal.Gui.TextDirection)">IsVerticalDirection(TextDirection)</h4>
  975. <div class="markdown level1 summary">
  976. Check if it is a vertical direction
  977. </div>
  978. <div class="markdown level1 conceptual"></div>
  979. <h5 class="decalaration">Declaration</h5>
  980. <div class="codewrapper">
  981. <pre><code class="lang-csharp hljs">public static bool IsVerticalDirection(TextDirection textDirection)</code></pre>
  982. </div>
  983. <h5 class="parameters">Parameters</h5>
  984. <table class="table table-bordered table-striped table-condensed">
  985. <thead>
  986. <tr>
  987. <th>Type</th>
  988. <th>Name</th>
  989. <th>Description</th>
  990. </tr>
  991. </thead>
  992. <tbody>
  993. <tr>
  994. <td><a class="xref" href="Terminal.Gui.TextDirection.html">TextDirection</a></td>
  995. <td><span class="parametername">textDirection</span></td>
  996. <td></td>
  997. </tr>
  998. </tbody>
  999. </table>
  1000. <h5 class="returns">Returns</h5>
  1001. <table class="table table-bordered table-striped table-condensed">
  1002. <thead>
  1003. <tr>
  1004. <th>Type</th>
  1005. <th>Description</th>
  1006. </tr>
  1007. </thead>
  1008. <tbody>
  1009. <tr>
  1010. <td><span class="xref">System.Boolean</span></td>
  1011. <td></td>
  1012. </tr>
  1013. </tbody>
  1014. </table>
  1015. <a id="Terminal_Gui_TextFormatter_Justify_" data-uid="Terminal.Gui.TextFormatter.Justify*"></a>
  1016. <h4 id="Terminal_Gui_TextFormatter_Justify_NStack_ustring_System_Int32_System_Char_" data-uid="Terminal.Gui.TextFormatter.Justify(NStack.ustring,System.Int32,System.Char)">Justify(ustring, Int32, Char)</h4>
  1017. <div class="markdown level1 summary">
  1018. Justifies the text to fill the width provided. Space will be added between words (demarked by spaces and tabs) to
  1019. make the text just fit <code>width</code>. Spaces will not be added to the ends.
  1020. </div>
  1021. <div class="markdown level1 conceptual"></div>
  1022. <h5 class="decalaration">Declaration</h5>
  1023. <div class="codewrapper">
  1024. <pre><code class="lang-csharp hljs">public static ustring Justify(ustring text, int width, char spaceChar = ' ')</code></pre>
  1025. </div>
  1026. <h5 class="parameters">Parameters</h5>
  1027. <table class="table table-bordered table-striped table-condensed">
  1028. <thead>
  1029. <tr>
  1030. <th>Type</th>
  1031. <th>Name</th>
  1032. <th>Description</th>
  1033. </tr>
  1034. </thead>
  1035. <tbody>
  1036. <tr>
  1037. <td><span class="xref">NStack.ustring</span></td>
  1038. <td><span class="parametername">text</span></td>
  1039. <td></td>
  1040. </tr>
  1041. <tr>
  1042. <td><span class="xref">System.Int32</span></td>
  1043. <td><span class="parametername">width</span></td>
  1044. <td></td>
  1045. </tr>
  1046. <tr>
  1047. <td><span class="xref">System.Char</span></td>
  1048. <td><span class="parametername">spaceChar</span></td>
  1049. <td>Character to replace whitespace and pad with. For debugging purposes.</td>
  1050. </tr>
  1051. </tbody>
  1052. </table>
  1053. <h5 class="returns">Returns</h5>
  1054. <table class="table table-bordered table-striped table-condensed">
  1055. <thead>
  1056. <tr>
  1057. <th>Type</th>
  1058. <th>Description</th>
  1059. </tr>
  1060. </thead>
  1061. <tbody>
  1062. <tr>
  1063. <td><span class="xref">NStack.ustring</span></td>
  1064. <td>The justified text.</td>
  1065. </tr>
  1066. </tbody>
  1067. </table>
  1068. <a id="Terminal_Gui_TextFormatter_MaxLines_" data-uid="Terminal.Gui.TextFormatter.MaxLines*"></a>
  1069. <h4 id="Terminal_Gui_TextFormatter_MaxLines_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.MaxLines(NStack.ustring,System.Int32)">MaxLines(ustring, Int32)</h4>
  1070. <div class="markdown level1 summary">
  1071. Computes the number of lines needed to render the specified text given the width.
  1072. </div>
  1073. <div class="markdown level1 conceptual"></div>
  1074. <h5 class="decalaration">Declaration</h5>
  1075. <div class="codewrapper">
  1076. <pre><code class="lang-csharp hljs">public static int MaxLines(ustring text, int width)</code></pre>
  1077. </div>
  1078. <h5 class="parameters">Parameters</h5>
  1079. <table class="table table-bordered table-striped table-condensed">
  1080. <thead>
  1081. <tr>
  1082. <th>Type</th>
  1083. <th>Name</th>
  1084. <th>Description</th>
  1085. </tr>
  1086. </thead>
  1087. <tbody>
  1088. <tr>
  1089. <td><span class="xref">NStack.ustring</span></td>
  1090. <td><span class="parametername">text</span></td>
  1091. <td>Text, may contain newlines.</td>
  1092. </tr>
  1093. <tr>
  1094. <td><span class="xref">System.Int32</span></td>
  1095. <td><span class="parametername">width</span></td>
  1096. <td>The minimum width for the text.</td>
  1097. </tr>
  1098. </tbody>
  1099. </table>
  1100. <h5 class="returns">Returns</h5>
  1101. <table class="table table-bordered table-striped table-condensed">
  1102. <thead>
  1103. <tr>
  1104. <th>Type</th>
  1105. <th>Description</th>
  1106. </tr>
  1107. </thead>
  1108. <tbody>
  1109. <tr>
  1110. <td><span class="xref">System.Int32</span></td>
  1111. <td>Number of lines.</td>
  1112. </tr>
  1113. </tbody>
  1114. </table>
  1115. <a id="Terminal_Gui_TextFormatter_MaxWidth_" data-uid="Terminal.Gui.TextFormatter.MaxWidth*"></a>
  1116. <h4 id="Terminal_Gui_TextFormatter_MaxWidth_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.MaxWidth(NStack.ustring,System.Int32)">MaxWidth(ustring, Int32)</h4>
  1117. <div class="markdown level1 summary">
  1118. Computes the maximum width needed to render the text (single line or multiple lines) given a minimum width.
  1119. </div>
  1120. <div class="markdown level1 conceptual"></div>
  1121. <h5 class="decalaration">Declaration</h5>
  1122. <div class="codewrapper">
  1123. <pre><code class="lang-csharp hljs">public static int MaxWidth(ustring text, int width)</code></pre>
  1124. </div>
  1125. <h5 class="parameters">Parameters</h5>
  1126. <table class="table table-bordered table-striped table-condensed">
  1127. <thead>
  1128. <tr>
  1129. <th>Type</th>
  1130. <th>Name</th>
  1131. <th>Description</th>
  1132. </tr>
  1133. </thead>
  1134. <tbody>
  1135. <tr>
  1136. <td><span class="xref">NStack.ustring</span></td>
  1137. <td><span class="parametername">text</span></td>
  1138. <td>Text, may contain newlines.</td>
  1139. </tr>
  1140. <tr>
  1141. <td><span class="xref">System.Int32</span></td>
  1142. <td><span class="parametername">width</span></td>
  1143. <td>The minimum width for the text.</td>
  1144. </tr>
  1145. </tbody>
  1146. </table>
  1147. <h5 class="returns">Returns</h5>
  1148. <table class="table table-bordered table-striped table-condensed">
  1149. <thead>
  1150. <tr>
  1151. <th>Type</th>
  1152. <th>Description</th>
  1153. </tr>
  1154. </thead>
  1155. <tbody>
  1156. <tr>
  1157. <td><span class="xref">System.Int32</span></td>
  1158. <td>Max width of lines.</td>
  1159. </tr>
  1160. </tbody>
  1161. </table>
  1162. <a id="Terminal_Gui_TextFormatter_RemoveHotKeySpecifier_" data-uid="Terminal.Gui.TextFormatter.RemoveHotKeySpecifier*"></a>
  1163. <h4 id="Terminal_Gui_TextFormatter_RemoveHotKeySpecifier_NStack_ustring_System_Int32_System_Rune_" data-uid="Terminal.Gui.TextFormatter.RemoveHotKeySpecifier(NStack.ustring,System.Int32,System.Rune)">RemoveHotKeySpecifier(ustring, Int32, Rune)</h4>
  1164. <div class="markdown level1 summary">
  1165. Removes the hotkey specifier from text.
  1166. </div>
  1167. <div class="markdown level1 conceptual"></div>
  1168. <h5 class="decalaration">Declaration</h5>
  1169. <div class="codewrapper">
  1170. <pre><code class="lang-csharp hljs">public static ustring RemoveHotKeySpecifier(ustring text, int hotPos, Rune hotKeySpecifier)</code></pre>
  1171. </div>
  1172. <h5 class="parameters">Parameters</h5>
  1173. <table class="table table-bordered table-striped table-condensed">
  1174. <thead>
  1175. <tr>
  1176. <th>Type</th>
  1177. <th>Name</th>
  1178. <th>Description</th>
  1179. </tr>
  1180. </thead>
  1181. <tbody>
  1182. <tr>
  1183. <td><span class="xref">NStack.ustring</span></td>
  1184. <td><span class="parametername">text</span></td>
  1185. <td>The text to manipulate.</td>
  1186. </tr>
  1187. <tr>
  1188. <td><span class="xref">System.Int32</span></td>
  1189. <td><span class="parametername">hotPos</span></td>
  1190. <td>Returns the position of the hot-key in the text. -1 if not found.</td>
  1191. </tr>
  1192. <tr>
  1193. <td><span class="xref">System.Rune</span></td>
  1194. <td><span class="parametername">hotKeySpecifier</span></td>
  1195. <td>The hot-key specifier (e.g. &apos;_&apos;) to look for.</td>
  1196. </tr>
  1197. </tbody>
  1198. </table>
  1199. <h5 class="returns">Returns</h5>
  1200. <table class="table table-bordered table-striped table-condensed">
  1201. <thead>
  1202. <tr>
  1203. <th>Type</th>
  1204. <th>Description</th>
  1205. </tr>
  1206. </thead>
  1207. <tbody>
  1208. <tr>
  1209. <td><span class="xref">NStack.ustring</span></td>
  1210. <td>The input text with the hotkey specifier (&apos;_&apos;) removed.</td>
  1211. </tr>
  1212. </tbody>
  1213. </table>
  1214. <a id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_" data-uid="Terminal.Gui.TextFormatter.ReplaceHotKeyWithTag*"></a>
  1215. <h4 id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_NStack_ustring_System_Int32_" data-uid="Terminal.Gui.TextFormatter.ReplaceHotKeyWithTag(NStack.ustring,System.Int32)">ReplaceHotKeyWithTag(ustring, Int32)</h4>
  1216. <div class="markdown level1 summary">
  1217. Replaces the Rune at the index specified by the <code>hotPos</code> parameter with a tag identifying
  1218. it as the hotkey.
  1219. </div>
  1220. <div class="markdown level1 conceptual"></div>
  1221. <h5 class="decalaration">Declaration</h5>
  1222. <div class="codewrapper">
  1223. <pre><code class="lang-csharp hljs">public ustring ReplaceHotKeyWithTag(ustring text, int hotPos)</code></pre>
  1224. </div>
  1225. <h5 class="parameters">Parameters</h5>
  1226. <table class="table table-bordered table-striped table-condensed">
  1227. <thead>
  1228. <tr>
  1229. <th>Type</th>
  1230. <th>Name</th>
  1231. <th>Description</th>
  1232. </tr>
  1233. </thead>
  1234. <tbody>
  1235. <tr>
  1236. <td><span class="xref">NStack.ustring</span></td>
  1237. <td><span class="parametername">text</span></td>
  1238. <td>The text to tag the hotkey in.</td>
  1239. </tr>
  1240. <tr>
  1241. <td><span class="xref">System.Int32</span></td>
  1242. <td><span class="parametername">hotPos</span></td>
  1243. <td>The Rune index of the hotkey in <code>text</code>.</td>
  1244. </tr>
  1245. </tbody>
  1246. </table>
  1247. <h5 class="returns">Returns</h5>
  1248. <table class="table table-bordered table-striped table-condensed">
  1249. <thead>
  1250. <tr>
  1251. <th>Type</th>
  1252. <th>Description</th>
  1253. </tr>
  1254. </thead>
  1255. <tbody>
  1256. <tr>
  1257. <td><span class="xref">NStack.ustring</span></td>
  1258. <td>The text with the hotkey tagged.</td>
  1259. </tr>
  1260. </tbody>
  1261. </table>
  1262. <h5 id="Terminal_Gui_TextFormatter_ReplaceHotKeyWithTag_NStack_ustring_System_Int32__remarks">Remarks</h5>
  1263. <div class="markdown level1 remarks">
  1264. The returned string will not render correctly without first un-doing the tag. To undo the tag, search for
  1265. Runes with a bitmask of <code>otKeyTagMask</code> and remove that bitmask.
  1266. </div>
  1267. <a id="Terminal_Gui_TextFormatter_WordWrap_" data-uid="Terminal.Gui.TextFormatter.WordWrap*"></a>
  1268. <h4 id="Terminal_Gui_TextFormatter_WordWrap_NStack_ustring_System_Int32_System_Boolean_System_Int32_" data-uid="Terminal.Gui.TextFormatter.WordWrap(NStack.ustring,System.Int32,System.Boolean,System.Int32)">WordWrap(ustring, Int32, Boolean, Int32)</h4>
  1269. <div class="markdown level1 summary">
  1270. Formats the provided text to fit within the width provided using word wrapping.
  1271. </div>
  1272. <div class="markdown level1 conceptual"></div>
  1273. <h5 class="decalaration">Declaration</h5>
  1274. <div class="codewrapper">
  1275. <pre><code class="lang-csharp hljs">public static List&lt;ustring&gt; WordWrap(ustring text, int width, bool preserveTrailingSpaces = false, int tabWidth = 0)</code></pre>
  1276. </div>
  1277. <h5 class="parameters">Parameters</h5>
  1278. <table class="table table-bordered table-striped table-condensed">
  1279. <thead>
  1280. <tr>
  1281. <th>Type</th>
  1282. <th>Name</th>
  1283. <th>Description</th>
  1284. </tr>
  1285. </thead>
  1286. <tbody>
  1287. <tr>
  1288. <td><span class="xref">NStack.ustring</span></td>
  1289. <td><span class="parametername">text</span></td>
  1290. <td>The text to word wrap</td>
  1291. </tr>
  1292. <tr>
  1293. <td><span class="xref">System.Int32</span></td>
  1294. <td><span class="parametername">width</span></td>
  1295. <td>The width to contain the text to</td>
  1296. </tr>
  1297. <tr>
  1298. <td><span class="xref">System.Boolean</span></td>
  1299. <td><span class="parametername">preserveTrailingSpaces</span></td>
  1300. <td>If <code>true</code>, the wrapped text will keep the trailing spaces.
  1301. If <code>false</code>, the trailing spaces will be trimmed.</td>
  1302. </tr>
  1303. <tr>
  1304. <td><span class="xref">System.Int32</span></td>
  1305. <td><span class="parametername">tabWidth</span></td>
  1306. <td>The tab width.</td>
  1307. </tr>
  1308. </tbody>
  1309. </table>
  1310. <h5 class="returns">Returns</h5>
  1311. <table class="table table-bordered table-striped table-condensed">
  1312. <thead>
  1313. <tr>
  1314. <th>Type</th>
  1315. <th>Description</th>
  1316. </tr>
  1317. </thead>
  1318. <tbody>
  1319. <tr>
  1320. <td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">NStack.ustring</span>&gt;</td>
  1321. <td>Returns a list of word wrapped lines.</td>
  1322. </tr>
  1323. </tbody>
  1324. </table>
  1325. <h5 id="Terminal_Gui_TextFormatter_WordWrap_NStack_ustring_System_Int32_System_Boolean_System_Int32__remarks">Remarks</h5>
  1326. <div class="markdown level1 remarks">
  1327. <p>
  1328. This method does not do any justification.
  1329. </p>
  1330. <p>
  1331. This method strips Newline (&apos;\n&apos; and &apos;\r\n&apos;) sequences before processing.
  1332. </p>
  1333. </div>
  1334. </article>
  1335. </div>
  1336. <div class="hidden-sm col-md-2" role="complementary">
  1337. <div class="sideaffix">
  1338. <div class="contribution">
  1339. <ul class="nav">
  1340. </ul>
  1341. </div>
  1342. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  1343. <h5>In This Article</h5>
  1344. <div></div>
  1345. </nav>
  1346. </div>
  1347. </div>
  1348. </div>
  1349. </div>
  1350. <footer>
  1351. <div class="grad-bottom"></div>
  1352. <div class="footer">
  1353. <div class="container">
  1354. <span class="pull-right">
  1355. <a href="#top">Back to top</a>
  1356. </span>
  1357. <span>Generated by <strong>DocFX</strong></span>
  1358. </div>
  1359. </div>
  1360. </footer>
  1361. </div>
  1362. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  1363. <script type="text/javascript" src="../../styles/docfx.js"></script>
  1364. <script type="text/javascript" src="../../styles/main.js"></script>
  1365. </body>
  1366. </html>