TextFormatterTests.cs 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160
  1. using System.Text;
  2. using UICatalog;
  3. using UnitTests;
  4. using Xunit.Abstractions;
  5. // Alias Console to MockConsole so we don't accidentally use Console
  6. namespace Terminal.Gui.TextTests;
  7. public class TextFormatterTests
  8. {
  9. public TextFormatterTests (ITestOutputHelper output) { _output = output; }
  10. private readonly ITestOutputHelper _output;
  11. public static IEnumerable<object []> CMGlyphs =>
  12. new List<object []> { new object [] { $"{Glyphs.LeftBracket} Say Hello 你 {Glyphs.RightBracket}", 16, 15 } };
  13. [SetupFakeDriver]
  14. [Theory]
  15. // Horizontal with Alignment.Start
  16. // LeftRight_TopBottom
  17. [InlineData (
  18. "0 2 4",
  19. Alignment.Start,
  20. Alignment.Start,
  21. TextDirection.LeftRight_TopBottom,
  22. @"
  23. 0 2 4**
  24. *******
  25. *******
  26. *******
  27. *******
  28. *******
  29. *******")]
  30. [InlineData (
  31. "0 2 4",
  32. Alignment.End,
  33. Alignment.Start,
  34. TextDirection.LeftRight_TopBottom,
  35. @"
  36. **0 2 4
  37. *******
  38. *******
  39. *******
  40. *******
  41. *******
  42. *******")]
  43. [InlineData (
  44. "0 2 4",
  45. Alignment.Center,
  46. Alignment.Start,
  47. TextDirection.LeftRight_TopBottom,
  48. @"
  49. *0 2 4*
  50. *******
  51. *******
  52. *******
  53. *******
  54. *******
  55. *******")]
  56. [InlineData (
  57. "0 2 4",
  58. Alignment.Fill,
  59. Alignment.Start,
  60. TextDirection.LeftRight_TopBottom,
  61. @"
  62. 0 2 4
  63. *******
  64. *******
  65. *******
  66. *******
  67. *******
  68. *******")]
  69. [InlineData (
  70. "0 你 4",
  71. Alignment.Start,
  72. Alignment.Start,
  73. TextDirection.LeftRight_TopBottom,
  74. @"
  75. 0 你 4*
  76. *******
  77. *******
  78. *******
  79. *******
  80. *******
  81. *******")]
  82. [InlineData (
  83. "0 你 4",
  84. Alignment.End,
  85. Alignment.Start,
  86. TextDirection.LeftRight_TopBottom,
  87. @"
  88. *0 你 4
  89. *******
  90. *******
  91. *******
  92. *******
  93. *******
  94. *******")]
  95. [InlineData (
  96. "0 你 4",
  97. Alignment.Center,
  98. Alignment.Start,
  99. TextDirection.LeftRight_TopBottom,
  100. @"
  101. 0 你 4*
  102. *******
  103. *******
  104. *******
  105. *******
  106. *******
  107. *******")]
  108. [InlineData (
  109. "0 你 4",
  110. Alignment.Fill,
  111. Alignment.Start,
  112. TextDirection.LeftRight_TopBottom,
  113. @"
  114. 0 你 4
  115. *******
  116. *******
  117. *******
  118. *******
  119. *******
  120. *******")]
  121. // LeftRight_BottomTop
  122. [InlineData (
  123. "0 2 4",
  124. Alignment.Start,
  125. Alignment.Start,
  126. TextDirection.LeftRight_BottomTop,
  127. @"
  128. 0 2 4**
  129. *******
  130. *******
  131. *******
  132. *******
  133. *******
  134. *******")]
  135. [InlineData (
  136. "0 2 4",
  137. Alignment.End,
  138. Alignment.Start,
  139. TextDirection.LeftRight_BottomTop,
  140. @"
  141. **0 2 4
  142. *******
  143. *******
  144. *******
  145. *******
  146. *******
  147. *******")]
  148. [InlineData (
  149. "0 2 4",
  150. Alignment.Center,
  151. Alignment.Start,
  152. TextDirection.LeftRight_BottomTop,
  153. @"
  154. *0 2 4*
  155. *******
  156. *******
  157. *******
  158. *******
  159. *******
  160. *******")]
  161. [InlineData (
  162. "0 2 4",
  163. Alignment.Fill,
  164. Alignment.Start,
  165. TextDirection.LeftRight_BottomTop,
  166. @"
  167. 0 2 4
  168. *******
  169. *******
  170. *******
  171. *******
  172. *******
  173. *******")]
  174. [InlineData (
  175. "0 你 4",
  176. Alignment.Start,
  177. Alignment.Start,
  178. TextDirection.LeftRight_BottomTop,
  179. @"
  180. 0 你 4*
  181. *******
  182. *******
  183. *******
  184. *******
  185. *******
  186. *******")]
  187. [InlineData (
  188. "0 你 4",
  189. Alignment.End,
  190. Alignment.Start,
  191. TextDirection.LeftRight_BottomTop,
  192. @"
  193. *0 你 4
  194. *******
  195. *******
  196. *******
  197. *******
  198. *******
  199. *******")]
  200. [InlineData (
  201. "0 你 4",
  202. Alignment.Center,
  203. Alignment.Start,
  204. TextDirection.LeftRight_BottomTop,
  205. @"
  206. 0 你 4*
  207. *******
  208. *******
  209. *******
  210. *******
  211. *******
  212. *******")]
  213. [InlineData (
  214. "0 你 4",
  215. Alignment.Fill,
  216. Alignment.Start,
  217. TextDirection.LeftRight_BottomTop,
  218. @"
  219. 0 你 4
  220. *******
  221. *******
  222. *******
  223. *******
  224. *******
  225. *******")]
  226. // RightLeft_TopBottom
  227. [InlineData (
  228. "0 2 4",
  229. Alignment.Start,
  230. Alignment.Start,
  231. TextDirection.RightLeft_TopBottom,
  232. @"
  233. 4 2 0**
  234. *******
  235. *******
  236. *******
  237. *******
  238. *******
  239. *******")]
  240. [InlineData (
  241. "0 2 4",
  242. Alignment.End,
  243. Alignment.Start,
  244. TextDirection.RightLeft_TopBottom,
  245. @"
  246. **4 2 0
  247. *******
  248. *******
  249. *******
  250. *******
  251. *******
  252. *******")]
  253. [InlineData (
  254. "0 2 4",
  255. Alignment.Center,
  256. Alignment.Start,
  257. TextDirection.RightLeft_TopBottom,
  258. @"
  259. *4 2 0*
  260. *******
  261. *******
  262. *******
  263. *******
  264. *******
  265. *******")]
  266. [InlineData (
  267. "0 2 4",
  268. Alignment.Fill,
  269. Alignment.Start,
  270. TextDirection.RightLeft_TopBottom,
  271. @"
  272. 4 2 0
  273. *******
  274. *******
  275. *******
  276. *******
  277. *******
  278. *******")]
  279. [InlineData (
  280. "0 你 4",
  281. Alignment.Start,
  282. Alignment.Start,
  283. TextDirection.RightLeft_TopBottom,
  284. @"
  285. 4 你 0*
  286. *******
  287. *******
  288. *******
  289. *******
  290. *******
  291. *******")]
  292. [InlineData (
  293. "0 你 4",
  294. Alignment.End,
  295. Alignment.Start,
  296. TextDirection.RightLeft_TopBottom,
  297. @"
  298. *4 你 0
  299. *******
  300. *******
  301. *******
  302. *******
  303. *******
  304. *******")]
  305. [InlineData (
  306. "0 你 4",
  307. Alignment.Center,
  308. Alignment.Start,
  309. TextDirection.RightLeft_TopBottom,
  310. @"
  311. 4 你 0*
  312. *******
  313. *******
  314. *******
  315. *******
  316. *******
  317. *******")]
  318. [InlineData (
  319. "0 你 4",
  320. Alignment.Fill,
  321. Alignment.Start,
  322. TextDirection.RightLeft_TopBottom,
  323. @"
  324. 4 你 0
  325. *******
  326. *******
  327. *******
  328. *******
  329. *******
  330. *******")]
  331. // RightLeft_BottomTop
  332. [InlineData (
  333. "0 2 4",
  334. Alignment.Start,
  335. Alignment.Start,
  336. TextDirection.RightLeft_BottomTop,
  337. @"
  338. 4 2 0**
  339. *******
  340. *******
  341. *******
  342. *******
  343. *******
  344. *******")]
  345. [InlineData (
  346. "0 2 4",
  347. Alignment.End,
  348. Alignment.Start,
  349. TextDirection.RightLeft_BottomTop,
  350. @"
  351. **4 2 0
  352. *******
  353. *******
  354. *******
  355. *******
  356. *******
  357. *******")]
  358. [InlineData (
  359. "0 2 4",
  360. Alignment.Center,
  361. Alignment.Start,
  362. TextDirection.RightLeft_BottomTop,
  363. @"
  364. *4 2 0*
  365. *******
  366. *******
  367. *******
  368. *******
  369. *******
  370. *******")]
  371. [InlineData (
  372. "0 2 4",
  373. Alignment.Fill,
  374. Alignment.Start,
  375. TextDirection.RightLeft_BottomTop,
  376. @"
  377. 4 2 0
  378. *******
  379. *******
  380. *******
  381. *******
  382. *******
  383. *******")]
  384. [InlineData (
  385. "0 你 4",
  386. Alignment.Start,
  387. Alignment.Start,
  388. TextDirection.RightLeft_BottomTop,
  389. @"
  390. 4 你 0*
  391. *******
  392. *******
  393. *******
  394. *******
  395. *******
  396. *******")]
  397. [InlineData (
  398. "0 你 4",
  399. Alignment.End,
  400. Alignment.Start,
  401. TextDirection.RightLeft_BottomTop,
  402. @"
  403. *4 你 0
  404. *******
  405. *******
  406. *******
  407. *******
  408. *******
  409. *******")]
  410. [InlineData (
  411. "0 你 4",
  412. Alignment.Center,
  413. Alignment.Start,
  414. TextDirection.RightLeft_BottomTop,
  415. @"
  416. 4 你 0*
  417. *******
  418. *******
  419. *******
  420. *******
  421. *******
  422. *******")]
  423. [InlineData (
  424. "0 你 4",
  425. Alignment.Fill,
  426. Alignment.Start,
  427. TextDirection.RightLeft_BottomTop,
  428. @"
  429. 4 你 0
  430. *******
  431. *******
  432. *******
  433. *******
  434. *******
  435. *******")]
  436. // Horizontal with Alignment.End
  437. // LeftRight_TopBottom
  438. [InlineData (
  439. "0 2 4",
  440. Alignment.Start,
  441. Alignment.End,
  442. TextDirection.LeftRight_TopBottom,
  443. @"
  444. *******
  445. *******
  446. *******
  447. *******
  448. *******
  449. *******
  450. 0 2 4**")]
  451. [InlineData (
  452. "0 2 4",
  453. Alignment.End,
  454. Alignment.End,
  455. TextDirection.LeftRight_TopBottom,
  456. @"
  457. *******
  458. *******
  459. *******
  460. *******
  461. *******
  462. *******
  463. **0 2 4")]
  464. [InlineData (
  465. "0 2 4",
  466. Alignment.Center,
  467. Alignment.End,
  468. TextDirection.LeftRight_TopBottom,
  469. @"
  470. *******
  471. *******
  472. *******
  473. *******
  474. *******
  475. *******
  476. *0 2 4*")]
  477. [InlineData (
  478. "0 2 4",
  479. Alignment.Fill,
  480. Alignment.End,
  481. TextDirection.LeftRight_TopBottom,
  482. @"
  483. *******
  484. *******
  485. *******
  486. *******
  487. *******
  488. *******
  489. 0 2 4")]
  490. [InlineData (
  491. "0 你 4",
  492. Alignment.Start,
  493. Alignment.End,
  494. TextDirection.LeftRight_TopBottom,
  495. @"
  496. *******
  497. *******
  498. *******
  499. *******
  500. *******
  501. *******
  502. 0 你 4*")]
  503. [InlineData (
  504. "0 你 4",
  505. Alignment.End,
  506. Alignment.End,
  507. TextDirection.LeftRight_TopBottom,
  508. @"
  509. *******
  510. *******
  511. *******
  512. *******
  513. *******
  514. *******
  515. *0 你 4")]
  516. [InlineData (
  517. "0 你 4",
  518. Alignment.Center,
  519. Alignment.End,
  520. TextDirection.LeftRight_TopBottom,
  521. @"
  522. *******
  523. *******
  524. *******
  525. *******
  526. *******
  527. *******
  528. 0 你 4*")]
  529. [InlineData (
  530. "0 你 4",
  531. Alignment.Fill,
  532. Alignment.End,
  533. TextDirection.LeftRight_TopBottom,
  534. @"
  535. *******
  536. *******
  537. *******
  538. *******
  539. *******
  540. *******
  541. 0 你 4")]
  542. // LeftRight_BottomTop
  543. [InlineData (
  544. "0 2 4",
  545. Alignment.Start,
  546. Alignment.End,
  547. TextDirection.LeftRight_BottomTop,
  548. @"
  549. *******
  550. *******
  551. *******
  552. *******
  553. *******
  554. *******
  555. 0 2 4**")]
  556. [InlineData (
  557. "0 2 4",
  558. Alignment.End,
  559. Alignment.End,
  560. TextDirection.LeftRight_BottomTop,
  561. @"
  562. *******
  563. *******
  564. *******
  565. *******
  566. *******
  567. *******
  568. **0 2 4")]
  569. [InlineData (
  570. "0 2 4",
  571. Alignment.Center,
  572. Alignment.End,
  573. TextDirection.LeftRight_BottomTop,
  574. @"
  575. *******
  576. *******
  577. *******
  578. *******
  579. *******
  580. *******
  581. *0 2 4*")]
  582. [InlineData (
  583. "0 2 4",
  584. Alignment.Fill,
  585. Alignment.End,
  586. TextDirection.LeftRight_BottomTop,
  587. @"
  588. *******
  589. *******
  590. *******
  591. *******
  592. *******
  593. *******
  594. 0 2 4")]
  595. [InlineData (
  596. "0 你 4",
  597. Alignment.Start,
  598. Alignment.End,
  599. TextDirection.LeftRight_BottomTop,
  600. @"
  601. *******
  602. *******
  603. *******
  604. *******
  605. *******
  606. *******
  607. 0 你 4*")]
  608. [InlineData (
  609. "0 你 4",
  610. Alignment.End,
  611. Alignment.End,
  612. TextDirection.LeftRight_BottomTop,
  613. @"
  614. *******
  615. *******
  616. *******
  617. *******
  618. *******
  619. *******
  620. *0 你 4")]
  621. [InlineData (
  622. "0 你 4",
  623. Alignment.Center,
  624. Alignment.End,
  625. TextDirection.LeftRight_BottomTop,
  626. @"
  627. *******
  628. *******
  629. *******
  630. *******
  631. *******
  632. *******
  633. 0 你 4*")]
  634. [InlineData (
  635. "0 你 4",
  636. Alignment.Fill,
  637. Alignment.End,
  638. TextDirection.LeftRight_BottomTop,
  639. @"
  640. *******
  641. *******
  642. *******
  643. *******
  644. *******
  645. *******
  646. 0 你 4")]
  647. // RightLeft_TopBottom
  648. [InlineData (
  649. "0 2 4",
  650. Alignment.Start,
  651. Alignment.End,
  652. TextDirection.RightLeft_TopBottom,
  653. @"
  654. *******
  655. *******
  656. *******
  657. *******
  658. *******
  659. *******
  660. 4 2 0**")]
  661. [InlineData (
  662. "0 2 4",
  663. Alignment.End,
  664. Alignment.End,
  665. TextDirection.RightLeft_TopBottom,
  666. @"
  667. *******
  668. *******
  669. *******
  670. *******
  671. *******
  672. *******
  673. **4 2 0")]
  674. [InlineData (
  675. "0 2 4",
  676. Alignment.Center,
  677. Alignment.End,
  678. TextDirection.RightLeft_TopBottom,
  679. @"
  680. *******
  681. *******
  682. *******
  683. *******
  684. *******
  685. *******
  686. *4 2 0*")]
  687. [InlineData (
  688. "0 2 4",
  689. Alignment.Fill,
  690. Alignment.End,
  691. TextDirection.RightLeft_TopBottom,
  692. @"
  693. *******
  694. *******
  695. *******
  696. *******
  697. *******
  698. *******
  699. 4 2 0")]
  700. [InlineData (
  701. "0 你 4",
  702. Alignment.Start,
  703. Alignment.End,
  704. TextDirection.RightLeft_TopBottom,
  705. @"
  706. *******
  707. *******
  708. *******
  709. *******
  710. *******
  711. *******
  712. 4 你 0*")]
  713. [InlineData (
  714. "0 你 4",
  715. Alignment.End,
  716. Alignment.End,
  717. TextDirection.RightLeft_TopBottom,
  718. @"
  719. *******
  720. *******
  721. *******
  722. *******
  723. *******
  724. *******
  725. *4 你 0")]
  726. [InlineData (
  727. "0 你 4",
  728. Alignment.Center,
  729. Alignment.End,
  730. TextDirection.RightLeft_TopBottom,
  731. @"
  732. *******
  733. *******
  734. *******
  735. *******
  736. *******
  737. *******
  738. 4 你 0*")]
  739. [InlineData (
  740. "0 你 4",
  741. Alignment.Fill,
  742. Alignment.End,
  743. TextDirection.RightLeft_TopBottom,
  744. @"
  745. *******
  746. *******
  747. *******
  748. *******
  749. *******
  750. *******
  751. 4 你 0")]
  752. // RightLeft_BottomTop
  753. [InlineData (
  754. "0 2 4",
  755. Alignment.Start,
  756. Alignment.End,
  757. TextDirection.RightLeft_BottomTop,
  758. @"
  759. *******
  760. *******
  761. *******
  762. *******
  763. *******
  764. *******
  765. 4 2 0**")]
  766. [InlineData (
  767. "0 2 4",
  768. Alignment.End,
  769. Alignment.End,
  770. TextDirection.RightLeft_BottomTop,
  771. @"
  772. *******
  773. *******
  774. *******
  775. *******
  776. *******
  777. *******
  778. **4 2 0")]
  779. [InlineData (
  780. "0 2 4",
  781. Alignment.Center,
  782. Alignment.End,
  783. TextDirection.RightLeft_BottomTop,
  784. @"
  785. *******
  786. *******
  787. *******
  788. *******
  789. *******
  790. *******
  791. *4 2 0*")]
  792. [InlineData (
  793. "0 2 4",
  794. Alignment.Fill,
  795. Alignment.End,
  796. TextDirection.RightLeft_BottomTop,
  797. @"
  798. *******
  799. *******
  800. *******
  801. *******
  802. *******
  803. *******
  804. 4 2 0")]
  805. [InlineData (
  806. "0 你 4",
  807. Alignment.Start,
  808. Alignment.End,
  809. TextDirection.RightLeft_BottomTop,
  810. @"
  811. *******
  812. *******
  813. *******
  814. *******
  815. *******
  816. *******
  817. 4 你 0*")]
  818. [InlineData (
  819. "0 你 4",
  820. Alignment.End,
  821. Alignment.End,
  822. TextDirection.RightLeft_BottomTop,
  823. @"
  824. *******
  825. *******
  826. *******
  827. *******
  828. *******
  829. *******
  830. *4 你 0")]
  831. [InlineData (
  832. "0 你 4",
  833. Alignment.Center,
  834. Alignment.End,
  835. TextDirection.RightLeft_BottomTop,
  836. @"
  837. *******
  838. *******
  839. *******
  840. *******
  841. *******
  842. *******
  843. 4 你 0*")]
  844. [InlineData (
  845. "0 你 4",
  846. Alignment.Fill,
  847. Alignment.End,
  848. TextDirection.RightLeft_BottomTop,
  849. @"
  850. *******
  851. *******
  852. *******
  853. *******
  854. *******
  855. *******
  856. 4 你 0")]
  857. // Horizontal with alignment.Centered
  858. // LeftRight_TopBottom
  859. [InlineData (
  860. "0 2 4",
  861. Alignment.Start,
  862. Alignment.Center,
  863. TextDirection.LeftRight_TopBottom,
  864. @"
  865. *******
  866. *******
  867. *******
  868. 0 2 4**
  869. *******
  870. *******
  871. *******")]
  872. [InlineData (
  873. "0 2 4",
  874. Alignment.End,
  875. Alignment.Center,
  876. TextDirection.LeftRight_TopBottom,
  877. @"
  878. *******
  879. *******
  880. *******
  881. **0 2 4
  882. *******
  883. *******
  884. *******")]
  885. [InlineData (
  886. "0 2 4",
  887. Alignment.Center,
  888. Alignment.Center,
  889. TextDirection.LeftRight_TopBottom,
  890. @"
  891. *******
  892. *******
  893. *******
  894. *0 2 4*
  895. *******
  896. *******
  897. *******")]
  898. [InlineData (
  899. "0 2 4",
  900. Alignment.Fill,
  901. Alignment.Center,
  902. TextDirection.LeftRight_TopBottom,
  903. @"
  904. *******
  905. *******
  906. *******
  907. 0 2 4
  908. *******
  909. *******
  910. *******")]
  911. [InlineData (
  912. "0 你 4",
  913. Alignment.Start,
  914. Alignment.Center,
  915. TextDirection.LeftRight_TopBottom,
  916. @"
  917. *******
  918. *******
  919. *******
  920. 0 你 4*
  921. *******
  922. *******
  923. *******")]
  924. [InlineData (
  925. "0 你 4",
  926. Alignment.End,
  927. Alignment.Center,
  928. TextDirection.LeftRight_TopBottom,
  929. @"
  930. *******
  931. *******
  932. *******
  933. *0 你 4
  934. *******
  935. *******
  936. *******")]
  937. [InlineData (
  938. "0 你 4",
  939. Alignment.Center,
  940. Alignment.Center,
  941. TextDirection.LeftRight_TopBottom,
  942. @"
  943. *******
  944. *******
  945. *******
  946. 0 你 4*
  947. *******
  948. *******
  949. *******")]
  950. [InlineData (
  951. "0 你 4",
  952. Alignment.Fill,
  953. Alignment.Center,
  954. TextDirection.LeftRight_TopBottom,
  955. @"
  956. *******
  957. *******
  958. *******
  959. 0 你 4
  960. *******
  961. *******
  962. *******")]
  963. // LeftRight_BottomTop
  964. [InlineData (
  965. "0 2 4",
  966. Alignment.Start,
  967. Alignment.Center,
  968. TextDirection.LeftRight_BottomTop,
  969. @"
  970. *******
  971. *******
  972. *******
  973. 0 2 4**
  974. *******
  975. *******
  976. *******")]
  977. [InlineData (
  978. "0 2 4",
  979. Alignment.End,
  980. Alignment.Center,
  981. TextDirection.LeftRight_BottomTop,
  982. @"
  983. *******
  984. *******
  985. *******
  986. **0 2 4
  987. *******
  988. *******
  989. *******")]
  990. [InlineData (
  991. "0 2 4",
  992. Alignment.Center,
  993. Alignment.Center,
  994. TextDirection.LeftRight_BottomTop,
  995. @"
  996. *******
  997. *******
  998. *******
  999. *0 2 4*
  1000. *******
  1001. *******
  1002. *******")]
  1003. [InlineData (
  1004. "0 2 4",
  1005. Alignment.Fill,
  1006. Alignment.Center,
  1007. TextDirection.LeftRight_BottomTop,
  1008. @"
  1009. *******
  1010. *******
  1011. *******
  1012. 0 2 4
  1013. *******
  1014. *******
  1015. *******")]
  1016. [InlineData (
  1017. "0 你 4",
  1018. Alignment.Start,
  1019. Alignment.Center,
  1020. TextDirection.LeftRight_BottomTop,
  1021. @"
  1022. *******
  1023. *******
  1024. *******
  1025. 0 你 4*
  1026. *******
  1027. *******
  1028. *******")]
  1029. [InlineData (
  1030. "0 你 4",
  1031. Alignment.End,
  1032. Alignment.Center,
  1033. TextDirection.LeftRight_BottomTop,
  1034. @"
  1035. *******
  1036. *******
  1037. *******
  1038. *0 你 4
  1039. *******
  1040. *******
  1041. *******")]
  1042. [InlineData (
  1043. "0 你 4",
  1044. Alignment.Center,
  1045. Alignment.Center,
  1046. TextDirection.LeftRight_BottomTop,
  1047. @"
  1048. *******
  1049. *******
  1050. *******
  1051. 0 你 4*
  1052. *******
  1053. *******
  1054. *******")]
  1055. [InlineData (
  1056. "0 你 4",
  1057. Alignment.Fill,
  1058. Alignment.Center,
  1059. TextDirection.LeftRight_BottomTop,
  1060. @"
  1061. *******
  1062. *******
  1063. *******
  1064. 0 你 4
  1065. *******
  1066. *******
  1067. *******")]
  1068. // RightLeft_TopBottom
  1069. [InlineData (
  1070. "0 2 4",
  1071. Alignment.Start,
  1072. Alignment.Center,
  1073. TextDirection.RightLeft_TopBottom,
  1074. @"
  1075. *******
  1076. *******
  1077. *******
  1078. 4 2 0**
  1079. *******
  1080. *******
  1081. *******")]
  1082. [InlineData (
  1083. "0 2 4",
  1084. Alignment.End,
  1085. Alignment.Center,
  1086. TextDirection.RightLeft_TopBottom,
  1087. @"
  1088. *******
  1089. *******
  1090. *******
  1091. **4 2 0
  1092. *******
  1093. *******
  1094. *******")]
  1095. [InlineData (
  1096. "0 2 4",
  1097. Alignment.Center,
  1098. Alignment.Center,
  1099. TextDirection.RightLeft_TopBottom,
  1100. @"
  1101. *******
  1102. *******
  1103. *******
  1104. *4 2 0*
  1105. *******
  1106. *******
  1107. *******")]
  1108. [InlineData (
  1109. "0 2 4",
  1110. Alignment.Fill,
  1111. Alignment.Center,
  1112. TextDirection.RightLeft_TopBottom,
  1113. @"
  1114. *******
  1115. *******
  1116. *******
  1117. 4 2 0
  1118. *******
  1119. *******
  1120. *******")]
  1121. [InlineData (
  1122. "0 你 4",
  1123. Alignment.Start,
  1124. Alignment.Center,
  1125. TextDirection.RightLeft_TopBottom,
  1126. @"
  1127. *******
  1128. *******
  1129. *******
  1130. 4 你 0*
  1131. *******
  1132. *******
  1133. *******")]
  1134. [InlineData (
  1135. "0 你 4",
  1136. Alignment.End,
  1137. Alignment.Center,
  1138. TextDirection.RightLeft_TopBottom,
  1139. @"
  1140. *******
  1141. *******
  1142. *******
  1143. *4 你 0
  1144. *******
  1145. *******
  1146. *******")]
  1147. [InlineData (
  1148. "0 你 4",
  1149. Alignment.Center,
  1150. Alignment.Center,
  1151. TextDirection.RightLeft_TopBottom,
  1152. @"
  1153. *******
  1154. *******
  1155. *******
  1156. 4 你 0*
  1157. *******
  1158. *******
  1159. *******")]
  1160. [InlineData (
  1161. "0 你 4",
  1162. Alignment.Fill,
  1163. Alignment.Center,
  1164. TextDirection.RightLeft_TopBottom,
  1165. @"
  1166. *******
  1167. *******
  1168. *******
  1169. 4 你 0
  1170. *******
  1171. *******
  1172. *******")]
  1173. // RightLeft_BottomTop
  1174. [InlineData (
  1175. "0 2 4",
  1176. Alignment.Start,
  1177. Alignment.Center,
  1178. TextDirection.RightLeft_BottomTop,
  1179. @"
  1180. *******
  1181. *******
  1182. *******
  1183. 4 2 0**
  1184. *******
  1185. *******
  1186. *******")]
  1187. [InlineData (
  1188. "0 2 4",
  1189. Alignment.End,
  1190. Alignment.Center,
  1191. TextDirection.RightLeft_BottomTop,
  1192. @"
  1193. *******
  1194. *******
  1195. *******
  1196. **4 2 0
  1197. *******
  1198. *******
  1199. *******")]
  1200. [InlineData (
  1201. "0 2 4",
  1202. Alignment.Center,
  1203. Alignment.Center,
  1204. TextDirection.RightLeft_BottomTop,
  1205. @"
  1206. *******
  1207. *******
  1208. *******
  1209. *4 2 0*
  1210. *******
  1211. *******
  1212. *******")]
  1213. [InlineData (
  1214. "0 2 4",
  1215. Alignment.Fill,
  1216. Alignment.Center,
  1217. TextDirection.RightLeft_BottomTop,
  1218. @"
  1219. *******
  1220. *******
  1221. *******
  1222. 4 2 0
  1223. *******
  1224. *******
  1225. *******")]
  1226. [InlineData (
  1227. "0 你 4",
  1228. Alignment.Start,
  1229. Alignment.Center,
  1230. TextDirection.RightLeft_BottomTop,
  1231. @"
  1232. *******
  1233. *******
  1234. *******
  1235. 4 你 0*
  1236. *******
  1237. *******
  1238. *******")]
  1239. [InlineData (
  1240. "0 你 4",
  1241. Alignment.End,
  1242. Alignment.Center,
  1243. TextDirection.RightLeft_BottomTop,
  1244. @"
  1245. *******
  1246. *******
  1247. *******
  1248. *4 你 0
  1249. *******
  1250. *******
  1251. *******")]
  1252. [InlineData (
  1253. "0 你 4",
  1254. Alignment.Center,
  1255. Alignment.Center,
  1256. TextDirection.RightLeft_BottomTop,
  1257. @"
  1258. *******
  1259. *******
  1260. *******
  1261. 4 你 0*
  1262. *******
  1263. *******
  1264. *******")]
  1265. [InlineData (
  1266. "0 你 4",
  1267. Alignment.Fill,
  1268. Alignment.Center,
  1269. TextDirection.RightLeft_BottomTop,
  1270. @"
  1271. *******
  1272. *******
  1273. *******
  1274. 4 你 0
  1275. *******
  1276. *******
  1277. *******")]
  1278. // Horizontal with alignment.Justified
  1279. // LeftRight_TopBottom
  1280. [InlineData (
  1281. "0 2 4",
  1282. Alignment.Start,
  1283. Alignment.Fill,
  1284. TextDirection.LeftRight_TopBottom,
  1285. @"
  1286. 0 2 4**
  1287. *******
  1288. *******
  1289. *******
  1290. *******
  1291. *******
  1292. *******")]
  1293. [InlineData (
  1294. "0 2 4",
  1295. Alignment.End,
  1296. Alignment.Fill,
  1297. TextDirection.LeftRight_TopBottom,
  1298. @"
  1299. **0 2 4
  1300. *******
  1301. *******
  1302. *******
  1303. *******
  1304. *******
  1305. *******")]
  1306. [InlineData (
  1307. "0 2 4",
  1308. Alignment.Center,
  1309. Alignment.Fill,
  1310. TextDirection.LeftRight_TopBottom,
  1311. @"
  1312. *0 2 4*
  1313. *******
  1314. *******
  1315. *******
  1316. *******
  1317. *******
  1318. *******")]
  1319. [InlineData (
  1320. "0 2 4",
  1321. Alignment.Fill,
  1322. Alignment.Fill,
  1323. TextDirection.LeftRight_TopBottom,
  1324. @"
  1325. 0 2 4
  1326. *******
  1327. *******
  1328. *******
  1329. *******
  1330. *******
  1331. *******")]
  1332. [InlineData (
  1333. "0 你 4",
  1334. Alignment.Start,
  1335. Alignment.Fill,
  1336. TextDirection.LeftRight_TopBottom,
  1337. @"
  1338. 0 你 4*
  1339. *******
  1340. *******
  1341. *******
  1342. *******
  1343. *******
  1344. *******")]
  1345. [InlineData (
  1346. "0 你 4",
  1347. Alignment.End,
  1348. Alignment.Fill,
  1349. TextDirection.LeftRight_TopBottom,
  1350. @"
  1351. *0 你 4
  1352. *******
  1353. *******
  1354. *******
  1355. *******
  1356. *******
  1357. *******")]
  1358. [InlineData (
  1359. "0 你 4",
  1360. Alignment.Center,
  1361. Alignment.Fill,
  1362. TextDirection.LeftRight_TopBottom,
  1363. @"
  1364. 0 你 4*
  1365. *******
  1366. *******
  1367. *******
  1368. *******
  1369. *******
  1370. *******")]
  1371. [InlineData (
  1372. "0 你 4",
  1373. Alignment.Fill,
  1374. Alignment.Fill,
  1375. TextDirection.LeftRight_TopBottom,
  1376. @"
  1377. 0 你 4
  1378. *******
  1379. *******
  1380. *******
  1381. *******
  1382. *******
  1383. *******")]
  1384. // LeftRight_BottomTop
  1385. [InlineData (
  1386. "0 2 4",
  1387. Alignment.Start,
  1388. Alignment.Fill,
  1389. TextDirection.LeftRight_BottomTop,
  1390. @"
  1391. 0 2 4**
  1392. *******
  1393. *******
  1394. *******
  1395. *******
  1396. *******
  1397. *******")]
  1398. [InlineData (
  1399. "0 2 4",
  1400. Alignment.End,
  1401. Alignment.Fill,
  1402. TextDirection.LeftRight_BottomTop,
  1403. @"
  1404. **0 2 4
  1405. *******
  1406. *******
  1407. *******
  1408. *******
  1409. *******
  1410. *******")]
  1411. [InlineData (
  1412. "0 2 4",
  1413. Alignment.Center,
  1414. Alignment.Fill,
  1415. TextDirection.LeftRight_BottomTop,
  1416. @"
  1417. *0 2 4*
  1418. *******
  1419. *******
  1420. *******
  1421. *******
  1422. *******
  1423. *******")]
  1424. [InlineData (
  1425. "0 2 4",
  1426. Alignment.Fill,
  1427. Alignment.Fill,
  1428. TextDirection.LeftRight_BottomTop,
  1429. @"
  1430. 0 2 4
  1431. *******
  1432. *******
  1433. *******
  1434. *******
  1435. *******
  1436. *******")]
  1437. [InlineData (
  1438. "0 你 4",
  1439. Alignment.Start,
  1440. Alignment.Fill,
  1441. TextDirection.LeftRight_BottomTop,
  1442. @"
  1443. 0 你 4*
  1444. *******
  1445. *******
  1446. *******
  1447. *******
  1448. *******
  1449. *******")]
  1450. [InlineData (
  1451. "0 你 4",
  1452. Alignment.End,
  1453. Alignment.Fill,
  1454. TextDirection.LeftRight_BottomTop,
  1455. @"
  1456. *0 你 4
  1457. *******
  1458. *******
  1459. *******
  1460. *******
  1461. *******
  1462. *******")]
  1463. [InlineData (
  1464. "0 你 4",
  1465. Alignment.Center,
  1466. Alignment.Fill,
  1467. TextDirection.LeftRight_BottomTop,
  1468. @"
  1469. 0 你 4*
  1470. *******
  1471. *******
  1472. *******
  1473. *******
  1474. *******
  1475. *******")]
  1476. [InlineData (
  1477. "0 你 4",
  1478. Alignment.Fill,
  1479. Alignment.Fill,
  1480. TextDirection.LeftRight_BottomTop,
  1481. @"
  1482. 0 你 4
  1483. *******
  1484. *******
  1485. *******
  1486. *******
  1487. *******
  1488. *******")]
  1489. // RightLeft_TopBottom
  1490. [InlineData (
  1491. "0 2 4",
  1492. Alignment.Start,
  1493. Alignment.Fill,
  1494. TextDirection.RightLeft_TopBottom,
  1495. @"
  1496. 4 2 0**
  1497. *******
  1498. *******
  1499. *******
  1500. *******
  1501. *******
  1502. *******")]
  1503. [InlineData (
  1504. "0 2 4",
  1505. Alignment.End,
  1506. Alignment.Fill,
  1507. TextDirection.RightLeft_TopBottom,
  1508. @"
  1509. **4 2 0
  1510. *******
  1511. *******
  1512. *******
  1513. *******
  1514. *******
  1515. *******")]
  1516. [InlineData (
  1517. "0 2 4",
  1518. Alignment.Center,
  1519. Alignment.Fill,
  1520. TextDirection.RightLeft_TopBottom,
  1521. @"
  1522. *4 2 0*
  1523. *******
  1524. *******
  1525. *******
  1526. *******
  1527. *******
  1528. *******")]
  1529. [InlineData (
  1530. "0 2 4",
  1531. Alignment.Fill,
  1532. Alignment.Fill,
  1533. TextDirection.RightLeft_TopBottom,
  1534. @"
  1535. 4 2 0
  1536. *******
  1537. *******
  1538. *******
  1539. *******
  1540. *******
  1541. *******")]
  1542. [InlineData (
  1543. "0 你 4",
  1544. Alignment.Start,
  1545. Alignment.Fill,
  1546. TextDirection.RightLeft_TopBottom,
  1547. @"
  1548. 4 你 0*
  1549. *******
  1550. *******
  1551. *******
  1552. *******
  1553. *******
  1554. *******")]
  1555. [InlineData (
  1556. "0 你 4",
  1557. Alignment.End,
  1558. Alignment.Fill,
  1559. TextDirection.RightLeft_TopBottom,
  1560. @"
  1561. *4 你 0
  1562. *******
  1563. *******
  1564. *******
  1565. *******
  1566. *******
  1567. *******")]
  1568. [InlineData (
  1569. "0 你 4",
  1570. Alignment.Center,
  1571. Alignment.Fill,
  1572. TextDirection.RightLeft_TopBottom,
  1573. @"
  1574. 4 你 0*
  1575. *******
  1576. *******
  1577. *******
  1578. *******
  1579. *******
  1580. *******")]
  1581. [InlineData (
  1582. "0 你 4",
  1583. Alignment.Fill,
  1584. Alignment.Fill,
  1585. TextDirection.RightLeft_TopBottom,
  1586. @"
  1587. 4 你 0
  1588. *******
  1589. *******
  1590. *******
  1591. *******
  1592. *******
  1593. *******")]
  1594. // RightLeft_BottomTop
  1595. [InlineData (
  1596. "0 2 4",
  1597. Alignment.Start,
  1598. Alignment.Fill,
  1599. TextDirection.RightLeft_BottomTop,
  1600. @"
  1601. 4 2 0**
  1602. *******
  1603. *******
  1604. *******
  1605. *******
  1606. *******
  1607. *******")]
  1608. [InlineData (
  1609. "0 2 4",
  1610. Alignment.End,
  1611. Alignment.Fill,
  1612. TextDirection.RightLeft_BottomTop,
  1613. @"
  1614. **4 2 0
  1615. *******
  1616. *******
  1617. *******
  1618. *******
  1619. *******
  1620. *******")]
  1621. [InlineData (
  1622. "0 2 4",
  1623. Alignment.Center,
  1624. Alignment.Fill,
  1625. TextDirection.RightLeft_BottomTop,
  1626. @"
  1627. *4 2 0*
  1628. *******
  1629. *******
  1630. *******
  1631. *******
  1632. *******
  1633. *******")]
  1634. [InlineData (
  1635. "0 2 4",
  1636. Alignment.Fill,
  1637. Alignment.Fill,
  1638. TextDirection.RightLeft_BottomTop,
  1639. @"
  1640. 4 2 0
  1641. *******
  1642. *******
  1643. *******
  1644. *******
  1645. *******
  1646. *******")]
  1647. [InlineData (
  1648. "0 你 4",
  1649. Alignment.Start,
  1650. Alignment.Fill,
  1651. TextDirection.RightLeft_BottomTop,
  1652. @"
  1653. 4 你 0*
  1654. *******
  1655. *******
  1656. *******
  1657. *******
  1658. *******
  1659. *******")]
  1660. [InlineData (
  1661. "0 你 4",
  1662. Alignment.End,
  1663. Alignment.Fill,
  1664. TextDirection.RightLeft_BottomTop,
  1665. @"
  1666. *4 你 0
  1667. *******
  1668. *******
  1669. *******
  1670. *******
  1671. *******
  1672. *******")]
  1673. [InlineData (
  1674. "0 你 4",
  1675. Alignment.Center,
  1676. Alignment.Fill,
  1677. TextDirection.RightLeft_BottomTop,
  1678. @"
  1679. 4 你 0*
  1680. *******
  1681. *******
  1682. *******
  1683. *******
  1684. *******
  1685. *******")]
  1686. [InlineData (
  1687. "0 你 4",
  1688. Alignment.Fill,
  1689. Alignment.Fill,
  1690. TextDirection.RightLeft_BottomTop,
  1691. @"
  1692. 4 你 0
  1693. *******
  1694. *******
  1695. *******
  1696. *******
  1697. *******
  1698. *******")]
  1699. // Vertical with alignment.Left
  1700. // TopBottom_LeftRight
  1701. [InlineData (
  1702. "0 2 4",
  1703. Alignment.Start,
  1704. Alignment.Start,
  1705. TextDirection.TopBottom_LeftRight,
  1706. @"
  1707. 0******
  1708. ******
  1709. 2******
  1710. ******
  1711. 4******
  1712. *******
  1713. *******")]
  1714. [InlineData (
  1715. "0 2 4",
  1716. Alignment.Start,
  1717. Alignment.End,
  1718. TextDirection.TopBottom_LeftRight,
  1719. @"
  1720. *******
  1721. *******
  1722. 0******
  1723. ******
  1724. 2******
  1725. ******
  1726. 4******")]
  1727. [InlineData (
  1728. "0 2 4",
  1729. Alignment.Start,
  1730. Alignment.Center,
  1731. TextDirection.TopBottom_LeftRight,
  1732. @"
  1733. *******
  1734. 0******
  1735. ******
  1736. 2******
  1737. ******
  1738. 4******
  1739. *******")]
  1740. [InlineData (
  1741. "0 2 4",
  1742. Alignment.Start,
  1743. Alignment.Fill,
  1744. TextDirection.TopBottom_LeftRight,
  1745. @"
  1746. 0******
  1747. ******
  1748. ******
  1749. 2******
  1750. ******
  1751. ******
  1752. 4******")]
  1753. [InlineData (
  1754. "0 你 4",
  1755. Alignment.Start,
  1756. Alignment.Start,
  1757. TextDirection.TopBottom_LeftRight,
  1758. @"
  1759. 0******
  1760. ******
  1761. 你*****
  1762. ******
  1763. 4******
  1764. *******
  1765. *******")]
  1766. [InlineData (
  1767. "0 你 4",
  1768. Alignment.Start,
  1769. Alignment.End,
  1770. TextDirection.TopBottom_LeftRight,
  1771. @"
  1772. *******
  1773. *******
  1774. 0******
  1775. ******
  1776. 你*****
  1777. ******
  1778. 4******")]
  1779. [InlineData (
  1780. "0 你 4",
  1781. Alignment.Start,
  1782. Alignment.Center,
  1783. TextDirection.TopBottom_LeftRight,
  1784. @"
  1785. *******
  1786. 0******
  1787. ******
  1788. 你*****
  1789. ******
  1790. 4******
  1791. *******")]
  1792. [InlineData (
  1793. "0 你 4",
  1794. Alignment.Start,
  1795. Alignment.Fill,
  1796. TextDirection.TopBottom_LeftRight,
  1797. @"
  1798. 0******
  1799. ******
  1800. ******
  1801. 你*****
  1802. ******
  1803. ******
  1804. 4******")]
  1805. // TopBottom_RightLeft
  1806. [InlineData (
  1807. "0 2 4",
  1808. Alignment.Start,
  1809. Alignment.Start,
  1810. TextDirection.TopBottom_RightLeft,
  1811. @"
  1812. 0******
  1813. ******
  1814. 2******
  1815. ******
  1816. 4******
  1817. *******
  1818. *******")]
  1819. [InlineData (
  1820. "0 2 4",
  1821. Alignment.Start,
  1822. Alignment.End,
  1823. TextDirection.TopBottom_RightLeft,
  1824. @"
  1825. *******
  1826. *******
  1827. 0******
  1828. ******
  1829. 2******
  1830. ******
  1831. 4******")]
  1832. [InlineData (
  1833. "0 2 4",
  1834. Alignment.Start,
  1835. Alignment.Center,
  1836. TextDirection.TopBottom_RightLeft,
  1837. @"
  1838. *******
  1839. 0******
  1840. ******
  1841. 2******
  1842. ******
  1843. 4******
  1844. *******")]
  1845. [InlineData (
  1846. "0 2 4",
  1847. Alignment.Start,
  1848. Alignment.Fill,
  1849. TextDirection.TopBottom_RightLeft,
  1850. @"
  1851. 0******
  1852. ******
  1853. ******
  1854. 2******
  1855. ******
  1856. ******
  1857. 4******")]
  1858. [InlineData (
  1859. "0 你 4",
  1860. Alignment.Start,
  1861. Alignment.Start,
  1862. TextDirection.TopBottom_RightLeft,
  1863. @"
  1864. 0******
  1865. ******
  1866. 你*****
  1867. ******
  1868. 4******
  1869. *******
  1870. *******")]
  1871. [InlineData (
  1872. "0 你 4",
  1873. Alignment.Start,
  1874. Alignment.End,
  1875. TextDirection.TopBottom_RightLeft,
  1876. @"
  1877. *******
  1878. *******
  1879. 0******
  1880. ******
  1881. 你*****
  1882. ******
  1883. 4******")]
  1884. [InlineData (
  1885. "0 你 4",
  1886. Alignment.Start,
  1887. Alignment.Center,
  1888. TextDirection.TopBottom_RightLeft,
  1889. @"
  1890. *******
  1891. 0******
  1892. ******
  1893. 你*****
  1894. ******
  1895. 4******
  1896. *******")]
  1897. [InlineData (
  1898. "0 你 4",
  1899. Alignment.Start,
  1900. Alignment.Fill,
  1901. TextDirection.TopBottom_RightLeft,
  1902. @"
  1903. 0******
  1904. ******
  1905. ******
  1906. 你*****
  1907. ******
  1908. ******
  1909. 4******")]
  1910. // BottomTop_LeftRight
  1911. [InlineData (
  1912. "0 2 4",
  1913. Alignment.Start,
  1914. Alignment.Start,
  1915. TextDirection.BottomTop_LeftRight,
  1916. @"
  1917. 4******
  1918. ******
  1919. 2******
  1920. ******
  1921. 0******
  1922. *******
  1923. *******")]
  1924. [InlineData (
  1925. "0 2 4",
  1926. Alignment.Start,
  1927. Alignment.End,
  1928. TextDirection.BottomTop_LeftRight,
  1929. @"
  1930. *******
  1931. *******
  1932. 4******
  1933. ******
  1934. 2******
  1935. ******
  1936. 0******")]
  1937. [InlineData (
  1938. "0 2 4",
  1939. Alignment.Start,
  1940. Alignment.Center,
  1941. TextDirection.BottomTop_LeftRight,
  1942. @"
  1943. *******
  1944. 4******
  1945. ******
  1946. 2******
  1947. ******
  1948. 0******
  1949. *******")]
  1950. [InlineData (
  1951. "0 2 4",
  1952. Alignment.Start,
  1953. Alignment.Fill,
  1954. TextDirection.BottomTop_LeftRight,
  1955. @"
  1956. 4******
  1957. ******
  1958. ******
  1959. 2******
  1960. ******
  1961. ******
  1962. 0******")]
  1963. [InlineData (
  1964. "0 你 4",
  1965. Alignment.Start,
  1966. Alignment.Start,
  1967. TextDirection.BottomTop_LeftRight,
  1968. @"
  1969. 4******
  1970. ******
  1971. 你*****
  1972. ******
  1973. 0******
  1974. *******
  1975. *******")]
  1976. [InlineData (
  1977. "0 你 4",
  1978. Alignment.Start,
  1979. Alignment.End,
  1980. TextDirection.BottomTop_LeftRight,
  1981. @"
  1982. *******
  1983. *******
  1984. 4******
  1985. ******
  1986. 你*****
  1987. ******
  1988. 0******")]
  1989. [InlineData (
  1990. "0 你 4",
  1991. Alignment.Start,
  1992. Alignment.Center,
  1993. TextDirection.BottomTop_LeftRight,
  1994. @"
  1995. *******
  1996. 4******
  1997. ******
  1998. 你*****
  1999. ******
  2000. 0******
  2001. *******")]
  2002. [InlineData (
  2003. "0 你 4",
  2004. Alignment.Start,
  2005. Alignment.Fill,
  2006. TextDirection.BottomTop_LeftRight,
  2007. @"
  2008. 4******
  2009. ******
  2010. ******
  2011. 你*****
  2012. ******
  2013. ******
  2014. 0******")]
  2015. // BottomTop_RightLeft
  2016. [InlineData (
  2017. "0 2 4",
  2018. Alignment.Start,
  2019. Alignment.Start,
  2020. TextDirection.BottomTop_RightLeft,
  2021. @"
  2022. 4******
  2023. ******
  2024. 2******
  2025. ******
  2026. 0******
  2027. *******
  2028. *******")]
  2029. [InlineData (
  2030. "0 2 4",
  2031. Alignment.Start,
  2032. Alignment.End,
  2033. TextDirection.BottomTop_RightLeft,
  2034. @"
  2035. *******
  2036. *******
  2037. 4******
  2038. ******
  2039. 2******
  2040. ******
  2041. 0******")]
  2042. [InlineData (
  2043. "0 2 4",
  2044. Alignment.Start,
  2045. Alignment.Center,
  2046. TextDirection.BottomTop_RightLeft,
  2047. @"
  2048. *******
  2049. 4******
  2050. ******
  2051. 2******
  2052. ******
  2053. 0******
  2054. *******")]
  2055. [InlineData (
  2056. "0 2 4",
  2057. Alignment.Start,
  2058. Alignment.Fill,
  2059. TextDirection.BottomTop_RightLeft,
  2060. @"
  2061. 4******
  2062. ******
  2063. ******
  2064. 2******
  2065. ******
  2066. ******
  2067. 0******")]
  2068. [InlineData (
  2069. "0 你 4",
  2070. Alignment.Start,
  2071. Alignment.Start,
  2072. TextDirection.BottomTop_RightLeft,
  2073. @"
  2074. 4******
  2075. ******
  2076. 你*****
  2077. ******
  2078. 0******
  2079. *******
  2080. *******")]
  2081. [InlineData (
  2082. "0 你 4",
  2083. Alignment.Start,
  2084. Alignment.End,
  2085. TextDirection.BottomTop_RightLeft,
  2086. @"
  2087. *******
  2088. *******
  2089. 4******
  2090. ******
  2091. 你*****
  2092. ******
  2093. 0******")]
  2094. [InlineData (
  2095. "0 你 4",
  2096. Alignment.Start,
  2097. Alignment.Center,
  2098. TextDirection.BottomTop_RightLeft,
  2099. @"
  2100. *******
  2101. 4******
  2102. ******
  2103. 你*****
  2104. ******
  2105. 0******
  2106. *******")]
  2107. [InlineData (
  2108. "0 你 4",
  2109. Alignment.Start,
  2110. Alignment.Fill,
  2111. TextDirection.BottomTop_RightLeft,
  2112. @"
  2113. 4******
  2114. ******
  2115. ******
  2116. 你*****
  2117. ******
  2118. ******
  2119. 0******")]
  2120. // Vertical with alignment.Right
  2121. // TopBottom_LeftRight
  2122. [InlineData (
  2123. "0 2 4",
  2124. Alignment.End,
  2125. Alignment.Start,
  2126. TextDirection.TopBottom_LeftRight,
  2127. @"
  2128. ******0
  2129. ******
  2130. ******2
  2131. ******
  2132. ******4
  2133. *******
  2134. *******")]
  2135. [InlineData (
  2136. "0 2 4",
  2137. Alignment.End,
  2138. Alignment.End,
  2139. TextDirection.TopBottom_LeftRight,
  2140. @"
  2141. *******
  2142. *******
  2143. ******0
  2144. ******
  2145. ******2
  2146. ******
  2147. ******4")]
  2148. [InlineData (
  2149. "0 2 4",
  2150. Alignment.End,
  2151. Alignment.Center,
  2152. TextDirection.TopBottom_LeftRight,
  2153. @"
  2154. *******
  2155. ******0
  2156. ******
  2157. ******2
  2158. ******
  2159. ******4
  2160. *******")]
  2161. [InlineData (
  2162. "0 2 4",
  2163. Alignment.End,
  2164. Alignment.Fill,
  2165. TextDirection.TopBottom_LeftRight,
  2166. @"
  2167. ******0
  2168. ******
  2169. ******
  2170. ******2
  2171. ******
  2172. ******
  2173. ******4")]
  2174. [InlineData (
  2175. "0 你 4",
  2176. Alignment.End,
  2177. Alignment.Start,
  2178. TextDirection.TopBottom_LeftRight,
  2179. @"
  2180. *****0*
  2181. ***** *
  2182. *****你
  2183. ***** *
  2184. *****4*
  2185. *******
  2186. *******")]
  2187. [InlineData (
  2188. "0 你 4",
  2189. Alignment.End,
  2190. Alignment.End,
  2191. TextDirection.TopBottom_LeftRight,
  2192. @"
  2193. *******
  2194. *******
  2195. *****0*
  2196. ***** *
  2197. *****你
  2198. ***** *
  2199. *****4*")]
  2200. [InlineData (
  2201. "0 你 4",
  2202. Alignment.End,
  2203. Alignment.Center,
  2204. TextDirection.TopBottom_LeftRight,
  2205. @"
  2206. *******
  2207. *****0*
  2208. ***** *
  2209. *****你
  2210. ***** *
  2211. *****4*
  2212. *******")]
  2213. [InlineData (
  2214. "0 你 4",
  2215. Alignment.End,
  2216. Alignment.Fill,
  2217. TextDirection.TopBottom_LeftRight,
  2218. @"
  2219. *****0*
  2220. ***** *
  2221. ***** *
  2222. *****你
  2223. ***** *
  2224. ***** *
  2225. *****4*")]
  2226. // TopBottom_RightLeft
  2227. [InlineData (
  2228. "0 2 4",
  2229. Alignment.End,
  2230. Alignment.Start,
  2231. TextDirection.TopBottom_RightLeft,
  2232. @"
  2233. ******0
  2234. ******
  2235. ******2
  2236. ******
  2237. ******4
  2238. *******
  2239. *******")]
  2240. [InlineData (
  2241. "0 2 4",
  2242. Alignment.End,
  2243. Alignment.End,
  2244. TextDirection.TopBottom_RightLeft,
  2245. @"
  2246. *******
  2247. *******
  2248. ******0
  2249. ******
  2250. ******2
  2251. ******
  2252. ******4")]
  2253. [InlineData (
  2254. "0 2 4",
  2255. Alignment.End,
  2256. Alignment.Center,
  2257. TextDirection.TopBottom_RightLeft,
  2258. @"
  2259. *******
  2260. ******0
  2261. ******
  2262. ******2
  2263. ******
  2264. ******4
  2265. *******")]
  2266. [InlineData (
  2267. "0 2 4",
  2268. Alignment.End,
  2269. Alignment.Fill,
  2270. TextDirection.TopBottom_RightLeft,
  2271. @"
  2272. ******0
  2273. ******
  2274. ******
  2275. ******2
  2276. ******
  2277. ******
  2278. ******4")]
  2279. [InlineData (
  2280. "0 你 4",
  2281. Alignment.End,
  2282. Alignment.Start,
  2283. TextDirection.TopBottom_RightLeft,
  2284. @"
  2285. *****0*
  2286. ***** *
  2287. *****你
  2288. ***** *
  2289. *****4*
  2290. *******
  2291. *******")]
  2292. [InlineData (
  2293. "0 你 4",
  2294. Alignment.End,
  2295. Alignment.End,
  2296. TextDirection.TopBottom_RightLeft,
  2297. @"
  2298. *******
  2299. *******
  2300. *****0*
  2301. ***** *
  2302. *****你
  2303. ***** *
  2304. *****4*")]
  2305. [InlineData (
  2306. "0 你 4",
  2307. Alignment.End,
  2308. Alignment.Center,
  2309. TextDirection.TopBottom_RightLeft,
  2310. @"
  2311. *******
  2312. *****0*
  2313. ***** *
  2314. *****你
  2315. ***** *
  2316. *****4*
  2317. *******")]
  2318. [InlineData (
  2319. "0 你 4",
  2320. Alignment.End,
  2321. Alignment.Fill,
  2322. TextDirection.TopBottom_RightLeft,
  2323. @"
  2324. *****0*
  2325. ***** *
  2326. ***** *
  2327. *****你
  2328. ***** *
  2329. ***** *
  2330. *****4*")]
  2331. // BottomTop_LeftRight
  2332. [InlineData (
  2333. "0 2 4",
  2334. Alignment.End,
  2335. Alignment.Start,
  2336. TextDirection.BottomTop_LeftRight,
  2337. @"
  2338. ******4
  2339. ******
  2340. ******2
  2341. ******
  2342. ******0
  2343. *******
  2344. *******")]
  2345. [InlineData (
  2346. "0 2 4",
  2347. Alignment.End,
  2348. Alignment.End,
  2349. TextDirection.BottomTop_LeftRight,
  2350. @"
  2351. *******
  2352. *******
  2353. ******4
  2354. ******
  2355. ******2
  2356. ******
  2357. ******0")]
  2358. [InlineData (
  2359. "0 2 4",
  2360. Alignment.End,
  2361. Alignment.Center,
  2362. TextDirection.BottomTop_LeftRight,
  2363. @"
  2364. *******
  2365. ******4
  2366. ******
  2367. ******2
  2368. ******
  2369. ******0
  2370. *******")]
  2371. [InlineData (
  2372. "0 2 4",
  2373. Alignment.End,
  2374. Alignment.Fill,
  2375. TextDirection.BottomTop_LeftRight,
  2376. @"
  2377. ******4
  2378. ******
  2379. ******
  2380. ******2
  2381. ******
  2382. ******
  2383. ******0")]
  2384. [InlineData (
  2385. "0 你 4",
  2386. Alignment.End,
  2387. Alignment.Start,
  2388. TextDirection.BottomTop_LeftRight,
  2389. @"
  2390. *****4*
  2391. ***** *
  2392. *****你
  2393. ***** *
  2394. *****0*
  2395. *******
  2396. *******")]
  2397. [InlineData (
  2398. "0 你 4",
  2399. Alignment.End,
  2400. Alignment.End,
  2401. TextDirection.BottomTop_LeftRight,
  2402. @"
  2403. *******
  2404. *******
  2405. *****4*
  2406. ***** *
  2407. *****你
  2408. ***** *
  2409. *****0*")]
  2410. [InlineData (
  2411. "0 你 4",
  2412. Alignment.End,
  2413. Alignment.Center,
  2414. TextDirection.BottomTop_LeftRight,
  2415. @"
  2416. *******
  2417. *****4*
  2418. ***** *
  2419. *****你
  2420. ***** *
  2421. *****0*
  2422. *******")]
  2423. [InlineData (
  2424. "0 你 4",
  2425. Alignment.End,
  2426. Alignment.Fill,
  2427. TextDirection.BottomTop_LeftRight,
  2428. @"
  2429. *****4*
  2430. ***** *
  2431. ***** *
  2432. *****你
  2433. ***** *
  2434. ***** *
  2435. *****0*")]
  2436. // BottomTop_RightLeft
  2437. [InlineData (
  2438. "0 2 4",
  2439. Alignment.End,
  2440. Alignment.Start,
  2441. TextDirection.BottomTop_RightLeft,
  2442. @"
  2443. ******4
  2444. ******
  2445. ******2
  2446. ******
  2447. ******0
  2448. *******
  2449. *******")]
  2450. [InlineData (
  2451. "0 2 4",
  2452. Alignment.End,
  2453. Alignment.End,
  2454. TextDirection.BottomTop_RightLeft,
  2455. @"
  2456. *******
  2457. *******
  2458. ******4
  2459. ******
  2460. ******2
  2461. ******
  2462. ******0")]
  2463. [InlineData (
  2464. "0 2 4",
  2465. Alignment.End,
  2466. Alignment.Center,
  2467. TextDirection.BottomTop_RightLeft,
  2468. @"
  2469. *******
  2470. ******4
  2471. ******
  2472. ******2
  2473. ******
  2474. ******0
  2475. *******")]
  2476. [InlineData (
  2477. "0 2 4",
  2478. Alignment.End,
  2479. Alignment.Fill,
  2480. TextDirection.BottomTop_RightLeft,
  2481. @"
  2482. ******4
  2483. ******
  2484. ******
  2485. ******2
  2486. ******
  2487. ******
  2488. ******0")]
  2489. [InlineData (
  2490. "0 你 4",
  2491. Alignment.End,
  2492. Alignment.Start,
  2493. TextDirection.BottomTop_RightLeft,
  2494. @"
  2495. *****4*
  2496. ***** *
  2497. *****你
  2498. ***** *
  2499. *****0*
  2500. *******
  2501. *******")]
  2502. [InlineData (
  2503. "0 你 4",
  2504. Alignment.End,
  2505. Alignment.End,
  2506. TextDirection.BottomTop_RightLeft,
  2507. @"
  2508. *******
  2509. *******
  2510. *****4*
  2511. ***** *
  2512. *****你
  2513. ***** *
  2514. *****0*")]
  2515. [InlineData (
  2516. "0 你 4",
  2517. Alignment.End,
  2518. Alignment.Center,
  2519. TextDirection.BottomTop_RightLeft,
  2520. @"
  2521. *******
  2522. *****4*
  2523. ***** *
  2524. *****你
  2525. ***** *
  2526. *****0*
  2527. *******")]
  2528. [InlineData (
  2529. "0 你 4",
  2530. Alignment.End,
  2531. Alignment.Fill,
  2532. TextDirection.BottomTop_RightLeft,
  2533. @"
  2534. *****4*
  2535. ***** *
  2536. ***** *
  2537. *****你
  2538. ***** *
  2539. ***** *
  2540. *****0*")]
  2541. // Vertical with alignment.Centered
  2542. // TopBottom_LeftRight
  2543. [InlineData (
  2544. "0 2 4",
  2545. Alignment.Center,
  2546. Alignment.Start,
  2547. TextDirection.TopBottom_LeftRight,
  2548. @"
  2549. ***0***
  2550. *** ***
  2551. ***2***
  2552. *** ***
  2553. ***4***
  2554. *******
  2555. *******")]
  2556. [InlineData (
  2557. "0 2 4",
  2558. Alignment.Center,
  2559. Alignment.End,
  2560. TextDirection.TopBottom_LeftRight,
  2561. @"
  2562. *******
  2563. *******
  2564. ***0***
  2565. *** ***
  2566. ***2***
  2567. *** ***
  2568. ***4***")]
  2569. [InlineData (
  2570. "0 2 4",
  2571. Alignment.Center,
  2572. Alignment.Center,
  2573. TextDirection.TopBottom_LeftRight,
  2574. @"
  2575. *******
  2576. ***0***
  2577. *** ***
  2578. ***2***
  2579. *** ***
  2580. ***4***
  2581. *******")]
  2582. [InlineData (
  2583. "0 2 4",
  2584. Alignment.Center,
  2585. Alignment.Fill,
  2586. TextDirection.TopBottom_LeftRight,
  2587. @"
  2588. ***0***
  2589. *** ***
  2590. *** ***
  2591. ***2***
  2592. *** ***
  2593. *** ***
  2594. ***4***")]
  2595. [InlineData (
  2596. "0 你 4",
  2597. Alignment.Center,
  2598. Alignment.Start,
  2599. TextDirection.TopBottom_LeftRight,
  2600. @"
  2601. **0****
  2602. ** ****
  2603. **你***
  2604. ** ****
  2605. **4****
  2606. *******
  2607. *******")]
  2608. [InlineData (
  2609. "0 你 4",
  2610. Alignment.Center,
  2611. Alignment.End,
  2612. TextDirection.TopBottom_LeftRight,
  2613. @"
  2614. *******
  2615. *******
  2616. **0****
  2617. ** ****
  2618. **你***
  2619. ** ****
  2620. **4****")]
  2621. [InlineData (
  2622. "0 你 4",
  2623. Alignment.Center,
  2624. Alignment.Center,
  2625. TextDirection.TopBottom_LeftRight,
  2626. @"
  2627. *******
  2628. **0****
  2629. ** ****
  2630. **你***
  2631. ** ****
  2632. **4****
  2633. *******")]
  2634. [InlineData (
  2635. "0 你 4",
  2636. Alignment.Center,
  2637. Alignment.Fill,
  2638. TextDirection.TopBottom_LeftRight,
  2639. @"
  2640. **0****
  2641. ** ****
  2642. ** ****
  2643. **你***
  2644. ** ****
  2645. ** ****
  2646. **4****")]
  2647. // TopBottom_RightLeft
  2648. [InlineData (
  2649. "0 2 4",
  2650. Alignment.Center,
  2651. Alignment.Start,
  2652. TextDirection.TopBottom_RightLeft,
  2653. @"
  2654. ***0***
  2655. *** ***
  2656. ***2***
  2657. *** ***
  2658. ***4***
  2659. *******
  2660. *******")]
  2661. [InlineData (
  2662. "0 2 4",
  2663. Alignment.Center,
  2664. Alignment.End,
  2665. TextDirection.TopBottom_RightLeft,
  2666. @"
  2667. *******
  2668. *******
  2669. ***0***
  2670. *** ***
  2671. ***2***
  2672. *** ***
  2673. ***4***")]
  2674. [InlineData (
  2675. "0 2 4",
  2676. Alignment.Center,
  2677. Alignment.Center,
  2678. TextDirection.TopBottom_RightLeft,
  2679. @"
  2680. *******
  2681. ***0***
  2682. *** ***
  2683. ***2***
  2684. *** ***
  2685. ***4***
  2686. *******")]
  2687. [InlineData (
  2688. "0 2 4",
  2689. Alignment.Center,
  2690. Alignment.Fill,
  2691. TextDirection.TopBottom_RightLeft,
  2692. @"
  2693. ***0***
  2694. *** ***
  2695. *** ***
  2696. ***2***
  2697. *** ***
  2698. *** ***
  2699. ***4***")]
  2700. [InlineData (
  2701. "0 你 4",
  2702. Alignment.Center,
  2703. Alignment.Start,
  2704. TextDirection.TopBottom_RightLeft,
  2705. @"
  2706. **0****
  2707. ** ****
  2708. **你***
  2709. ** ****
  2710. **4****
  2711. *******
  2712. *******")]
  2713. [InlineData (
  2714. "0 你 4",
  2715. Alignment.Center,
  2716. Alignment.End,
  2717. TextDirection.TopBottom_RightLeft,
  2718. @"
  2719. *******
  2720. *******
  2721. **0****
  2722. ** ****
  2723. **你***
  2724. ** ****
  2725. **4****")]
  2726. [InlineData (
  2727. "0 你 4",
  2728. Alignment.Center,
  2729. Alignment.Center,
  2730. TextDirection.TopBottom_RightLeft,
  2731. @"
  2732. *******
  2733. **0****
  2734. ** ****
  2735. **你***
  2736. ** ****
  2737. **4****
  2738. *******")]
  2739. [InlineData (
  2740. "0 你 4",
  2741. Alignment.Center,
  2742. Alignment.Fill,
  2743. TextDirection.TopBottom_RightLeft,
  2744. @"
  2745. **0****
  2746. ** ****
  2747. ** ****
  2748. **你***
  2749. ** ****
  2750. ** ****
  2751. **4****")]
  2752. // BottomTop_LeftRight
  2753. [InlineData (
  2754. "0 2 4",
  2755. Alignment.Center,
  2756. Alignment.Start,
  2757. TextDirection.BottomTop_LeftRight,
  2758. @"
  2759. ***4***
  2760. *** ***
  2761. ***2***
  2762. *** ***
  2763. ***0***
  2764. *******
  2765. *******")]
  2766. [InlineData (
  2767. "0 2 4",
  2768. Alignment.Center,
  2769. Alignment.End,
  2770. TextDirection.BottomTop_LeftRight,
  2771. @"
  2772. *******
  2773. *******
  2774. ***4***
  2775. *** ***
  2776. ***2***
  2777. *** ***
  2778. ***0***")]
  2779. [InlineData (
  2780. "0 2 4",
  2781. Alignment.Center,
  2782. Alignment.Center,
  2783. TextDirection.BottomTop_LeftRight,
  2784. @"
  2785. *******
  2786. ***4***
  2787. *** ***
  2788. ***2***
  2789. *** ***
  2790. ***0***
  2791. *******")]
  2792. [InlineData (
  2793. "0 2 4",
  2794. Alignment.Center,
  2795. Alignment.Fill,
  2796. TextDirection.BottomTop_LeftRight,
  2797. @"
  2798. ***4***
  2799. *** ***
  2800. *** ***
  2801. ***2***
  2802. *** ***
  2803. *** ***
  2804. ***0***")]
  2805. [InlineData (
  2806. "0 你 4",
  2807. Alignment.Center,
  2808. Alignment.Start,
  2809. TextDirection.BottomTop_LeftRight,
  2810. @"
  2811. **4****
  2812. ** ****
  2813. **你***
  2814. ** ****
  2815. **0****
  2816. *******
  2817. *******")]
  2818. [InlineData (
  2819. "0 你 4",
  2820. Alignment.Center,
  2821. Alignment.End,
  2822. TextDirection.BottomTop_LeftRight,
  2823. @"
  2824. *******
  2825. *******
  2826. **4****
  2827. ** ****
  2828. **你***
  2829. ** ****
  2830. **0****")]
  2831. [InlineData (
  2832. "0 你 4",
  2833. Alignment.Center,
  2834. Alignment.Center,
  2835. TextDirection.BottomTop_LeftRight,
  2836. @"
  2837. *******
  2838. **4****
  2839. ** ****
  2840. **你***
  2841. ** ****
  2842. **0****
  2843. *******")]
  2844. [InlineData (
  2845. "0 你 4",
  2846. Alignment.Center,
  2847. Alignment.Fill,
  2848. TextDirection.BottomTop_LeftRight,
  2849. @"
  2850. **4****
  2851. ** ****
  2852. ** ****
  2853. **你***
  2854. ** ****
  2855. ** ****
  2856. **0****")]
  2857. // BottomTop_RightLeft
  2858. [InlineData (
  2859. "0 2 4",
  2860. Alignment.Center,
  2861. Alignment.Start,
  2862. TextDirection.BottomTop_RightLeft,
  2863. @"
  2864. ***4***
  2865. *** ***
  2866. ***2***
  2867. *** ***
  2868. ***0***
  2869. *******
  2870. *******")]
  2871. [InlineData (
  2872. "0 2 4",
  2873. Alignment.Center,
  2874. Alignment.End,
  2875. TextDirection.BottomTop_RightLeft,
  2876. @"
  2877. *******
  2878. *******
  2879. ***4***
  2880. *** ***
  2881. ***2***
  2882. *** ***
  2883. ***0***")]
  2884. [InlineData (
  2885. "0 2 4",
  2886. Alignment.Center,
  2887. Alignment.Center,
  2888. TextDirection.BottomTop_RightLeft,
  2889. @"
  2890. *******
  2891. ***4***
  2892. *** ***
  2893. ***2***
  2894. *** ***
  2895. ***0***
  2896. *******")]
  2897. [InlineData (
  2898. "0 2 4",
  2899. Alignment.Center,
  2900. Alignment.Fill,
  2901. TextDirection.BottomTop_RightLeft,
  2902. @"
  2903. ***4***
  2904. *** ***
  2905. *** ***
  2906. ***2***
  2907. *** ***
  2908. *** ***
  2909. ***0***")]
  2910. [InlineData (
  2911. "0 你 4",
  2912. Alignment.Center,
  2913. Alignment.Start,
  2914. TextDirection.BottomTop_RightLeft,
  2915. @"
  2916. **4****
  2917. ** ****
  2918. **你***
  2919. ** ****
  2920. **0****
  2921. *******
  2922. *******")]
  2923. [InlineData (
  2924. "0 你 4",
  2925. Alignment.Center,
  2926. Alignment.End,
  2927. TextDirection.BottomTop_RightLeft,
  2928. @"
  2929. *******
  2930. *******
  2931. **4****
  2932. ** ****
  2933. **你***
  2934. ** ****
  2935. **0****")]
  2936. [InlineData (
  2937. "0 你 4",
  2938. Alignment.Center,
  2939. Alignment.Center,
  2940. TextDirection.BottomTop_RightLeft,
  2941. @"
  2942. *******
  2943. **4****
  2944. ** ****
  2945. **你***
  2946. ** ****
  2947. **0****
  2948. *******")]
  2949. [InlineData (
  2950. "0 你 4",
  2951. Alignment.Center,
  2952. Alignment.Fill,
  2953. TextDirection.BottomTop_RightLeft,
  2954. @"
  2955. **4****
  2956. ** ****
  2957. ** ****
  2958. **你***
  2959. ** ****
  2960. ** ****
  2961. **0****")]
  2962. // Vertical with alignment.Justified
  2963. // TopBottom_LeftRight
  2964. [InlineData (
  2965. "0 2 4",
  2966. Alignment.Fill,
  2967. Alignment.Start,
  2968. TextDirection.TopBottom_LeftRight,
  2969. @"
  2970. 0******
  2971. ******
  2972. 2******
  2973. ******
  2974. 4******
  2975. *******
  2976. *******")]
  2977. [InlineData (
  2978. "0 2 4",
  2979. Alignment.Fill,
  2980. Alignment.End,
  2981. TextDirection.TopBottom_LeftRight,
  2982. @"
  2983. *******
  2984. *******
  2985. 0******
  2986. ******
  2987. 2******
  2988. ******
  2989. 4******")]
  2990. [InlineData (
  2991. "0 2 4",
  2992. Alignment.Fill,
  2993. Alignment.Center,
  2994. TextDirection.TopBottom_LeftRight,
  2995. @"
  2996. *******
  2997. 0******
  2998. ******
  2999. 2******
  3000. ******
  3001. 4******
  3002. *******")]
  3003. [InlineData (
  3004. "0 2 4",
  3005. Alignment.Fill,
  3006. Alignment.Fill,
  3007. TextDirection.TopBottom_LeftRight,
  3008. @"
  3009. 0******
  3010. ******
  3011. ******
  3012. 2******
  3013. ******
  3014. ******
  3015. 4******")]
  3016. [InlineData (
  3017. "0 你 4",
  3018. Alignment.Fill,
  3019. Alignment.Start,
  3020. TextDirection.TopBottom_LeftRight,
  3021. @"
  3022. 0******
  3023. ******
  3024. 你*****
  3025. ******
  3026. 4******
  3027. *******
  3028. *******")]
  3029. [InlineData (
  3030. "0 你 4",
  3031. Alignment.Fill,
  3032. Alignment.End,
  3033. TextDirection.TopBottom_LeftRight,
  3034. @"
  3035. *******
  3036. *******
  3037. 0******
  3038. ******
  3039. 你*****
  3040. ******
  3041. 4******")]
  3042. [InlineData (
  3043. "0 你 4",
  3044. Alignment.Fill,
  3045. Alignment.Center,
  3046. TextDirection.TopBottom_LeftRight,
  3047. @"
  3048. *******
  3049. 0******
  3050. ******
  3051. 你*****
  3052. ******
  3053. 4******
  3054. *******")]
  3055. [InlineData (
  3056. "0 你 4",
  3057. Alignment.Fill,
  3058. Alignment.Fill,
  3059. TextDirection.TopBottom_LeftRight,
  3060. @"
  3061. 0******
  3062. ******
  3063. ******
  3064. 你*****
  3065. ******
  3066. ******
  3067. 4******")]
  3068. // TopBottom_RightLeft
  3069. [InlineData (
  3070. "0 2 4",
  3071. Alignment.Fill,
  3072. Alignment.Start,
  3073. TextDirection.TopBottom_RightLeft,
  3074. @"
  3075. 0******
  3076. ******
  3077. 2******
  3078. ******
  3079. 4******
  3080. *******
  3081. *******")]
  3082. [InlineData (
  3083. "0 2 4",
  3084. Alignment.Fill,
  3085. Alignment.End,
  3086. TextDirection.TopBottom_RightLeft,
  3087. @"
  3088. *******
  3089. *******
  3090. 0******
  3091. ******
  3092. 2******
  3093. ******
  3094. 4******")]
  3095. [InlineData (
  3096. "0 2 4",
  3097. Alignment.Fill,
  3098. Alignment.Center,
  3099. TextDirection.TopBottom_RightLeft,
  3100. @"
  3101. *******
  3102. 0******
  3103. ******
  3104. 2******
  3105. ******
  3106. 4******
  3107. *******")]
  3108. [InlineData (
  3109. "0 2 4",
  3110. Alignment.Fill,
  3111. Alignment.Fill,
  3112. TextDirection.TopBottom_RightLeft,
  3113. @"
  3114. 0******
  3115. ******
  3116. ******
  3117. 2******
  3118. ******
  3119. ******
  3120. 4******")]
  3121. [InlineData (
  3122. "0 你 4",
  3123. Alignment.Fill,
  3124. Alignment.Start,
  3125. TextDirection.TopBottom_RightLeft,
  3126. @"
  3127. 0******
  3128. ******
  3129. 你*****
  3130. ******
  3131. 4******
  3132. *******
  3133. *******")]
  3134. [InlineData (
  3135. "0 你 4",
  3136. Alignment.Fill,
  3137. Alignment.End,
  3138. TextDirection.TopBottom_RightLeft,
  3139. @"
  3140. *******
  3141. *******
  3142. 0******
  3143. ******
  3144. 你*****
  3145. ******
  3146. 4******")]
  3147. [InlineData (
  3148. "0 你 4",
  3149. Alignment.Fill,
  3150. Alignment.Center,
  3151. TextDirection.TopBottom_RightLeft,
  3152. @"
  3153. *******
  3154. 0******
  3155. ******
  3156. 你*****
  3157. ******
  3158. 4******
  3159. *******")]
  3160. [InlineData (
  3161. "0 你 4",
  3162. Alignment.Fill,
  3163. Alignment.Fill,
  3164. TextDirection.TopBottom_RightLeft,
  3165. @"
  3166. 0******
  3167. ******
  3168. ******
  3169. 你*****
  3170. ******
  3171. ******
  3172. 4******")]
  3173. // BottomTop_LeftRight
  3174. [InlineData (
  3175. "0 2 4",
  3176. Alignment.Fill,
  3177. Alignment.Start,
  3178. TextDirection.BottomTop_LeftRight,
  3179. @"
  3180. 4******
  3181. ******
  3182. 2******
  3183. ******
  3184. 0******
  3185. *******
  3186. *******")]
  3187. [InlineData (
  3188. "0 2 4",
  3189. Alignment.Fill,
  3190. Alignment.End,
  3191. TextDirection.BottomTop_LeftRight,
  3192. @"
  3193. *******
  3194. *******
  3195. 4******
  3196. ******
  3197. 2******
  3198. ******
  3199. 0******")]
  3200. [InlineData (
  3201. "0 2 4",
  3202. Alignment.Fill,
  3203. Alignment.Center,
  3204. TextDirection.BottomTop_LeftRight,
  3205. @"
  3206. *******
  3207. 4******
  3208. ******
  3209. 2******
  3210. ******
  3211. 0******
  3212. *******")]
  3213. [InlineData (
  3214. "0 2 4",
  3215. Alignment.Fill,
  3216. Alignment.Fill,
  3217. TextDirection.BottomTop_LeftRight,
  3218. @"
  3219. 4******
  3220. ******
  3221. ******
  3222. 2******
  3223. ******
  3224. ******
  3225. 0******")]
  3226. [InlineData (
  3227. "0 你 4",
  3228. Alignment.Fill,
  3229. Alignment.Start,
  3230. TextDirection.BottomTop_LeftRight,
  3231. @"
  3232. 4******
  3233. ******
  3234. 你*****
  3235. ******
  3236. 0******
  3237. *******
  3238. *******")]
  3239. [InlineData (
  3240. "0 你 4",
  3241. Alignment.Fill,
  3242. Alignment.End,
  3243. TextDirection.BottomTop_LeftRight,
  3244. @"
  3245. *******
  3246. *******
  3247. 4******
  3248. ******
  3249. 你*****
  3250. ******
  3251. 0******")]
  3252. [InlineData (
  3253. "0 你 4",
  3254. Alignment.Fill,
  3255. Alignment.Center,
  3256. TextDirection.BottomTop_LeftRight,
  3257. @"
  3258. *******
  3259. 4******
  3260. ******
  3261. 你*****
  3262. ******
  3263. 0******
  3264. *******")]
  3265. [InlineData (
  3266. "0 你 4",
  3267. Alignment.Fill,
  3268. Alignment.Fill,
  3269. TextDirection.BottomTop_LeftRight,
  3270. @"
  3271. 4******
  3272. ******
  3273. ******
  3274. 你*****
  3275. ******
  3276. ******
  3277. 0******")]
  3278. // BottomTop_RightLeft
  3279. [InlineData (
  3280. "0 2 4",
  3281. Alignment.Fill,
  3282. Alignment.Start,
  3283. TextDirection.BottomTop_RightLeft,
  3284. @"
  3285. 4******
  3286. ******
  3287. 2******
  3288. ******
  3289. 0******
  3290. *******
  3291. *******")]
  3292. [InlineData (
  3293. "0 2 4",
  3294. Alignment.Fill,
  3295. Alignment.End,
  3296. TextDirection.BottomTop_RightLeft,
  3297. @"
  3298. *******
  3299. *******
  3300. 4******
  3301. ******
  3302. 2******
  3303. ******
  3304. 0******")]
  3305. [InlineData (
  3306. "0 2 4",
  3307. Alignment.Fill,
  3308. Alignment.Center,
  3309. TextDirection.BottomTop_RightLeft,
  3310. @"
  3311. *******
  3312. 4******
  3313. ******
  3314. 2******
  3315. ******
  3316. 0******
  3317. *******")]
  3318. [InlineData (
  3319. "0 2 4",
  3320. Alignment.Fill,
  3321. Alignment.Fill,
  3322. TextDirection.BottomTop_RightLeft,
  3323. @"
  3324. 4******
  3325. ******
  3326. ******
  3327. 2******
  3328. ******
  3329. ******
  3330. 0******")]
  3331. [InlineData (
  3332. "0 你 4",
  3333. Alignment.Fill,
  3334. Alignment.Start,
  3335. TextDirection.BottomTop_RightLeft,
  3336. @"
  3337. 4******
  3338. ******
  3339. 你*****
  3340. ******
  3341. 0******
  3342. *******
  3343. *******")]
  3344. [InlineData (
  3345. "0 你 4",
  3346. Alignment.Fill,
  3347. Alignment.End,
  3348. TextDirection.BottomTop_RightLeft,
  3349. @"
  3350. *******
  3351. *******
  3352. 4******
  3353. ******
  3354. 你*****
  3355. ******
  3356. 0******")]
  3357. [InlineData (
  3358. "0 你 4",
  3359. Alignment.Fill,
  3360. Alignment.Center,
  3361. TextDirection.BottomTop_RightLeft,
  3362. @"
  3363. *******
  3364. 4******
  3365. ******
  3366. 你*****
  3367. ******
  3368. 0******
  3369. *******")]
  3370. [InlineData (
  3371. "0 你 4",
  3372. Alignment.Fill,
  3373. Alignment.Fill,
  3374. TextDirection.BottomTop_RightLeft,
  3375. @"
  3376. 4******
  3377. ******
  3378. ******
  3379. 你*****
  3380. ******
  3381. ******
  3382. 0******")]
  3383. public void Draw_Text_Justification (string text, Alignment horizontalTextAlignment, Alignment alignment, TextDirection textDirection, string expectedText)
  3384. {
  3385. TextFormatter tf = new ()
  3386. {
  3387. Alignment = horizontalTextAlignment,
  3388. VerticalAlignment = alignment,
  3389. Direction = textDirection,
  3390. ConstrainToSize = new (7, 7),
  3391. Text = text
  3392. };
  3393. Application.Driver?.FillRect (new (0, 0, 7, 7), (Rune)'*');
  3394. tf.Draw (new (0, 0, 7, 7), Attribute.Default, Attribute.Default);
  3395. DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3396. }
  3397. [SetupFakeDriver]
  3398. [Theory]
  3399. [InlineData ("A", 0, 1, "", 0)]
  3400. [InlineData ("A", 1, 1, "A", 0)]
  3401. [InlineData ("A", 2, 2, " A", 1)]
  3402. [InlineData ("AB", 1, 1, "B", 0)]
  3403. [InlineData ("AB", 2, 2, " A\n B", 0)]
  3404. [InlineData ("ABC", 3, 2, " B\n C", 0)]
  3405. [InlineData ("ABC", 4, 2, " B\n C", 0)]
  3406. [InlineData ("ABC", 6, 2, " B\n C", 0)]
  3407. [InlineData ("こんにちは", 0, 1, "", 0)]
  3408. [InlineData ("こんにちは", 1, 0, "", 0)]
  3409. [InlineData ("こんにちは", 1, 1, "", 0)]
  3410. [InlineData ("こんにちは", 2, 1, "は", 0)]
  3411. [InlineData ("こんにちは", 2, 2, "ち\nは", 0)]
  3412. [InlineData ("こんにちは", 2, 3, "に\nち\nは", 0)]
  3413. [InlineData ("こんにちは", 2, 4, "ん\nに\nち\nは", 0)]
  3414. [InlineData ("こんにちは", 2, 5, "こ\nん\nに\nち\nは", 0)]
  3415. [InlineData ("こんにちは", 2, 6, "こ\nん\nに\nち\nは", 1)]
  3416. [InlineData ("ABCD\nこんにちは", 4, 7, " こ\n Aん\n Bに\n Cち\n Dは", 2)]
  3417. [InlineData ("こんにちは\nABCD", 3, 7, "こ \nんA\nにB\nちC\nはD", 2)]
  3418. public void Draw_Vertical_Bottom_Horizontal_Right (string text, int width, int height, string expectedText, int expectedY)
  3419. {
  3420. TextFormatter tf = new ()
  3421. {
  3422. Text = text,
  3423. Alignment = Alignment.End,
  3424. Direction = TextDirection.TopBottom_LeftRight,
  3425. VerticalAlignment = Alignment.End
  3426. };
  3427. tf.ConstrainToWidth = width;
  3428. tf.ConstrainToHeight = height;
  3429. tf.Draw (new (Point.Empty, new (width, height)), Attribute.Default, Attribute.Default);
  3430. Rectangle rect = DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3431. Assert.Equal (expectedY, rect.Y);
  3432. }
  3433. // Draw tests - Note that these depend on View
  3434. [Fact]
  3435. [TestRespondersDisposed]
  3436. public void Draw_Vertical_Throws_IndexOutOfRangeException_With_Negative_Bounds ()
  3437. {
  3438. Application.Init (new FakeDriver ());
  3439. Dialog.DefaultShadow = ShadowStyle.None;
  3440. Button.DefaultShadow = ShadowStyle.None;
  3441. Toplevel top = new ();
  3442. var view = new View { Y = -2, Height = 10, TextDirection = TextDirection.TopBottom_LeftRight, Text = "view" };
  3443. top.Add (view);
  3444. Application.Iteration += (s, a) =>
  3445. {
  3446. Assert.Equal (-2, view.Y);
  3447. Application.RequestStop ();
  3448. };
  3449. try
  3450. {
  3451. Application.Run (top);
  3452. }
  3453. catch (IndexOutOfRangeException ex)
  3454. {
  3455. // After the fix this exception will not be caught.
  3456. Assert.IsType<IndexOutOfRangeException> (ex);
  3457. }
  3458. top.Dispose ();
  3459. // Shutdown must be called to safely clean up Application if Init has been called
  3460. Application.Shutdown ();
  3461. }
  3462. [SetupFakeDriver]
  3463. [Theory]
  3464. [InlineData ("A", 5, 5, "A")]
  3465. [InlineData (
  3466. "AB12",
  3467. 5,
  3468. 5,
  3469. @"
  3470. A
  3471. B
  3472. 1
  3473. 2")]
  3474. [InlineData (
  3475. "AB\n12",
  3476. 5,
  3477. 5,
  3478. @"
  3479. A1
  3480. B2")]
  3481. [InlineData ("", 5, 1, "")]
  3482. [InlineData (
  3483. "Hello Worlds",
  3484. 1,
  3485. 12,
  3486. @"
  3487. H
  3488. e
  3489. l
  3490. l
  3491. o
  3492. W
  3493. o
  3494. r
  3495. l
  3496. d
  3497. s")]
  3498. [InlineData ("Hello Worlds", 12, 1, @"HelloWorlds")]
  3499. public void Draw_Vertical_TopBottom_LeftRight (string text, int width, int height, string expectedText)
  3500. {
  3501. TextFormatter tf = new ()
  3502. {
  3503. Text = text,
  3504. Direction = TextDirection.TopBottom_LeftRight
  3505. };
  3506. tf.ConstrainToWidth = width;
  3507. tf.ConstrainToHeight = height;
  3508. tf.Draw (new (0, 0, 20, 20), Attribute.Default, Attribute.Default);
  3509. DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3510. }
  3511. [SetupFakeDriver]
  3512. [Theory]
  3513. // The expectedY param is to probe that the expectedText param start at that Y coordinate
  3514. [InlineData ("A", 0, "", 0)]
  3515. [InlineData ("A", 1, "A", 0)]
  3516. [InlineData ("A", 2, "A", 0)]
  3517. [InlineData ("A", 3, "A", 1)]
  3518. [InlineData ("AB", 1, "A", 0)]
  3519. [InlineData ("AB", 2, "A\nB", 0)]
  3520. [InlineData ("ABC", 2, "A\nB", 0)]
  3521. [InlineData ("ABC", 3, "A\nB\nC", 0)]
  3522. [InlineData ("ABC", 4, "A\nB\nC", 0)]
  3523. [InlineData ("ABC", 5, "A\nB\nC", 1)]
  3524. [InlineData ("ABC", 6, "A\nB\nC", 1)]
  3525. [InlineData ("ABC", 9, "A\nB\nC", 3)]
  3526. [InlineData ("ABCD", 2, "B\nC", 0)]
  3527. [InlineData ("こんにちは", 0, "", 0)]
  3528. [InlineData ("こんにちは", 1, "に", 0)]
  3529. [InlineData ("こんにちは", 2, "ん\nに", 0)]
  3530. [InlineData ("こんにちは", 3, "ん\nに\nち", 0)]
  3531. [InlineData ("こんにちは", 4, "こ\nん\nに\nち", 0)]
  3532. [InlineData ("こんにちは", 5, "こ\nん\nに\nち\nは", 0)]
  3533. [InlineData ("こんにちは", 6, "こ\nん\nに\nち\nは", 0)]
  3534. [InlineData ("ABCD\nこんにちは", 7, "Aこ\nBん\nCに\nDち\n は", 1)]
  3535. [InlineData ("こんにちは\nABCD", 7, "こA\nんB\nにC\nちD\nは ", 1)]
  3536. public void Draw_Vertical_TopBottom_LeftRight_Middle (string text, int height, string expectedText, int expectedY)
  3537. {
  3538. TextFormatter tf = new ()
  3539. {
  3540. Text = text,
  3541. Direction = TextDirection.TopBottom_LeftRight,
  3542. VerticalAlignment = Alignment.Center
  3543. };
  3544. int width = text.ToRunes ().Max (r => r.GetColumns ());
  3545. if (text.Contains ("\n"))
  3546. {
  3547. width++;
  3548. }
  3549. tf.ConstrainToWidth = width;
  3550. tf.ConstrainToHeight = height;
  3551. tf.Draw (new (0, 0, 5, height), Attribute.Default, Attribute.Default);
  3552. Rectangle rect = DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3553. Assert.Equal (expectedY, rect.Y);
  3554. }
  3555. [SetupFakeDriver]
  3556. [Theory]
  3557. [InlineData ("A", 5, "A")]
  3558. [InlineData (
  3559. "AB12",
  3560. 5,
  3561. @"
  3562. A
  3563. B
  3564. 1
  3565. 2")]
  3566. [InlineData (
  3567. "AB\n12",
  3568. 5,
  3569. @"
  3570. A1
  3571. B2")]
  3572. [InlineData ("", 1, "")]
  3573. [InlineData (
  3574. "AB1 2",
  3575. 2,
  3576. @"
  3577. A12
  3578. B ")]
  3579. [InlineData (
  3580. "こんにちは",
  3581. 1,
  3582. @"
  3583. こん")]
  3584. [InlineData (
  3585. "こんにちは",
  3586. 2,
  3587. @"
  3588. こに
  3589. んち")]
  3590. [InlineData (
  3591. "こんにちは",
  3592. 5,
  3593. @"
  3594. は")]
  3595. public void Draw_Vertical_TopBottom_LeftRight_Top (string text, int height, string expectedText)
  3596. {
  3597. TextFormatter tf = new ()
  3598. {
  3599. Text = text,
  3600. Direction = TextDirection.TopBottom_LeftRight
  3601. };
  3602. tf.ConstrainToWidth = 5;
  3603. tf.ConstrainToHeight = height;
  3604. tf.Draw (new (0, 0, 5, height), Attribute.Default, Attribute.Default);
  3605. DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3606. }
  3607. [Theory]
  3608. [InlineData (14, 1, TextDirection.LeftRight_TopBottom, "Les Misęrables")]
  3609. [InlineData (1, 14, TextDirection.TopBottom_LeftRight, "L\ne\ns\n \nM\ni\ns\nę\nr\na\nb\nl\ne\ns")]
  3610. [InlineData (
  3611. 4,
  3612. 4,
  3613. TextDirection.TopBottom_LeftRight,
  3614. @"
  3615. LMre
  3616. eias
  3617. ssb
  3618. ęl "
  3619. )]
  3620. public void Draw_With_Combining_Runes (int width, int height, TextDirection textDirection, string expected)
  3621. {
  3622. var driver = new FakeDriver ();
  3623. driver.Init ();
  3624. var text = "Les Mise\u0328\u0301rables";
  3625. var tf = new TextFormatter ();
  3626. tf.Direction = textDirection;
  3627. tf.Text = text;
  3628. Assert.True (tf.WordWrap);
  3629. tf.ConstrainToSize = new (width, height);
  3630. tf.Draw (
  3631. new (0, 0, width, height),
  3632. new (ColorName16.White, ColorName16.Black),
  3633. new (ColorName16.Blue, ColorName16.Black),
  3634. default (Rectangle),
  3635. driver
  3636. );
  3637. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3638. driver.End ();
  3639. }
  3640. [Fact]
  3641. [SetupFakeDriver]
  3642. public void FillRemaining_True_False ()
  3643. {
  3644. ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (22, 5);
  3645. Attribute [] attrs =
  3646. {
  3647. Attribute.Default, new (ColorName16.Green, ColorName16.BrightMagenta),
  3648. new (ColorName16.Blue, ColorName16.Cyan)
  3649. };
  3650. var tf = new TextFormatter { ConstrainToSize = new (14, 3), Text = "Test\nTest long\nTest long long\n", MultiLine = true };
  3651. tf.Draw (
  3652. new (1, 1, 19, 3),
  3653. attrs [1],
  3654. attrs [2]);
  3655. Assert.False (tf.FillRemaining);
  3656. DriverAssert.AssertDriverContentsWithFrameAre (
  3657. @"
  3658. Test
  3659. Test long
  3660. Test long long",
  3661. _output);
  3662. DriverAssert.AssertDriverAttributesAre (
  3663. @"
  3664. 000000000000000000000
  3665. 011110000000000000000
  3666. 011111111100000000000
  3667. 011111111111111000000
  3668. 000000000000000000000",
  3669. _output,
  3670. null,
  3671. attrs);
  3672. tf.FillRemaining = true;
  3673. tf.Draw (
  3674. new (1, 1, 19, 3),
  3675. attrs [1],
  3676. attrs [2]);
  3677. DriverAssert.AssertDriverAttributesAre (
  3678. @"
  3679. 000000000000000000000
  3680. 011111111111111111110
  3681. 011111111111111111110
  3682. 011111111111111111110
  3683. 000000000000000000000",
  3684. _output,
  3685. null,
  3686. attrs);
  3687. }
  3688. [SetupFakeDriver]
  3689. [Theory]
  3690. [InlineData ("Hello World", 15, 1, "Hello World")]
  3691. [InlineData (
  3692. "Well Done\nNice Work",
  3693. 15,
  3694. 2,
  3695. @"
  3696. Well Done
  3697. Nice Work")]
  3698. [InlineData ("你好 世界", 15, 1, "你好 世界")]
  3699. [InlineData (
  3700. "做 得好\n幹 得好",
  3701. 15,
  3702. 2,
  3703. @"
  3704. 做 得好
  3705. 幹 得好")]
  3706. public void Justify_Horizontal (string text, int width, int height, string expectedText)
  3707. {
  3708. TextFormatter tf = new ()
  3709. {
  3710. Text = text,
  3711. Alignment = Alignment.Fill,
  3712. ConstrainToSize = new Size (width, height),
  3713. MultiLine = true
  3714. };
  3715. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  3716. DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3717. }
  3718. [Theory]
  3719. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3720. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3721. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3722. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3723. public void TabWith_PreserveTrailingSpaces_False (
  3724. int width,
  3725. int height,
  3726. TextDirection textDirection,
  3727. int tabWidth,
  3728. string expected
  3729. )
  3730. {
  3731. var driver = new FakeDriver ();
  3732. driver.Init ();
  3733. var text = "This is a \tTab";
  3734. var tf = new TextFormatter ();
  3735. tf.Direction = textDirection;
  3736. tf.TabWidth = tabWidth;
  3737. tf.Text = text;
  3738. tf.ConstrainToWidth = 20;
  3739. tf.ConstrainToHeight = 20;
  3740. Assert.True (tf.WordWrap);
  3741. Assert.False (tf.PreserveTrailingSpaces);
  3742. tf.Draw (
  3743. new (0, 0, width, height),
  3744. new (ColorName16.White, ColorName16.Black),
  3745. new (ColorName16.Blue, ColorName16.Black),
  3746. default (Rectangle),
  3747. driver
  3748. );
  3749. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3750. driver.End ();
  3751. }
  3752. [Theory]
  3753. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3754. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3755. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3756. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3757. public void TabWith_PreserveTrailingSpaces_True (
  3758. int width,
  3759. int height,
  3760. TextDirection textDirection,
  3761. int tabWidth,
  3762. string expected
  3763. )
  3764. {
  3765. var driver = new FakeDriver ();
  3766. driver.Init ();
  3767. var text = "This is a \tTab";
  3768. var tf = new TextFormatter ();
  3769. tf.Direction = textDirection;
  3770. tf.TabWidth = tabWidth;
  3771. tf.PreserveTrailingSpaces = true;
  3772. tf.Text = text;
  3773. tf.ConstrainToWidth = 20;
  3774. tf.ConstrainToHeight = 20;
  3775. Assert.True (tf.WordWrap);
  3776. tf.Draw (
  3777. new (0, 0, width, height),
  3778. new (ColorName16.White, ColorName16.Black),
  3779. new (ColorName16.Blue, ColorName16.Black),
  3780. default (Rectangle),
  3781. driver
  3782. );
  3783. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3784. driver.End ();
  3785. }
  3786. [Theory]
  3787. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3788. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3789. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3790. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3791. public void TabWith_WordWrap_True (
  3792. int width,
  3793. int height,
  3794. TextDirection textDirection,
  3795. int tabWidth,
  3796. string expected
  3797. )
  3798. {
  3799. var driver = new FakeDriver ();
  3800. driver.Init ();
  3801. var text = "This is a \tTab";
  3802. var tf = new TextFormatter ();
  3803. tf.Direction = textDirection;
  3804. tf.TabWidth = tabWidth;
  3805. tf.WordWrap = true;
  3806. tf.Text = text;
  3807. tf.ConstrainToWidth = 20;
  3808. tf.ConstrainToHeight = 20;
  3809. Assert.False (tf.PreserveTrailingSpaces);
  3810. tf.Draw (
  3811. new (0, 0, width, height),
  3812. new (ColorName16.White, ColorName16.Black),
  3813. new (ColorName16.Blue, ColorName16.Black),
  3814. default (Rectangle),
  3815. driver
  3816. );
  3817. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3818. driver.End ();
  3819. }
  3820. [Fact]
  3821. [SetupFakeDriver]
  3822. public void UICatalog_AboutBox_Text ()
  3823. {
  3824. TextFormatter tf = new ()
  3825. {
  3826. Text = UICatalog.UICatalogTop.GetAboutBoxMessage (),
  3827. Alignment = Alignment.Center,
  3828. VerticalAlignment = Alignment.Start,
  3829. WordWrap = false,
  3830. MultiLine = true,
  3831. HotKeySpecifier = (Rune)0xFFFF
  3832. };
  3833. Size tfSize = tf.FormatAndGetSize ();
  3834. Assert.Equal (new (59, 13), tfSize);
  3835. ((IFakeConsoleDriver)Application.Driver).SetBufferSize (tfSize.Width, tfSize.Height);
  3836. Application.Driver.FillRect (Application.Screen, (Rune)'*');
  3837. tf.Draw (Application.Screen, Attribute.Default, Attribute.Default);
  3838. var expectedText = """
  3839. UI Catalog: A comprehensive sample library and test app for
  3840. ***********************************************************
  3841. _______ _ _ _____ _ *
  3842. |__ __| (_) | | / ____| (_)*
  3843. | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _ *
  3844. | |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |*
  3845. | | __/ | | | | | | | | | | | (_| | || |__| | |_| | |*
  3846. |_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|*
  3847. ***********************************************************
  3848. **********************v2 - Pre-Alpha***********************
  3849. ***********************************************************
  3850. **********https://github.com/gui-cs/Terminal.Gui***********
  3851. ***********************************************************
  3852. """;
  3853. DriverAssert.AssertDriverContentsAre (expectedText.ReplaceLineEndings (), _output);
  3854. }
  3855. #region FormatAndGetSizeTests
  3856. // TODO: Add multi-line examples
  3857. // TODO: Add other TextDirection examples
  3858. [Theory]
  3859. [SetupFakeDriver]
  3860. [InlineData ("界1234", 10, 10, TextDirection.LeftRight_TopBottom, 6, 1, @"界1234")]
  3861. [InlineData ("01234", 10, 10, TextDirection.LeftRight_TopBottom, 5, 1, @"01234")]
  3862. [InlineData (
  3863. "界1234",
  3864. 10,
  3865. 10,
  3866. TextDirection.TopBottom_LeftRight,
  3867. 2,
  3868. 5,
  3869. """
  3870. 1
  3871. 2
  3872. 3
  3873. 4
  3874. """)]
  3875. [InlineData (
  3876. "01234",
  3877. 10,
  3878. 10,
  3879. TextDirection.TopBottom_LeftRight,
  3880. 1,
  3881. 5,
  3882. """
  3883. 0
  3884. 1
  3885. 2
  3886. 3
  3887. 4
  3888. """)]
  3889. [InlineData (
  3890. "界1234",
  3891. 3,
  3892. 3,
  3893. TextDirection.LeftRight_TopBottom,
  3894. 3,
  3895. 2,
  3896. """
  3897. 界1
  3898. 234
  3899. """)]
  3900. [InlineData (
  3901. "01234",
  3902. 3,
  3903. 3,
  3904. TextDirection.LeftRight_TopBottom,
  3905. 3,
  3906. 2,
  3907. """
  3908. 012
  3909. 34
  3910. """)]
  3911. [InlineData (
  3912. "界1234",
  3913. 3,
  3914. 3,
  3915. TextDirection.TopBottom_LeftRight,
  3916. 3,
  3917. 3,
  3918. """
  3919. 界3
  3920. 1 4
  3921. 2
  3922. """)]
  3923. [InlineData (
  3924. "01234",
  3925. 3,
  3926. 3,
  3927. TextDirection.TopBottom_LeftRight,
  3928. 2,
  3929. 3,
  3930. """
  3931. 03
  3932. 14
  3933. 2
  3934. """)]
  3935. [InlineData ("01234", 2, 1, TextDirection.LeftRight_TopBottom, 2, 1, @"01")]
  3936. public void FormatAndGetSize_Returns_Correct_Size (
  3937. string text,
  3938. int width,
  3939. int height,
  3940. TextDirection direction,
  3941. int expectedWidth,
  3942. int expectedHeight,
  3943. string expectedDraw
  3944. )
  3945. {
  3946. TextFormatter tf = new ()
  3947. {
  3948. Direction = direction,
  3949. ConstrainToWidth = width,
  3950. ConstrainToHeight = height,
  3951. Text = text
  3952. };
  3953. Assert.True (tf.WordWrap);
  3954. Size size = tf.FormatAndGetSize ();
  3955. Assert.Equal (new (expectedWidth, expectedHeight), size);
  3956. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  3957. DriverAssert.AssertDriverContentsWithFrameAre (expectedDraw, _output);
  3958. }
  3959. [Theory]
  3960. [SetupFakeDriver]
  3961. [InlineData ("界1234", 10, 10, TextDirection.LeftRight_TopBottom, 6, 1, @"界1234")]
  3962. [InlineData ("01234", 10, 10, TextDirection.LeftRight_TopBottom, 5, 1, @"01234")]
  3963. [InlineData (
  3964. "界1234",
  3965. 10,
  3966. 10,
  3967. TextDirection.TopBottom_LeftRight,
  3968. 2,
  3969. 5,
  3970. """
  3971. 1
  3972. 2
  3973. 3
  3974. 4
  3975. """)]
  3976. [InlineData (
  3977. "01234",
  3978. 10,
  3979. 10,
  3980. TextDirection.TopBottom_LeftRight,
  3981. 1,
  3982. 5,
  3983. """
  3984. 0
  3985. 1
  3986. 2
  3987. 3
  3988. 4
  3989. """)]
  3990. [InlineData ("界1234", 3, 3, TextDirection.LeftRight_TopBottom, 3, 1, @"界1")]
  3991. [InlineData ("01234", 3, 3, TextDirection.LeftRight_TopBottom, 3, 1, @"012")]
  3992. [InlineData (
  3993. "界1234",
  3994. 3,
  3995. 3,
  3996. TextDirection.TopBottom_LeftRight,
  3997. 2,
  3998. 3,
  3999. """
  4000. 1
  4001. 2
  4002. """)]
  4003. [InlineData (
  4004. "01234",
  4005. 3,
  4006. 3,
  4007. TextDirection.TopBottom_LeftRight,
  4008. 1,
  4009. 3,
  4010. """
  4011. 0
  4012. 1
  4013. 2
  4014. """)]
  4015. public void FormatAndGetSize_WordWrap_False_Returns_Correct_Size (
  4016. string text,
  4017. int width,
  4018. int height,
  4019. TextDirection direction,
  4020. int expectedWidth,
  4021. int expectedHeight,
  4022. string expectedDraw
  4023. )
  4024. {
  4025. TextFormatter tf = new ()
  4026. {
  4027. Direction = direction,
  4028. ConstrainToSize = new (width, height),
  4029. Text = text,
  4030. WordWrap = false
  4031. };
  4032. Assert.False (tf.WordWrap);
  4033. Size size = tf.FormatAndGetSize ();
  4034. Assert.Equal (new (expectedWidth, expectedHeight), size);
  4035. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  4036. DriverAssert.AssertDriverContentsWithFrameAre (expectedDraw, _output);
  4037. }
  4038. #endregion
  4039. }