From 367f20ecababa4b8fadd41898bd21b34087cbc0a Mon Sep 17 00:00:00 2001 From: luci <22126563+LuciNyan@users.noreply.github.com> Date: Fri, 11 Aug 2023 00:00:07 +0800 Subject: [PATCH] fix: text-align --- src/text.ts | 16 +- ...orrectly-when-text-align-center-1-snap.png | Bin 4460 -> 4046 bytes ...orrectly-when-text-align-center-1-snap.png | Bin 0 -> 5817 bytes ...k-correctly-when-text-align-end-1-snap.png | Bin 0 -> 5778 bytes ...-correctly-when-text-align-left-1-snap.png | Bin 0 -> 5635 bytes ...correctly-when-text-align-right-1-snap.png | Bin 0 -> 5778 bytes test/line-clamp.test.tsx | 2 + test/text-align.test.tsx | 149 ++++++++++++++++++ 8 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-center-1-snap.png create mode 100644 test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-end-1-snap.png create mode 100644 test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-left-1-snap.png create mode 100644 test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-right-1-snap.png create mode 100644 test/text-align.test.tsx diff --git a/src/text.ts b/src/text.ts index ce1caadd..8f7cd7f9 100644 --- a/src/text.ts +++ b/src/text.ts @@ -183,7 +183,6 @@ export default async function* buildTextNodes( } else { originWidth = measureText(text) } - const afterTrimEndWidth = text.trimEnd() === text ? originWidth : measureText(text.trimEnd()) @@ -228,12 +227,12 @@ export default async function* buildTextNodes( // @TODO: Support different writing modes. // @TODO: Support RTL languages. let i = 0 + let prevLineEndingSpacesWidth = 0 while (i < words.length && lines < lineLimit) { let word = words[i] const forceBreak = requiredBreaks[i] let w = 0 - let lineEndingSpacesWidth = 0 const { originWidth, @@ -243,7 +242,7 @@ export default async function* buildTextNodes( word = _word w = originWidth - lineEndingSpacesWidth = endingSpacesWidth + const lineEndingSpacesWidth = endingSpacesWidth // When starting a new line from an empty line, we should push one extra // line height. @@ -281,7 +280,7 @@ export default async function* buildTextNodes( words.splice(i, 1, ...chars) if (currentWidth > 0) { // Start a new line, spaces can be ignored. - lineWidths.push(currentWidth) + lineWidths.push(currentWidth - prevLineEndingSpacesWidth) baselines.push(currentBaselineOffset) lines++ height += currentLineHeight @@ -291,6 +290,7 @@ export default async function* buildTextNodes( lineSegmentNumber.push(1) lineIndex = -1 } + prevLineEndingSpacesWidth = lineEndingSpacesWidth continue } if (forceBreak || willWrap) { @@ -299,7 +299,12 @@ export default async function* buildTextNodes( if (shouldCollapseTabsAndSpaces && word === ' ') { w = 0 } - lineWidths.push(currentWidth) + console.log( + ':::2 currentWidth, lineEndingSpacesWidth', + currentWidth, + lineEndingSpacesWidth + ) + lineWidths.push(currentWidth - prevLineEndingSpacesWidth) baselines.push(currentBaselineOffset) lines++ height += currentLineHeight @@ -376,6 +381,7 @@ export default async function* buildTextNodes( } i++ + prevLineEndingSpacesWidth = lineEndingSpacesWidth } if (currentWidth) { diff --git a/test/__image_snapshots__/line-clamp-test-tsx-test-line-clamp-test-tsx-line-clamp-should-work-correctly-when-text-align-center-1-snap.png b/test/__image_snapshots__/line-clamp-test-tsx-test-line-clamp-test-tsx-line-clamp-should-work-correctly-when-text-align-center-1-snap.png index 91912f31aa210164cc02a1692a71865512b81ad3..903be6e4a23731dfe0e7c38c4a2150cef5aa58d2 100644 GIT binary patch literal 4046 zcmds4`#%%<|KHGtgCreAY)Pq8ZpU%IZ6_J2goIpHWQ2u~%UtHt(baS+lv^c|+sZJv znTqD*9%~qLKVvh?WgDBzXPxi&^V{e14}5-jzu!N+-;d|>^?JOXulM`?ynEq1LS9x? z761UqJJ{R0h}X^^LmDKWt30X;0f6049ci2LctO&jx8}W2F@jq$+ko;Sx27ty)ZFF}vJ# zoG@-kU~{#5=;I44S0amnU#eOvjDsZBG}^XTOKJIKVQuAT&5+*HzuG(_aY(lahOn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-correctly-when-text-align-center-1-snap.png b/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-center-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..2e4008b82e01574362b2fbd859cfe81227c1671f GIT binary patch literal 5817 zcmdUzc{r4B+sFMxlq@Nvv2TgwC)patlCnmUD8txlvM=+qkC81TGl<8?RusuP_H9Pi zi7;dtONg;#8A}-3n0d#uyzlWI@9`Y(-_IZSegAVE=lT79&f`9>>pJ7_n;CGPy?mC5 ziHXz5Q2znr`}O2uKh1cT+LYxmG4a1J(${?$ltrG>E(wF&!fzd|Cdm%Gmy*j%8eq44 ztEc<^(gONWhhc#Odgb@kB&dh%=vY zyv@Sf_L5yHn)AFNJK#TZfulkaf%a?5oW1;YIc;i-U=XjPC;LB6E^F^Qb8~C^G}8{e zMMY@KL3VTaaLVj#Q_J4$tRn5_z9e`)>@{)f%)9|;Yjab%g}S+Uto;{tOMynqMCl%< zhilU6#d9^gRBACe-{$LE@{rJrBPy7K14vlV{<682CUtO0bZPr?uyONxOcQS$ONt?V z8-g<05v5b=Nj!aZ;Y;o9qV%rz_8IEI;O1R@F#=w*Wn=6IfJ}wQRGiI7V-fJkvr#!&>*sg*~C*cjPO`zK^7fgyog$K5az681-;)lpuV# zti6mW3KGnOgmFQYh_oU61f{m=0C)4Z-zJ6CY3ZQUTT>>6B}5Lg|HfcTy>ZNrz3aR| zrOD~|(W1`OjzhzXo@uil7@3-%e1PsIUN$$=ZDm3m@|!jBk-y81nr)AirQdJ`mOc`?I4>hJUYNtj?GUC&LgC4P!}ZWeYdq~ zwpBBlU7sYcmlV}l6<~8c0Qrld?(2GDkupKB!Ln8-j?K@CnI5(!Ph>f^I&Z%g6>72N zNw8vXW_dFH#Ddb8-m;>p4*lm?z~oq0Si z!xf1xtcNZ@<05Q&58ka5DBv=q`d*+DE>GS%Z(!kzCVRKqap?aJ^_O}#^DdUv;foX<4--ctu&s945!X>g! zNwgdeDwcAJD$NN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$GkYf-g=uPn0*@JAzhtzP38b zE*;q~O9y`dGB@7es7LIK`alSblhI&(c*Jmp@ zasp@zB@s2VF56ylU-I6I>KNBtkN-QL$Xj5601@CD)+)5tKuuE5u>XlEWJl7cjt9?| zo}pQ>G9oGIiB`;4t+mOrmTE_v_^c^4S*g_gSJ~r84_ZvH<3u?l7jVB_aR+gdCZRAm z6|3iQrlKQIk%4U^R!7WL>YT6PMQ!;_X8Y%)>|D2@LHmrx_|6g~Il<%7=1FbFPM>|N zH-@oKp0FEXqmJAa4yWSW%7qKUVCNIYX}oL8-|Tm{_c9d7?~l)dR=LCa7DR%}S$W$^ z89njeO^xba@6o0tH;3>K2BFNBYnGWerU5duU9ir;`WBML72^i(f=l2d{d!R~<#;A~(6U=#6Cb&_}&VzNrG$LrUSRM0YsJ<~&LL zZ7XT6=SUqLumgpD$G?;$mc;|cpD0Qbgx;2B}dk3 z>CR$&3T?_x4F~U?JvMC1X`DtWkO254nb)TTjzk*Lo2O0}2s`tZ=fVfru(^K3>x{7g zpdCD>){jL%Mke(%+0GjpL>dokgh#wF-&>@s2WhV_trk(tE&><&yF++gLSTK7vDa zEaXB&$)T)ucqs%*Ht{G1A;myHZfd{Yeal18W%;gQaxKDEI&J9co>^+KBIA!uTeBIT z+_fm9J!$Emkhd&ES>uxjRJz@$#K<5n2K@PCeHe}T%KK*$xN_!k%w>9wSWXoC2gzWm z!K{`qrMz2Vd~uetg%4))|E|YS#OUUdqEE3te1_!#Q4C~F>m)g8!Y^(K>5FAEN>Xnn zG2Nu2+4ErICEspW8{CA5Jx_?cy6UaoEb|ZC7zS>yw75OFq~G6?+iYvG(-!lvSgkz} zyDs(yMT@wbmQTJo;;wr_5wE6VoRxDw>0Jsmr*1MH3!lw$kzeb=3H2qamv{F}mk}(F zQ#SSIN^K=Fj)#vVZm9vMY=*ly?**@%mewm&_2xOm literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-end-1-snap.png b/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-end-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..b8db16cb441a18c70b29ab4b5949770741cd90e2 GIT binary patch literal 5778 zcmds5YdD+P+EzpBFs(QnXG-ZPsx76CRf_5q)uIj!(Uvw&p@NabP#T94r?y%}m8m)= zWC%i{8leig+J#FP0kq~)z@bs?@ z5RT1e>E^2S&W<-Dai}!roynqV3@oO;d3{vao zN#&?L9&qD-`?7wnjNnh$-BROkP#+K265`r;6y|j!ej;zLkoOV)cwm#?7Yn)3TUtbb zcBs=_lXjzdOxQwv402i-?bj-qJQ0N08xVZ9*Y#zc$>&{`(|p9V=-*@L@9YkDUTmuB z7WVA})B19DnA69(McxB=*>jYhiqj!er)OzX{Q~Ev0u4UPax&WtaV^zz#lEpCOZauows-HJm z#c`6Z3duP|jh)~vCUsbim-sN)%VIb88P1yu2oQ|pw|maqXIifCnMybW^ws#-^n>2v zlceQ>-d4&*8%e^Tr+))0oEOGlzBg{V^aBw_BE_qo{ex|fdW^VpNGkhnyNc|@qhT6F za{eSSzKu7}k{KcLzIkBI+Ue$g-VAKtieX$HH;iJek5c0kM!v4Gw}TtK67i**3bd!@ z98o0eD4mZ&5%`>8RJRl+ox5adFg2`J^+=}mICR_}oVdn3b%kn>6f^MzycoNMVERaL zq=FD7re?g%Y_@zbQxYWixO5BCP-Ziv>BTKFgWDP>^QI$-7o*SSJK#Pm_jF4bC2!yE zo%{46>8rW6^wsi}5_+h^k1OKN!qTCJlL8sQuMNbv*w-&ZAzj)}i!B;j(?n=w=YQ`m?ON0q^Pv@J&z+spsPxFi=PfmnI4(kuzh`q zH}R!8Z)+6!Yb+pUFYGQklJSuJY4IuAr|GmFr~l_wz!Z5yCcR5M&@CODE26M*8s&z( zW74HTgJ*fxWntixi+rpYI9yj zRck}xR=60bYWO={wZWkyuTuQP{O9zwEWA|0|CkX~`!-P*u2V^x?zxZzFCPl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xi$|f|n5h0S5shX0G2zEWUf*2L zj@P;Bx@$=FOF_&*a`{d&Y=Um?;oKSEM@3WIsuPjRw13r>aWCHgjnVnfKwEtKQ>t3;EyDI1O0dAOsCMqqk<1?(y*hkmH?aYXM9i+w6wXf7a7a$YdY%2&20mS~% zINSaa#$??HI~g*0tle4zW z2cjt!%3C{KK73vz+VG)VfTjYeTa4hS-;coMHUq%VGVVD;IW{xVnb^rP4?1Prqk*vF z@v;F&3HYdF1Q;K;I&? z2J*(~l9fxVet(L#Ue#Qy&h)gXii&92PVLzhfmcj1U!_j4YyIJy6&C{{J?*0;Xv1nh zp*D@)e_(9?lk7a=1HSjZ2&8x3wT(MVjFmm7Qk-~d@BWw`%G~cT*gMHhP+f@4D}0Lz zFlS(#`)4X^P?B0(I0+I`NTI-4q8pozFM%ON^7QeDhqX*ZVfAwO3Wi)kh_crH@UA}T zZvTNP@UC0>?H=DB?`%AQ9rdQ}oR(Vl*prAc*^>d*57>)D8{~Uy%ObnDUppN!xuTZH zNc?ljF8QqVQG{bBN5NeKvAFyW(PRD~WE>sMo6}|+ET@qr zpFDjs-!uP0p((^bTDOLIX(XW&EM8@i?T`ovuKF~ymmS) z+!i7j2drHaDZvd{l*y4ZsscV_>Mo$+>~ z$l=-KGl6t74TBA3)l!_*@c2D&PcPYM>t>s+)*mhOfdj&;ZNH%eAz|40lFOv*X1T+a zmk~Gb#Ekvr(Rjp5n|{T-)-sxBZTHbfS+SrGLr$H05Auue+faV?`yPT4$uYmI8sVkp zu5OL=f;UI%9PYlU&#wt&HiHF&cxq&{gR#rVBy>rqO}f)Z+1HbYa^yr7^i&wxJx*^O z1?839e^}S3u(%fN-hba7f8Qql=js1{{GET`Q1Qf*776p0g1crR7spEu4fcU4{{X7b BZfXDk literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-left-1-snap.png b/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-left-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..463e056442f5ea2d62f8ccd207ab6e0195075c65 GIT binary patch literal 5635 zcmdT|X*?8M`_38(gM{oNvLsD*%?$A%vOI)ImP|}#OR^M3gDlCCU6#>Gmc}%p8cSno zip*4qF)@tBV;RhlF%0ANJn#Sg`2N4YAI>=+&iS2lU)Q zh}zZ59@0g3wP{k<`0cdoZ_Nqu^IMBm6x0abcaYLJTXTSn1x4g7us-@lFL#j6)UIr< zalM*wBxoqnh@cd`J^LsW-9p@%Don)zx{pgah$w30159ky)Wb3%He&!}TC+O8=;gD5 z(%tDInrY(ylM8N~$VYK`Gbn(+Lclg|2IVS)Omq7WM5eyb>QivSb~F>-mAoB|T;U;c zxD|`mWF7^FOSWij)@E&;-jM#(hTv9c?sSrVP9zPPs#;3$cBsqCye(I>(|FwT%4JX! zhcT@ku(?i$Q62|$@#v;mtOOJ|w%sNoYc#axW)nv4QyhZCS}UCtIjd2At&_zm_t6~d z+Mb!1kVCBMa59UA=tH@_!j-#StM+km$-Bik9C&*KMiA?h=Wz@>%D;wH`O?;p)LjZ? z2(3;(gz)PlLvAE5m@Y3Pm;@E@Tl%fdH%A3{CME9RWapc3Bgb~odHO||0RWzb;#HXf z8LHbf%vu_CYXFDa<)Lx7JW#^+%@piloDx5`71r9SA1yroxZM~7{L!TX*M`^KeB@f{ zBW{M<=1_aQO~k?nlk7%Vn_znd9_JF?Ykdve`F?4RZrJy{GjwC{6go7 z5;bdIi39yRs+>UP0x~F;T*d3n%9ocy8-+CLz^m^}X=(*PK`O)taei1f@w30kcBw=H zTy#F{%JHuQio>cF>{Qp%G64x*x%KA4#iv|dHAGui^lY{*r;v&$yrRrLuUYVXtvHWb zgksLD+279cX{0@2{FMuAA?0??&q(m*Hf+zVyR%MpN_V#P$VHVGrtmJFDT7!x@IczX zdIAjqc-bq~1-5N&NK@=KOX{?>i6t3rJZg~i(a7vXSuwUU`U{9Ym@+k_RWur*g~Sg_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jFKr=h@=TT^+r`zNI?JnmR^uwzPYC@c|c8WTpLSSaem2LDqzf#E5Cs zyoe5U{jmofj?;V7APM}V4u(x;gl6n+xqDJ)Ii6OGX#MsamQth8Da@qsv`_yR{AnNI z@EZyWU0a4$I%Ra%jywFLgtAoK?iQ^kb zmdnvkKYWbrkG%ixJ~0Ez(1&*G*>TlsK|&#{gb2nca-g zHH*b7>?JR*UVUPoyE}mxR@D+o)d~T3E4l==9Tti5IZ{p+fAl;pyZcD9dD$MehP^i# zbh<&_Xj5$-UUp07SzL8Nmg3-rVJ@om(Rpu=c z7!(6`oad&((P0eG7rs;x?+h6ly`k_oWq&3+_K=jR>2D>?zlWOnxX`Io3!Y`$N7!hfOh}Glst=O9#q!(=S7tRC_p>jOb zi(z)c2w!~)fns|z2Nm`{{uX+cIE(FRv}>o%o^z@$!;*(RS#da^!k0FPTN>o!=90G1CN?MfB=$_|xNF^(OOz^DP#&eaCGLnLS)Cr7J@NT$%gn=rhUPI*HED=rM1X~<=r8q`>8j()#KxCY!RL9Qq63GW6wotU3M%Pq+Oc=YuZ`wS8l0*7iCca_p#-Qf5irgoAMfHw zfGMVzBM;bdtJPwKQ)>MU4AyQ?7j1~*%Z7lJD4)>;!O2sODddfB@UGa0jg>jd4leP8 zX9bZX5^!?i8h22lrmQz zMyGPcdJj?zCp+deF|(F3b?M})#_^XHL;fw`fl(g$53)A#_AIjxX$Tk_b#dpC7Sc+c z=$B@A{O&LI0tN1PL7Zga(}Jz{peI!=e);oig=E7j95G^gmG`O`=xNU_i6UxD#{_=a zPx4m7Du=I4kFVC5%p%OPA~FOFXx9$g5ri4Xse3ir3rIDH+N l2H>Ion=Afr>yR9<;Lq}Mp=MLsp18Zu(ay#8l}%vEzW_dU^jH7@ literal 0 HcmV?d00001 diff --git a/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-right-1-snap.png b/test/__image_snapshots__/text-align-test-tsx-test-text-align-test-tsx-text-align-should-work-correctly-when-text-align-right-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..b8db16cb441a18c70b29ab4b5949770741cd90e2 GIT binary patch literal 5778 zcmds5YdD+P+EzpBFs(QnXG-ZPsx76CRf_5q)uIj!(Uvw&p@NabP#T94r?y%}m8m)= zWC%i{8leig+J#FP0kq~)z@bs?@ z5RT1e>E^2S&W<-Dai}!roynqV3@oO;d3{vao zN#&?L9&qD-`?7wnjNnh$-BROkP#+K265`r;6y|j!ej;zLkoOV)cwm#?7Yn)3TUtbb zcBs=_lXjzdOxQwv402i-?bj-qJQ0N08xVZ9*Y#zc$>&{`(|p9V=-*@L@9YkDUTmuB z7WVA})B19DnA69(McxB=*>jYhiqj!er)OzX{Q~Ev0u4UPax&WtaV^zz#lEpCOZauows-HJm z#c`6Z3duP|jh)~vCUsbim-sN)%VIb88P1yu2oQ|pw|maqXIifCnMybW^ws#-^n>2v zlceQ>-d4&*8%e^Tr+))0oEOGlzBg{V^aBw_BE_qo{ex|fdW^VpNGkhnyNc|@qhT6F za{eSSzKu7}k{KcLzIkBI+Ue$g-VAKtieX$HH;iJek5c0kM!v4Gw}TtK67i**3bd!@ z98o0eD4mZ&5%`>8RJRl+ox5adFg2`J^+=}mICR_}oVdn3b%kn>6f^MzycoNMVERaL zq=FD7re?g%Y_@zbQxYWixO5BCP-Ziv>BTKFgWDP>^QI$-7o*SSJK#Pm_jF4bC2!yE zo%{46>8rW6^wsi}5_+h^k1OKN!qTCJlL8sQuMNbv*w-&ZAzj)}i!B;j(?n=w=YQ`m?ON0q^Pv@J&z+spsPxFi=PfmnI4(kuzh`q zH}R!8Z)+6!Yb+pUFYGQklJSuJY4IuAr|GmFr~l_wz!Z5yCcR5M&@CODE26M*8s&z( zW74HTgJ*fxWntixi+rpYI9yj zRck}xR=60bYWO={wZWkyuTuQP{O9zwEWA|0|CkX~`!-P*u2V^x?zxZzFCPl*owexv zWIB?Q+P9Z0EECbZ5S)u*c(wbqq1V$;wUb5w%{7P_T-^G4H=LV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SEM@3WIsuPjRw13r>aWCHgjnVnfKwEtKQ>t3;EyDI1O0dAOsCMqqk<1?(y*hkmH?aYXM9i+w6wXf7a7a$YdY%2&20mS~% zINSaa#$??HI~g*0tle4zW z2cjt!%3C{KK73vz+VG)VfTjYeTa4hS-;coMHUq%VGVVD;IW{xVnb^rP4?1Prqk*vF z@v;F&3HYdF1Q;K;I&? z2J*(~l9fxVet(L#Ue#Qy&h)gXii&92PVLzhfmcj1U!_j4YyIJy6&C{{J?*0;Xv1nh zp*D@)e_(9?lk7a=1HSjZ2&8x3wT(MVjFmm7Qk-~d@BWw`%G~cT*gMHhP+f@4D}0Lz zFlS(#`)4X^P?B0(I0+I`NTI-4q8pozFM%ON^7QeDhqX*ZVfAwO3Wi)kh_crH@UA}T zZvTNP@UC0>?H=DB?`%AQ9rdQ}oR(Vl*prAc*^>d*57>)D8{~Uy%ObnDUppN!xuTZH zNc?ljF8QqVQG{bBN5NeKvAFyW(PRD~WE>sMo6}|+ET@qr zpFDjs-!uP0p((^bTDOLIX(XW&EM8@i?T`ovuKF~ymmS) z+!i7j2drHaDZvd{l*y4ZsscV_>Mo$+>~ z$l=-KGl6t74TBA3)l!_*@c2D&PcPYM>t>s+)*mhOfdj&;ZNH%eAz|40lFOv*X1T+a zmk~Gb#Ekvr(Rjp5n|{T-)-sxBZTHbfS+SrGLr$H05Auue+faV?`yPT4$uYmI8sVkp zu5OL=f;UI%9PYlU&#wt&HiHF&cxq&{gR#rVBy>rqO}f)Z+1HbYa^yr7^i&wxJx*^O z1?839e^}S3u(%fN-hba7f8Qql=js1{{GET`Q1Qf*776p0g1crR7spEu4fcU4{{X7b BZfXDk literal 0 HcmV?d00001 diff --git a/test/line-clamp.test.tsx b/test/line-clamp.test.tsx index e6c5efea..a349b36c 100644 --- a/test/line-clamp.test.tsx +++ b/test/line-clamp.test.tsx @@ -155,6 +155,8 @@ describe('Line Clamp', () => { fontSize: 32, textAlign: 'center', lineClamp: 2, + backgroundColor: '#ff6c2f', + color: 'white', }} > Making the Web. Superfast diff --git a/test/text-align.test.tsx b/test/text-align.test.tsx new file mode 100644 index 00000000..2a800c29 --- /dev/null +++ b/test/text-align.test.tsx @@ -0,0 +1,149 @@ +import { it, describe, expect } from 'vitest' + +import { initFonts, toImage } from './utils.js' +import satori from '../src/index.js' + +describe('Text Align', () => { + let fonts + initFonts((f) => (fonts = f)) + + it('Should work correctly when `text-align: left`', async () => { + const svg = await satori( +
+
+ God kisses the finite in his love and man the infinite +
+
, + { width: 200, height: 200, fonts, embedFont: true } + ) + expect(toImage(svg, 200)).toMatchImageSnapshot() + }) + + it('Should work correctly when `text-align: center`', async () => { + const svg = await satori( +
+
+ God kisses the finite in his love and man the infinite +
+
, + { width: 200, height: 200, fonts, embedFont: true } + ) + expect(toImage(svg, 200)).toMatchImageSnapshot() + }) + + it('Should work correctly when `text-align: right`', async () => { + const svg = await satori( +
+
+ God kisses the finite in his love and man the infinite +
+
, + { width: 200, height: 200, fonts, embedFont: true } + ) + expect(toImage(svg, 200)).toMatchImageSnapshot() + }) + + it('Should work correctly when `text-align: end`', async () => { + const svg = await satori( +
+
+ God kisses the finite in his love and man the infinite +
+
, + { width: 200, height: 200, fonts, embedFont: true } + ) + expect(toImage(svg, 200)).toMatchImageSnapshot() + }) +})