TextFormatterTests.cs 97 KB

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