TextFormatterTests.cs 88 KB

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