TextFormatterTests.cs 94 KB

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