TextFormatterTests.cs 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048
  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. [Theory]
  3507. [InlineData (14, 1, TextDirection.LeftRight_TopBottom, "Les Misęrables")]
  3508. [InlineData (1, 14, TextDirection.TopBottom_LeftRight, "L\ne\ns\n \nM\ni\ns\nę\nr\na\nb\nl\ne\ns")]
  3509. [InlineData (
  3510. 4,
  3511. 4,
  3512. TextDirection.TopBottom_LeftRight,
  3513. @"
  3514. LMre
  3515. eias
  3516. ssb
  3517. ęl "
  3518. )]
  3519. public void Draw_With_Combining_Runes (int width, int height, TextDirection textDirection, string expected)
  3520. {
  3521. var driver = new FakeDriver ();
  3522. driver.Init ();
  3523. var text = "Les Mise\u0328\u0301rables";
  3524. var tf = new TextFormatter ();
  3525. tf.Direction = textDirection;
  3526. tf.Text = text;
  3527. Assert.True (tf.WordWrap);
  3528. tf.ConstrainToSize = new (width, height);
  3529. tf.Draw (
  3530. new (0, 0, width, height),
  3531. new (ColorName16.White, ColorName16.Black),
  3532. new (ColorName16.Blue, ColorName16.Black),
  3533. default (Rectangle),
  3534. driver
  3535. );
  3536. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3537. driver.End ();
  3538. }
  3539. [Fact]
  3540. [SetupFakeDriver]
  3541. public void FillRemaining_True_False ()
  3542. {
  3543. ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (22, 5);
  3544. Attribute [] attrs =
  3545. {
  3546. Attribute.Default, new (ColorName16.Green, ColorName16.BrightMagenta),
  3547. new (ColorName16.Blue, ColorName16.Cyan)
  3548. };
  3549. var tf = new TextFormatter { ConstrainToSize = new (14, 3), Text = "Test\nTest long\nTest long long\n", MultiLine = true };
  3550. tf.Draw (
  3551. new (1, 1, 19, 3),
  3552. attrs [1],
  3553. attrs [2]);
  3554. Assert.False (tf.FillRemaining);
  3555. DriverAssert.AssertDriverContentsWithFrameAre (
  3556. @"
  3557. Test
  3558. Test long
  3559. Test long long",
  3560. _output);
  3561. DriverAssert.AssertDriverAttributesAre (
  3562. @"
  3563. 000000000000000000000
  3564. 011110000000000000000
  3565. 011111111100000000000
  3566. 011111111111111000000
  3567. 000000000000000000000",
  3568. _output,
  3569. null,
  3570. attrs);
  3571. tf.FillRemaining = true;
  3572. tf.Draw (
  3573. new (1, 1, 19, 3),
  3574. attrs [1],
  3575. attrs [2]);
  3576. DriverAssert.AssertDriverAttributesAre (
  3577. @"
  3578. 000000000000000000000
  3579. 011111111111111111110
  3580. 011111111111111111110
  3581. 011111111111111111110
  3582. 000000000000000000000",
  3583. _output,
  3584. null,
  3585. attrs);
  3586. }
  3587. [SetupFakeDriver]
  3588. [Theory]
  3589. [InlineData ("Hello World", 15, 1, "Hello World")]
  3590. [InlineData (
  3591. "Well Done\nNice Work",
  3592. 15,
  3593. 2,
  3594. @"
  3595. Well Done
  3596. Nice Work")]
  3597. [InlineData ("你好 世界", 15, 1, "你好 世界")]
  3598. [InlineData (
  3599. "做 得好\n幹 得好",
  3600. 15,
  3601. 2,
  3602. @"
  3603. 做 得好
  3604. 幹 得好")]
  3605. public void Justify_Horizontal (string text, int width, int height, string expectedText)
  3606. {
  3607. TextFormatter tf = new ()
  3608. {
  3609. Text = text,
  3610. Alignment = Alignment.Fill,
  3611. ConstrainToSize = new Size (width, height),
  3612. MultiLine = true
  3613. };
  3614. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  3615. DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
  3616. }
  3617. [Theory]
  3618. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3619. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3620. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3621. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3622. public void TabWith_PreserveTrailingSpaces_False (
  3623. int width,
  3624. int height,
  3625. TextDirection textDirection,
  3626. int tabWidth,
  3627. string expected
  3628. )
  3629. {
  3630. var driver = new FakeDriver ();
  3631. driver.Init ();
  3632. var text = "This is a \tTab";
  3633. var tf = new TextFormatter ();
  3634. tf.Direction = textDirection;
  3635. tf.TabWidth = tabWidth;
  3636. tf.Text = text;
  3637. tf.ConstrainToWidth = 20;
  3638. tf.ConstrainToHeight = 20;
  3639. Assert.True (tf.WordWrap);
  3640. Assert.False (tf.PreserveTrailingSpaces);
  3641. tf.Draw (
  3642. new (0, 0, width, height),
  3643. new (ColorName16.White, ColorName16.Black),
  3644. new (ColorName16.Blue, ColorName16.Black),
  3645. default (Rectangle),
  3646. driver
  3647. );
  3648. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3649. driver.End ();
  3650. }
  3651. [Theory]
  3652. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3653. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3654. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3655. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3656. public void TabWith_PreserveTrailingSpaces_True (
  3657. int width,
  3658. int height,
  3659. TextDirection textDirection,
  3660. int tabWidth,
  3661. string expected
  3662. )
  3663. {
  3664. var driver = new FakeDriver ();
  3665. driver.Init ();
  3666. var text = "This is a \tTab";
  3667. var tf = new TextFormatter ();
  3668. tf.Direction = textDirection;
  3669. tf.TabWidth = tabWidth;
  3670. tf.PreserveTrailingSpaces = true;
  3671. tf.Text = text;
  3672. tf.ConstrainToWidth = 20;
  3673. tf.ConstrainToHeight = 20;
  3674. Assert.True (tf.WordWrap);
  3675. tf.Draw (
  3676. new (0, 0, width, height),
  3677. new (ColorName16.White, ColorName16.Black),
  3678. new (ColorName16.Blue, ColorName16.Black),
  3679. default (Rectangle),
  3680. driver
  3681. );
  3682. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3683. driver.End ();
  3684. }
  3685. [Theory]
  3686. [InlineData (17, 1, TextDirection.LeftRight_TopBottom, 4, "This is a Tab")]
  3687. [InlineData (1, 17, TextDirection.TopBottom_LeftRight, 4, "T\nh\ni\ns\n \ni\ns\n \na\n \n \n \n \n \nT\na\nb")]
  3688. [InlineData (13, 1, TextDirection.LeftRight_TopBottom, 0, "This is a Tab")]
  3689. [InlineData (1, 13, TextDirection.TopBottom_LeftRight, 0, "T\nh\ni\ns\n \ni\ns\n \na\n \nT\na\nb")]
  3690. public void TabWith_WordWrap_True (
  3691. int width,
  3692. int height,
  3693. TextDirection textDirection,
  3694. int tabWidth,
  3695. string expected
  3696. )
  3697. {
  3698. var driver = new FakeDriver ();
  3699. driver.Init ();
  3700. var text = "This is a \tTab";
  3701. var tf = new TextFormatter ();
  3702. tf.Direction = textDirection;
  3703. tf.TabWidth = tabWidth;
  3704. tf.WordWrap = true;
  3705. tf.Text = text;
  3706. tf.ConstrainToWidth = 20;
  3707. tf.ConstrainToHeight = 20;
  3708. Assert.False (tf.PreserveTrailingSpaces);
  3709. tf.Draw (
  3710. new (0, 0, width, height),
  3711. new (ColorName16.White, ColorName16.Black),
  3712. new (ColorName16.Blue, ColorName16.Black),
  3713. default (Rectangle),
  3714. driver
  3715. );
  3716. DriverAssert.AssertDriverContentsWithFrameAre (expected, _output, driver);
  3717. driver.End ();
  3718. }
  3719. [Fact]
  3720. [SetupFakeDriver]
  3721. public void UICatalog_AboutBox_Text ()
  3722. {
  3723. TextFormatter tf = new ()
  3724. {
  3725. Text = UICatalog.UICatalogTop.GetAboutBoxMessage (),
  3726. Alignment = Alignment.Center,
  3727. VerticalAlignment = Alignment.Start,
  3728. WordWrap = false,
  3729. MultiLine = true,
  3730. HotKeySpecifier = (Rune)0xFFFF
  3731. };
  3732. Size tfSize = tf.FormatAndGetSize ();
  3733. Assert.Equal (new (59, 13), tfSize);
  3734. ((IFakeConsoleDriver)Application.Driver).SetBufferSize (tfSize.Width, tfSize.Height);
  3735. Application.Driver.FillRect (Application.Screen, (Rune)'*');
  3736. tf.Draw (Application.Screen, Attribute.Default, Attribute.Default);
  3737. var expectedText = """
  3738. UI Catalog: A comprehensive sample library and test app for
  3739. ***********************************************************
  3740. _______ _ _ _____ _ *
  3741. |__ __| (_) | | / ____| (_)*
  3742. | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _ *
  3743. | |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |*
  3744. | | __/ | | | | | | | | | | | (_| | || |__| | |_| | |*
  3745. |_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|*
  3746. ***********************************************************
  3747. **********************v2 - Pre-Alpha***********************
  3748. ***********************************************************
  3749. **********https://github.com/gui-cs/Terminal.Gui***********
  3750. ***********************************************************
  3751. """;
  3752. DriverAssert.AssertDriverContentsAre (expectedText.ReplaceLineEndings (), _output);
  3753. }
  3754. #region FormatAndGetSizeTests
  3755. // TODO: Add multi-line examples
  3756. // TODO: Add other TextDirection examples
  3757. [Theory]
  3758. [SetupFakeDriver]
  3759. [InlineData ("界1234", 10, 10, TextDirection.LeftRight_TopBottom, 6, 1, @"界1234")]
  3760. [InlineData ("01234", 10, 10, TextDirection.LeftRight_TopBottom, 5, 1, @"01234")]
  3761. [InlineData (
  3762. "界1234",
  3763. 10,
  3764. 10,
  3765. TextDirection.TopBottom_LeftRight,
  3766. 2,
  3767. 5,
  3768. """
  3769. 1
  3770. 2
  3771. 3
  3772. 4
  3773. """)]
  3774. [InlineData (
  3775. "01234",
  3776. 10,
  3777. 10,
  3778. TextDirection.TopBottom_LeftRight,
  3779. 1,
  3780. 5,
  3781. """
  3782. 0
  3783. 1
  3784. 2
  3785. 3
  3786. 4
  3787. """)]
  3788. [InlineData (
  3789. "界1234",
  3790. 3,
  3791. 3,
  3792. TextDirection.LeftRight_TopBottom,
  3793. 3,
  3794. 2,
  3795. """
  3796. 界1
  3797. 234
  3798. """)]
  3799. [InlineData (
  3800. "01234",
  3801. 3,
  3802. 3,
  3803. TextDirection.LeftRight_TopBottom,
  3804. 3,
  3805. 2,
  3806. """
  3807. 012
  3808. 34
  3809. """)]
  3810. [InlineData (
  3811. "界1234",
  3812. 3,
  3813. 3,
  3814. TextDirection.TopBottom_LeftRight,
  3815. 3,
  3816. 3,
  3817. """
  3818. 界3
  3819. 1 4
  3820. 2
  3821. """)]
  3822. [InlineData (
  3823. "01234",
  3824. 3,
  3825. 3,
  3826. TextDirection.TopBottom_LeftRight,
  3827. 2,
  3828. 3,
  3829. """
  3830. 03
  3831. 14
  3832. 2
  3833. """)]
  3834. [InlineData ("01234", 2, 1, TextDirection.LeftRight_TopBottom, 2, 1, @"01")]
  3835. public void FormatAndGetSize_Returns_Correct_Size (
  3836. string text,
  3837. int width,
  3838. int height,
  3839. TextDirection direction,
  3840. int expectedWidth,
  3841. int expectedHeight,
  3842. string expectedDraw
  3843. )
  3844. {
  3845. TextFormatter tf = new ()
  3846. {
  3847. Direction = direction,
  3848. ConstrainToWidth = width,
  3849. ConstrainToHeight = height,
  3850. Text = text
  3851. };
  3852. Assert.True (tf.WordWrap);
  3853. Size size = tf.FormatAndGetSize ();
  3854. Assert.Equal (new (expectedWidth, expectedHeight), size);
  3855. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  3856. DriverAssert.AssertDriverContentsWithFrameAre (expectedDraw, _output);
  3857. }
  3858. [Theory]
  3859. [SetupFakeDriver]
  3860. [InlineData ("界1234", 10, 10, TextDirection.LeftRight_TopBottom, 6, 1, @"界1234")]
  3861. [InlineData ("01234", 10, 10, TextDirection.LeftRight_TopBottom, 5, 1, @"01234")]
  3862. [InlineData (
  3863. "界1234",
  3864. 10,
  3865. 10,
  3866. TextDirection.TopBottom_LeftRight,
  3867. 2,
  3868. 5,
  3869. """
  3870. 1
  3871. 2
  3872. 3
  3873. 4
  3874. """)]
  3875. [InlineData (
  3876. "01234",
  3877. 10,
  3878. 10,
  3879. TextDirection.TopBottom_LeftRight,
  3880. 1,
  3881. 5,
  3882. """
  3883. 0
  3884. 1
  3885. 2
  3886. 3
  3887. 4
  3888. """)]
  3889. [InlineData ("界1234", 3, 3, TextDirection.LeftRight_TopBottom, 3, 1, @"界1")]
  3890. [InlineData ("01234", 3, 3, TextDirection.LeftRight_TopBottom, 3, 1, @"012")]
  3891. [InlineData (
  3892. "界1234",
  3893. 3,
  3894. 3,
  3895. TextDirection.TopBottom_LeftRight,
  3896. 2,
  3897. 3,
  3898. """
  3899. 1
  3900. 2
  3901. """)]
  3902. [InlineData (
  3903. "01234",
  3904. 3,
  3905. 3,
  3906. TextDirection.TopBottom_LeftRight,
  3907. 1,
  3908. 3,
  3909. """
  3910. 0
  3911. 1
  3912. 2
  3913. """)]
  3914. public void FormatAndGetSize_WordWrap_False_Returns_Correct_Size (
  3915. string text,
  3916. int width,
  3917. int height,
  3918. TextDirection direction,
  3919. int expectedWidth,
  3920. int expectedHeight,
  3921. string expectedDraw
  3922. )
  3923. {
  3924. TextFormatter tf = new ()
  3925. {
  3926. Direction = direction,
  3927. ConstrainToSize = new (width, height),
  3928. Text = text,
  3929. WordWrap = false
  3930. };
  3931. Assert.False (tf.WordWrap);
  3932. Size size = tf.FormatAndGetSize ();
  3933. Assert.Equal (new (expectedWidth, expectedHeight), size);
  3934. tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
  3935. DriverAssert.AssertDriverContentsWithFrameAre (expectedDraw, _output);
  3936. }
  3937. #endregion
  3938. }