From 512ebcc82b049dea9c6e90a42ba988b2326b30fa Mon Sep 17 00:00:00 2001 From: Johannes Wolf Date: Sun, 26 May 2024 02:01:33 +0200 Subject: [PATCH] tests: Add tests for custom marks --- tests/mark/custom/ref/1.png | Bin 0 -> 7573 bytes tests/mark/custom/test.typ | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/mark/custom/ref/1.png create mode 100644 tests/mark/custom/test.typ diff --git a/tests/mark/custom/ref/1.png b/tests/mark/custom/ref/1.png new file mode 100644 index 0000000000000000000000000000000000000000..25bc67f085011e18a16a69c029cfbd8f87eba590 GIT binary patch literal 7573 zcmb_hXHZkYx4-lvz4wkZ385np2)z@8P^C!`kP;ASm#%_~_V)IJ+^hsE3np6H1DIlo zl*r0eXurJFMQPzm`UAM6gr*{33J0tV02^a~kpW<&2PR$uObkGC9^hsTtPB7bOTfW6 zASVSN^nsF8K#&(exf2~oB76Wh8{m!?P-3Vf#6X{*rgY%v(T}vu)Yd@BLz*p(TP#fy zt}4U%d4m-oS#Zq(Tf~I3?L~;+g(Kp^0dZlWmzbD%VXiysd3D1^E%$*2MN30cnE{ZI0VE_Oq@*N%etvFlZgO&R@$vBp1fry*L{Lz$zrQ~-GgDhzdu3$> z3WXjV95694O-xKMGBOfRTw4{04+8qD03kl0Gz~}y0^q7Z@C_g<1{kOUTJiyR8vrT| zWJVKDlZ26hRFImAg(ysb;uSy@3dqXJGHSC0H$)T{7vCFxc#)FW{3u|3 zNlL<%bS)<5ewd^$$^%vQ9C)g~oG_)!S^CqRI!*CA>NR^UJ(t7N0@6S$UP{qo8{A?X z1#u_;|ME+2Zhm+nd8FFO@mYgY#WiOa1@W9e-eAW1>+i73>V9TCmSTy%Y*V>rC(#1mZC)naJIrtGLLV*F4w z3z^0ZCO01ERH|MOdS;*Z&c!x=Z>(HSGj6Vwz$}Z zZ46`h9z-=zh_>|m9;qp}5WFf}7J_i0Q9BRg9^|?Q>&VnG$l;mdzvJIXtuLaM`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McO-GbzBvVDaH8Gt_x#Gla>xnCnB{q$pjMP>Ck{C-9GRhR&JoOz?JVsd=v@MPacT z2u3Cccg(q>p7$ds%_%J(xk-W)upV~??WHlcac0kRMQ-d(hhDKfI9<5+w~Fsdk!wMr z*~B5$1jzjE!ece}Q!w7KbL>|Q{&Z%RbctcUs*}y&Zp=NUaC|r6cFfo?V{LzdYXL6= z_H|mOPW-#0O%xZ_DvGO{(QmG5zT$bVdvWN3q}u{X*AtnJDo$(UUAU~_Urw8mP)9%q z{qhlH6}n$7=RxklhVJpXQ@ppHbRb zyR_<5dL5QFT*l8rFpTOQ{a1Ml>D6!b+FAD((BD*VLosTjuFU+kNB=Zw4#&GlcVvnf z+>~9hK^;oYHYYkZ_++AJH2-+b`QtytVU1pKAo~f$8ohPFZ|M}Z?dKtcJo=+*b+r0V zw=>HR$*nH}G1_)d2)FWa7|n*eO*4uzA}Bvvr~37dHRX)U(}}YUgvJ@CKqX^u&d*pu zbHQ3q(9-S8kE{j97ANF9*i=y=r1n%*e)Jp(s*JWemUsN{Ro>|EPujspOgDIgC+aV* ze{HXF^rBGySvl$8aXiw(Ch>P|!O!fLkqm3yxt^3D#luO%?p!L9#d&+~kSYR*1nfz%Rg7Wkd5T4eXN z=+X9xlHD~*#ujS@E>v7E8$VTp|21NU0vt`ye-rRcm{G)^VivK6$Oaf2FpOYkM zE%ZgptR6>sQi3 z8*0)bwmA*Ty34zMX?RYHVlDtY$^ZXPqW>G>%=?mZx#JWSK4-&!6HN>(^_z6v@BSB_ C;>#-l literal 0 HcmV?d00001 diff --git a/tests/mark/custom/test.typ b/tests/mark/custom/test.typ new file mode 100644 index 00000000..01cf5939 --- /dev/null +++ b/tests/mark/custom/test.typ @@ -0,0 +1,42 @@ +#import "/src/lib.typ": * +#import "/tests/helper.typ": * +#set page(width: auto, height: auto) + +#let register-face() = { + import draw: * + + register-mark("face", style => { + circle((0,0), radius: .5, fill: yellow) + arc((0,0), start: 180deg + 30deg, delta: 180deg - 60deg, anchor: "origin", radius: .3) + circle((-.15, +.15), radius: .1, fill: white) + circle((-.10, +.10), radius: .025, fill: black) + circle((+.15, +.15), radius: .1, fill: white) + circle((+.20, +.10), radius: .025, fill: black) + + anchor("tip", (+.5, 0)) + anchor("base", (-.5, 0)) + }, mnemonic: ":)") +} + +#test-case({ + import draw: * + + register-face() + catmull((-3, 0), (-1,1), (1,-1), (3,0), mark: (end: "face", start: (symbol: ":)", flip: true, reverse: true), )) +}) + +#test-case({ + import draw: * + + line((0,-1), (0,1), stroke: green) + + register-face() + mark((0,0), (+1,0), symbol: ":)", slant: 50%, anchor: "center") +}) + +#test-case({ + import draw: * + + register-face() + line((0,0), (3,0), mark: (end: (":)", ":)", ":)"), sep: -.3)) +})