TextFormatterTests.cs 97 KB

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