q5 2.13.3 → 2.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -27
- package/defaultFont-msdf.json +1 -0
- package/defaultFont.png +0 -0
- package/package.json +1 -1
- package/q5.d.ts +32 -5
- package/q5.js +73 -54
- package/q5.min.js +1 -1
- package/src/q5-2d-drawing.js +7 -7
- package/src/q5-2d-text.js +1 -1
- package/src/q5-core.js +5 -7
- package/src/q5-input.js +2 -2
- package/src/q5-math.js +2 -1
- package/src/q5-webgpu-canvas.js +12 -12
- package/src/q5-webgpu-drawing.js +30 -18
- package/src/q5-webgpu-text.js +14 -6
package/README.md
CHANGED
|
@@ -65,35 +65,11 @@ q5 is open source and anyone can use it for free under the terms of the LGPL (ju
|
|
|
65
65
|
|
|
66
66
|
We need your support though! If you enjoy using q5.js, please donate via [GitHub Sponsors](https://github.com/sponsors/quinton-ashley) or [Patreon](https://www.patreon.com/p5play).
|
|
67
67
|
|
|
68
|
-
## Size Comparison
|
|
69
|
-
|
|
70
|
-
q5 is 98% smaller than p5.
|
|
71
|
-
|
|
72
|
-
p5.js is nearly 5MB in size due to lengthy JSDoc comments, [the WebGL render, and the dependencies corejs and opentype](https://github.com/processing/p5.js/issues/6776#issuecomment-1918238317).
|
|
73
|
-
|
|
74
|
-
q5's JSDoc comments are stored separately in the q5.d.ts file, which includes type definitions for Visual Studio Code autocompletion. q5 also has no dependencies.
|
|
75
|
-
|
|
76
|
-
npm packages:
|
|
77
|
-
|
|
78
|
-
- p5 **7800kb** ⚠️
|
|
79
|
-
- @types/p5 1070kb
|
|
80
|
-
- q5 415kb
|
|
81
|
-
|
|
82
|
-
Unminified:
|
|
83
|
-
|
|
84
|
-
- p5.js **5112kb** ⚠️
|
|
85
|
-
- p5.sound.js 488kb
|
|
86
|
-
- q5.js 117kb
|
|
87
|
-
|
|
88
|
-
Minified:
|
|
89
|
-
|
|
90
|
-
- p5.min.js 1034kb ⚠️
|
|
91
|
-
- p5.sound.min.js 200kb
|
|
92
|
-
- q5.min.js **73kb** 🎉
|
|
93
|
-
|
|
94
68
|
## Modular Use
|
|
95
69
|
|
|
96
|
-
|
|
70
|
+
q5 has no dependencies and the default bundle is just 126kb unminified.
|
|
71
|
+
|
|
72
|
+
But for extremely lightweight use, you can load a subset of scripts from the `src` folder. See the [src/readme.md](src/readme.md) for more info on modular use.
|
|
97
73
|
|
|
98
74
|
## Contributing
|
|
99
75
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"pages":["defaultFont.png"],"chars":"id index char width height xoffset yoffset xadvance chnl x y page\n124 98 \"|\" 8 49 2 1 11 15 0 0 0\n253 190 \"ý\" 26 49 -2 2 22 15 0 50 0\n106 80 \"j\" 16 48 -6 3 11 15 9 0 0\n254 191 \"þ\" 25 48 2 2 27 15 26 0 0\n87 61 \"W\" 46 36 -1 4 43 15 0 100 0\n192 129 \"À\" 33 46 -2 -6 30 15 27 49 0\n193 130 \"Á\" 33 46 -2 -6 30 15 52 0 0\n194 131 \"Â\" 33 46 -2 -6 30 15 0 137 0\n199 136 \"Ç\" 28 46 0 4 28 15 0 184 0\n200 137 \"È\" 21 46 2 -6 23 15 0 231 0\n201 138 \"É\" 21 46 2 -6 23 15 0 278 0\n202 139 \"Ê\" 21 46 2 -6 23 15 0 325 0\n204 141 \"Ì\" 15 46 -1 -6 12 15 0 372 0\n205 142 \"Í\" 15 46 -1 -6 12 15 0 419 0\n206 143 \"Î\" 17 46 -2 -6 12 15 0 466 0\n210 147 \"Ò\" 34 46 0 -6 34 15 16 372 0\n211 148 \"Ó\" 34 46 0 -6 34 15 16 419 0\n212 149 \"Ô\" 34 46 0 -6 34 15 18 466 0\n217 154 \"Ù\" 28 46 2 -6 31 15 22 231 0\n218 155 \"Ú\" 28 46 2 -6 31 15 29 184 0\n219 156 \"Û\" 28 46 2 -6 31 15 34 137 0\n221 158 \"Ý\" 29 46 -2 -6 25 15 61 47 0\n255 192 \"ÿ\" 26 46 -2 5 22 15 86 0 0\n81 55 \"Q\" 35 45 0 4 34 15 22 278 0\n213 150 \"Õ\" 34 45 0 -4 34 15 51 231 0\n36 10 \"$\" 22 44 1 0 25 15 58 184 0\n195 132 \"Ã\" 33 44 -2 -4 30 15 22 324 0\n209 146 \"Ñ\" 30 44 2 -4 34 15 63 94 0\n214 151 \"Ö\" 34 44 0 -3 34 15 63 139 0\n220 157 \"Ü\" 28 44 2 -3 31 15 91 47 0\n40 14 \"(\" 14 43 1 4 14 15 81 184 0\n41 15 \")\" 15 43 -2 4 14 15 113 0 0\n91 65 \"[\" 12 43 2 4 14 15 94 92 0\n93 67 \"]\" 12 43 -1 4 14 15 51 369 0\n123 97 \"{\" 15 43 0 4 14 15 56 324 0\n125 99 \"}\" 15 43 -1 4 14 15 58 277 0\n196 133 \"Ä\" 33 43 -2 -3 30 15 51 413 0\n197 134 \"Å\" 33 43 -2 -3 30 15 64 368 0\n203 140 \"Ë\" 21 43 2 -3 23 15 72 321 0\n207 144 \"Ï\" 17 43 -2 -3 12 15 74 277 0\n47 21 \"/\" 23 41 -3 4 18 15 86 228 0\n92 66 \"\\\\\" 23 41 -3 4 17 15 96 184 0\n198 135 \"Æ\" 41 36 -2 4 39 15 98 136 0\n64 38 \"@\" 40 40 2 4 43 15 107 92 0\n223 160 \"ß\" 24 39 2 2 25 15 120 44 0\n224 161 \"à\" 22 39 0 2 23 15 129 0 0\n225 162 \"á\" 22 39 0 2 23 15 92 270 0\n226 163 \"â\" 22 39 0 2 23 15 110 226 0\n229 166 \"å\" 22 39 0 1 23 15 145 40 0\n232 169 \"è\" 24 39 0 2 24 15 152 0 0\n233 170 \"é\" 24 39 0 2 24 15 120 173 0\n234 171 \"ê\" 24 39 0 2 24 15 140 133 0\n242 179 \"ò\" 27 39 0 2 27 15 148 80 0\n243 180 \"ó\" 27 39 0 2 27 15 168 40 0\n244 181 \"ô\" 27 39 0 2 27 15 177 0 0\n249 186 \"ù\" 23 39 1 2 26 15 53 457 0\n250 187 \"ú\" 23 39 1 2 26 15 77 457 0\n251 188 \"û\" 23 39 1 2 26 15 85 412 0\n37 11 \"%\" 38 37 0 4 37 15 94 310 0\n98 72 \"b\" 25 38 2 2 27 15 115 266 0\n100 74 \"d\" 25 38 0 2 27 15 133 213 0\n102 76 \"f\" 18 38 -1 2 15 15 145 173 0\n103 77 \"g\" 25 38 0 13 27 15 101 452 0\n104 78 \"h\" 23 38 2 2 26 15 98 348 0\n107 81 \"k\" 23 38 2 2 23 15 109 387 0\n108 82 \"l\" 8 38 2 2 11 15 122 348 0\n112 86 \"p\" 25 38 2 13 27 15 131 348 0\n113 87 \"q\" 25 38 0 13 27 15 133 305 0\n216 153 \"Ø\" 34 38 0 3 34 15 141 252 0\n230 167 \"æ\" 38 28 0 13 38 15 159 212 0\n236 173 \"ì\" 13 38 -2 2 11 15 164 173 0\n237 174 \"í\" 13 38 0 2 11 15 47 96 0\n238 175 \"î\" 17 38 -3 2 11 15 165 120 0\n240 177 \"ð\" 25 38 0 2 26 15 176 80 0\n38 12 \"&\" 37 37 1 4 37 15 196 40 0\n48 22 \"0\" 25 37 0 4 25 15 205 0 0\n51 25 \"3\" 23 37 1 4 25 15 231 0 0\n54 28 \"6\" 24 37 0 4 25 15 178 159 0\n56 30 \"8\" 24 37 0 4 25 15 183 119 0\n57 31 \"9\" 24 37 0 4 25 15 202 78 0\n63 37 \"?\" 19 37 1 4 20 15 127 426 0\n67 41 \"C\" 28 37 0 4 28 15 133 387 0\n71 45 \"G\" 30 37 0 4 31 15 157 344 0\n77 51 \"M\" 37 36 2 4 41 15 127 464 0\n79 53 \"O\" 34 37 0 4 34 15 147 425 0\n83 57 \"S\" 24 37 1 4 24 15 162 382 0\n105 79 \"i\" 9 37 1 3 11 15 165 463 0\n109 83 \"m\" 37 27 2 13 39 15 175 463 0\n121 95 \"y\" 26 37 -2 13 22 15 182 420 0\n169 106 \"©\" 37 37 2 4 40 15 187 382 0\n174 111 \"®\" 37 37 2 4 40 15 209 420 0\n191 128 \"¿\" 19 37 1 13 20 15 159 291 0\n227 164 \"ã\" 22 37 0 4 23 15 176 241 0\n231 168 \"ç\" 21 37 0 13 21 15 198 197 0\n245 182 \"õ\" 27 37 0 4 27 15 203 157 0\n33 7 \"!\" 9 36 2 4 13 15 208 116 0\n49 23 \"1\" 22 36 2 4 25 15 218 116 0\n50 24 \"2\" 24 36 0 4 25 15 227 78 0\n52 26 \"4\" 27 36 -2 4 25 15 234 38 0\n53 27 \"5\" 22 36 2 4 25 15 255 0 0\n55 29 \"7\" 25 36 0 4 25 15 213 458 0\n65 39 \"A\" 33 36 -2 4 30 15 239 458 0\n66 40 \"B\" 24 36 2 4 26 15 179 279 0\n68 42 \"D\" 30 36 2 4 32 15 199 235 0\n69 43 \"E\" 21 36 2 4 23 15 220 195 0\n70 44 \"F\" 20 36 2 4 22 15 231 153 0\n72 46 \"H\" 28 36 2 4 32 15 241 115 0\n73 47 \"I\" 14 36 -1 4 12 15 252 75 0\n74 48 \"J\" 16 36 -2 4 17 15 262 37 0\n75 49 \"K\" 27 36 2 4 27 15 278 0 0\n76 50 \"L\" 21 36 2 4 22 15 267 74 0\n78 52 \"N\" 30 36 2 4 34 15 279 37 0\n80 54 \"P\" 24 36 2 4 26 15 306 0 0\n82 56 \"R\" 27 36 2 4 27 15 188 316 0\n84 58 \"T\" 26 36 -1 4 24 15 204 272 0\n85 59 \"U\" 28 36 2 4 31 15 230 232 0\n86 60 \"V\" 32 36 -2 4 28 15 242 190 0\n88 62 \"X\" 30 36 -1 4 27 15 252 152 0\n89 63 \"Y\" 29 36 -2 4 25 15 270 111 0\n90 64 \"Z\" 28 36 -1 4 26 15 289 74 0\n119 93 \"w\" 36 27 -1 13 33 15 188 353 0\n161 4 \"¡\" 9 36 2 13 13 15 310 37 0\n162 5 \"¢\" 21 36 2 5 25 15 216 309 0\n163 6 \"£\" 24 36 0 4 25 15 231 269 0\n165 102 \"¥\" 26 36 -1 4 25 15 225 346 0\n208 145 \"Ð\" 33 36 -1 4 32 15 225 383 0\n222 159 \"Þ\" 24 36 2 4 26 15 247 420 0\n228 165 \"ä\" 22 36 0 5 23 15 238 306 0\n235 172 \"ë\" 24 36 0 5 24 15 256 269 0\n241 178 \"ñ\" 23 36 2 4 26 15 252 343 0\n246 183 \"ö\" 27 36 0 5 27 15 261 306 0\n252 189 \"ü\" 23 36 1 5 26 15 259 380 0\n128 0 \"\" 26 35 2 5 29 15 276 343 0\n239 176 \"ï\" 17 35 -3 5 11 15 272 417 0\n116 90 \"t\" 18 34 -1 7 16 15 283 379 0\n35 9 \"#\" 29 33 -1 4 27 15 259 227 0\n59 33 \";\" 11 33 -1 13 10 15 275 189 0\n248 185 \"ø\" 29 31 -1 11 27 15 283 148 0\n960 362 \"π\" 31 27 -2 13 29 15 300 111 0\n58 32 \":\" 9 28 0 13 10 15 318 74 0\n97 71 \"a\" 22 28 0 13 23 15 320 37 0\n99 73 \"c\" 21 28 0 13 21 15 331 0 0\n101 75 \"e\" 24 28 0 13 24 15 281 261 0\n111 85 \"o\" 27 28 0 13 27 15 328 66 0\n115 89 \"s\" 19 28 0 13 19 15 343 29 0\n110 84 \"n\" 23 27 2 13 26 15 353 0 0\n114 88 \"r\" 16 27 2 13 16 15 287 180 0\n117 91 \"u\" 23 27 1 13 26 15 289 290 0\n118 92 \"v\" 26 27 -2 13 22 15 289 208 0\n120 94 \"x\" 24 27 -1 13 21 15 304 180 0\n122 96 \"z\" 23 27 -1 13 21 15 313 139 0\n60 34 \"<\" 23 26 4 12 31 15 332 95 0\n62 36 \">\" 23 26 4 12 31 15 306 236 0\n126 100 \"~\" 26 11 3 19 31 15 53 501 0\n247 184 \"÷\" 25 26 3 12 31 15 306 263 0\n43 17 \"+\" 25 25 3 12 31 15 316 208 0\n61 35 \"=\" 25 17 3 17 31 15 101 491 0\n94 68 \"^\" 25 23 3 4 31 15 289 318 0\n179 116 \"³\" 16 24 1 4 17 15 289 236 0\n95 69 \"_\" 23 7 -2 40 19 15 120 84 0\n178 115 \"²\" 16 23 0 4 17 15 109 426 0\n185 122 \"¹\" 16 23 1 4 16 15 313 290 0\n215 152 \"×\" 23 23 4 13 31 15 330 234 0\n186 123 \"º\" 20 21 0 4 20 15 175 491 0\n42 16 \"*\" 20 20 0 4 19 15 329 167 0\n8220 532 \"“\" 17 14 25 4 42 15 178 197 0\n8221 533 \"”\" 17 14 0 4 42 15 159 329 0\n45 19 \"-\" 16 7 1 22 18 15 148 120 0\n176 113 \"°\" 16 16 0 4 17 15 332 122 0\n44 18 \",\" 10 15 -1 31 10 15 98 387 0\n34 8 \"\\\"\" 14 14 2 4 18 15 80 497 0\n39 13 \"'\" 8 14 1 4 11 15 179 316 0\n8216 528 \"‘\" 10 14 32 4 42 15 196 495 0\n8217 529 \"’\" 10 14 0 4 42 15 207 495 0\n96 70 \"`\" 13 11 0 2 12 15 127 501 0\n180 117 \"´\" 13 11 1 2 13 15 141 501 0\n46 20 \".\" 9 9 0 31 10 15 98 173 0\n183 120 \"·\" 9 9 0 20 10 15 159 241 0","info":{"face":"YaHei","size":42},"common":{"lineHeight":45,"base":36,"scaleW":512,"scaleH":512},"kernings":"first second amount\n34 114 -1\n34 115 -1\n39 114 -1\n39 115 -1\n40 106 5\n42 65 -4\n42 74 -3\n42 99 -2\n42 100 -2\n42 101 -2\n42 103 -2\n42 111 -2\n42 113 -2\n44 8216 -5\n44 8217 -5\n44 8220 -5\n44 8221 -5\n46 8216 -5\n46 8217 -4\n46 8220 -5\n46 8221 -4\n65 42 -3\n65 44 1\n65 59 1\n65 67 -1\n65 71 -1\n65 74 2\n65 79 -1\n65 84 -3\n65 85 -1\n65 86 -3\n65 87 -2\n65 89 -3\n65 90 1\n65 116 -1\n65 118 -1\n65 119 -1\n65 121 -1\n65 8216 -3\n65 8217 -4\n65 8220 -3\n65 8221 -4\n66 84 -2\n66 89 -1\n67 63 0\n67 67 -1\n67 71 -1\n67 79 -1\n67 81 -1\n68 44 -3\n68 46 -3\n68 65 -1\n68 84 -2\n68 88 -1\n68 90 -1\n69 65 0\n69 74 1\n69 84 0\n69 87 1\n69 88 0\n70 44 -3\n70 46 -3\n70 65 -3\n70 74 -1\n70 83 -1\n70 84 0\n70 97 -2\n70 102 0\n71 84 -1\n71 86 -1\n71 121 -1\n74 44 -2\n74 46 -2\n74 65 -1\n74 74 -1\n74 97 -1\n74 224 -1\n74 225 -1\n75 44 1\n75 59 1\n75 67 -2\n75 71 -2\n75 74 2\n75 79 -2\n75 81 -2\n75 88 1\n75 90 1\n75 99 -1\n75 100 -1\n75 101 -1\n75 103 -1\n75 111 -1\n75 113 -1\n75 116 -1\n75 118 -2\n75 119 -1\n75 121 -2\n75 232 -1\n75 233 -1\n75 234 -1\n75 237 -1\n75 242 -1\n75 243 -1\n76 42 -5\n76 63 -2\n76 65 1\n76 67 -1\n76 71 -1\n76 74 2\n76 79 -2\n76 81 -2\n76 84 -3\n76 85 -1\n76 86 -3\n76 87 -1\n76 89 -3\n76 90 1\n76 116 -1\n76 118 -2\n76 119 -1\n76 121 -2\n76 8216 -3\n76 8217 -3\n76 8220 -3\n76 8221 -3\n79 44 -2\n79 46 -2\n79 65 -1\n79 74 0\n79 84 -2\n79 88 -1\n79 89 -1\n79 90 -1\n80 44 -7\n80 46 -7\n80 65 -4\n80 71 0\n80 74 -3\n80 87 1\n80 88 -1\n80 97 -1\n80 99 -2\n80 100 -2\n80 101 -2\n80 103 -2\n80 111 -2\n80 113 -2\n80 224 -1\n80 225 -1\n80 232 -2\n80 233 -2\n80 234 -2\n80 242 -2\n80 243 -2\n81 44 -2\n81 46 -3\n81 65 -1\n81 84 -2\n81 88 -1\n81 89 0\n81 90 -1\n82 59 2\n82 67 -1\n82 71 -1\n82 74 1\n82 79 0\n82 81 0\n82 84 -1\n82 89 -1\n82 99 -1\n82 100 -1\n82 101 -1\n82 103 -1\n82 111 -1\n82 113 -1\n82 232 -1\n82 233 -1\n82 234 -1\n82 242 -1\n82 243 -1\n83 116 -1\n83 118 -1\n83 119 -1\n83 121 -1\n84 44 -3\n84 46 -4\n84 58 -1\n84 59 -1\n84 65 -3\n84 67 -2\n84 71 -2\n84 74 -3\n84 79 -2\n84 81 -2\n84 84 1\n84 86 1\n84 87 1\n84 88 0\n84 89 1\n84 97 -5\n84 99 -5\n84 100 -5\n84 101 -5\n84 102 -2\n84 103 -5\n84 109 -4\n84 110 -4\n84 111 -5\n84 112 -4\n84 113 -5\n84 114 -4\n84 115 -3\n84 117 -4\n84 118 -2\n84 119 -3\n84 120 -4\n84 121 -3\n84 122 -3\n84 224 -5\n84 225 -5\n84 232 -5\n84 233 -5\n84 234 -5\n84 237 -1\n84 242 -5\n84 243 -5\n84 249 -4\n84 250 -4\n84 252 -4\n84 8217 1\n84 8221 1\n85 65 -1\n86 44 -5\n86 46 -5\n86 65 -3\n86 67 -1\n86 71 -1\n86 74 -2\n86 79 0\n86 81 -1\n86 83 -1\n86 84 1\n86 97 -3\n86 99 -3\n86 100 -3\n86 101 -3\n86 103 -3\n86 109 -2\n86 110 -2\n86 111 -3\n86 112 -2\n86 113 -3\n86 114 -2\n86 115 -1\n86 117 -2\n86 224 -3\n86 225 -3\n86 232 -3\n86 233 -3\n86 234 -3\n86 242 -3\n86 243 -3\n86 249 -2\n86 250 -2\n86 252 -2\n87 44 -3\n87 46 -3\n87 65 -2\n87 84 1\n87 97 -2\n87 99 -1\n87 100 -1\n87 101 -1\n87 103 -1\n87 111 -1\n87 113 -1\n87 224 -2\n87 225 -2\n87 232 -1\n87 233 -1\n87 234 -1\n87 242 -1\n87 243 -1\n88 44 1\n88 46 1\n88 59 2\n88 67 -1\n88 71 -1\n88 74 2\n88 79 -1\n88 81 -1\n88 84 1\n89 44 -4\n89 46 -4\n89 65 -4\n89 67 -1\n89 71 -1\n89 74 -1\n89 79 -1\n89 81 -1\n89 83 -1\n89 84 1\n89 97 -4\n89 99 -4\n89 100 -4\n89 101 -4\n89 102 -1\n89 103 -4\n89 109 -3\n89 110 -3\n89 111 -4\n89 112 -3\n89 113 -4\n89 114 -3\n89 115 -3\n89 117 -3\n89 224 -4\n89 225 -4\n89 232 -4\n89 233 -4\n89 234 -4\n89 242 -4\n89 243 -4\n89 249 -3\n89 250 -3\n89 252 -3\n90 74 2\n90 84 1\n90 121 -1\n91 106 5\n98 97 -1\n98 102 0\n98 120 -1\n98 224 -1\n98 225 -1\n99 74 2\n99 84 -2\n99 89 -2\n101 34 -2\n101 39 -2\n102 41 3\n102 44 -3\n102 45 -2\n102 46 -3\n102 58 2\n102 59 2\n102 63 1\n102 93 3\n102 98 0\n102 104 0\n102 116 1\n102 118 1\n102 119 1\n102 120 0\n102 121 1\n102 125 2\n102 236 1\n102 8216 2\n102 8217 2\n102 8220 2\n102 8221 2\n103 106 1\n106 106 1\n107 44 2\n107 45 -3\n107 46 2\n107 58 2\n107 59 2\n107 99 -1\n107 100 -1\n107 101 -1\n107 103 -1\n107 111 -1\n107 113 -1\n107 116 0\n107 232 -1\n107 233 -1\n107 234 -1\n107 242 -1\n107 243 -1\n110 34 -2\n110 39 -2\n111 34 -3\n111 39 -3\n111 97 -1\n111 102 -1\n111 120 -1\n111 224 -1\n111 225 -1\n111 8216 -1\n111 8217 -3\n111 8220 -2\n111 8221 -3\n112 97 -1\n112 102 -1\n112 120 -1\n112 224 -1\n112 225 -1\n112 8216 -3\n112 8217 -3\n112 8220 -1\n112 8221 -3\n113 106 2\n114 44 -4\n114 45 -3\n114 46 -4\n114 58 2\n114 59 2\n114 99 -1\n114 100 -1\n114 101 -1\n114 102 1\n114 103 -1\n114 109 0\n114 110 0\n114 111 -1\n114 113 -1\n114 115 0\n114 116 1\n114 118 2\n114 119 2\n114 120 1\n114 121 2\n114 122 1\n114 232 -1\n114 233 -1\n114 234 -1\n114 242 -1\n114 243 -1\n114 8216 4\n114 8217 3\n114 8220 4\n114 8221 3\n116 45 -3\n116 63 -1\n116 99 -1\n116 100 -1\n116 101 0\n116 103 0\n116 111 0\n116 113 0\n116 120 1\n116 232 0\n116 233 0\n116 234 0\n116 242 0\n116 243 0\n117 34 -1\n117 39 -1\n118 44 -3\n118 46 -3\n118 97 -1\n118 99 0\n118 100 0\n118 101 0\n118 103 0\n118 111 0\n118 113 0\n118 224 -1\n118 225 -1\n118 232 0\n118 233 0\n118 234 0\n118 242 0\n118 243 0\n119 44 -2\n119 46 -2\n119 99 0\n119 100 0\n119 101 0\n119 103 0\n119 111 0\n119 113 0\n119 232 0\n119 233 0\n119 234 0\n119 242 0\n119 243 0\n120 99 0\n120 100 0\n120 101 0\n120 103 0\n120 111 0\n120 113 0\n120 232 0\n120 233 0\n120 234 0\n120 242 0\n120 243 0\n121 34 1\n121 39 1\n121 44 -2\n121 46 -3\n121 63 -2\n121 99 0\n121 100 0\n121 101 0\n121 102 0\n121 103 0\n121 111 0\n121 113 0\n121 116 0\n121 232 0\n121 233 0\n121 234 0\n121 242 0\n121 243 0\n123 106 4\n242 97 -1\n242 102 -1\n242 120 -1\n243 97 -1\n243 102 -1\n243 120 -1\n8216 65 -5\n8216 67 -1\n8216 74 -3\n8216 84 2\n8216 99 -3\n8216 100 -4\n8216 101 -3\n8216 103 -3\n8216 111 -3\n8216 115 -2\n8216 8216 -4\n8217 44 -2\n8217 46 -2\n8217 65 -4\n8217 74 -4\n8217 84 2\n8217 97 -2\n8217 99 -4\n8217 100 -4\n8217 101 -4\n8217 103 -4\n8217 111 -4\n8217 113 -3\n8217 115 -3\n8217 8217 -4\n8220 44 -2\n8220 46 -2\n8220 65 -5\n8220 74 -4\n8220 84 2\n8220 99 -3\n8220 100 -3\n8220 101 -3\n8220 103 -3\n8220 115 -2\n8221 44 -2\n8221 46 -2\n8221 65 -3\n8221 84 2\n8221 99 -1\n8221 100 -4\n8221 101 -4\n8221 103 -4\n8221 111 -4\n8221 115 -3"}
|
package/defaultFont.png
ADDED
|
Binary file
|
package/package.json
CHANGED
package/q5.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ function draw() {
|
|
|
18
18
|
function draw(): void;
|
|
19
19
|
|
|
20
20
|
/** ⭐️
|
|
21
|
-
* The setup function is
|
|
21
|
+
* The setup function is run once, when the program starts.
|
|
22
22
|
* @example
|
|
23
23
|
function setup() {
|
|
24
24
|
createCanvas(200, 100);
|
|
@@ -76,7 +76,7 @@ function draw() {
|
|
|
76
76
|
circle(frameCount * 5, 100, 80);
|
|
77
77
|
}
|
|
78
78
|
function mousePressed() {
|
|
79
|
-
redraw(
|
|
79
|
+
redraw(10);
|
|
80
80
|
}
|
|
81
81
|
*/
|
|
82
82
|
function redraw(n?: number): void;
|
|
@@ -97,7 +97,12 @@ function mousePressed() {
|
|
|
97
97
|
function loop(): void;
|
|
98
98
|
|
|
99
99
|
/** ⭐️
|
|
100
|
-
* Sets the target frame rate or gets
|
|
100
|
+
* Sets the target frame rate or gets an approximation of the
|
|
101
|
+
* sketch's current frame rate.
|
|
102
|
+
*
|
|
103
|
+
* Even when the sketch is running at a consistent frame rate,
|
|
104
|
+
* the current frame rate value will fluctuate. Use your web browser's
|
|
105
|
+
* developer tools for more accurate performance analysis.
|
|
101
106
|
* @param {number} [hertz] target frame rate, default is 60
|
|
102
107
|
* @returns {number} current frame rate
|
|
103
108
|
* @example
|
|
@@ -133,8 +138,10 @@ function draw() {
|
|
|
133
138
|
|
|
134
139
|
/** ⭐️
|
|
135
140
|
* Gets the current FPS, in terms of how many frames could be generated
|
|
136
|
-
* in one second, which can be higher than the target frame rate.
|
|
137
|
-
*
|
|
141
|
+
* in one second, which can be higher than the target frame rate.
|
|
142
|
+
*
|
|
143
|
+
* Use your web browser's developer tools for more in-depth
|
|
144
|
+
* performance analysis.
|
|
138
145
|
* @returns {number} frames per second
|
|
139
146
|
* @example
|
|
140
147
|
function draw() {
|
|
@@ -158,6 +165,24 @@ function draw() {
|
|
|
158
165
|
*/
|
|
159
166
|
function log(message: any): void;
|
|
160
167
|
|
|
168
|
+
/** ⭐️
|
|
169
|
+
* Runs after each `draw` function call and post draw hooks.
|
|
170
|
+
*
|
|
171
|
+
* Useful for adding post-processing effects when it's not possible
|
|
172
|
+
* to do so at the end of the `draw` function, such as when using
|
|
173
|
+
* libraries like p5play that draw to the canvas after the `draw`
|
|
174
|
+
* function is run.
|
|
175
|
+
* @example
|
|
176
|
+
function draw() {
|
|
177
|
+
background(200);
|
|
178
|
+
circle(frameCount % 200, 100, 80);
|
|
179
|
+
}
|
|
180
|
+
function postProcess() {
|
|
181
|
+
filter(INVERT);
|
|
182
|
+
}
|
|
183
|
+
*/
|
|
184
|
+
function postProcess(): void;
|
|
185
|
+
|
|
161
186
|
/** ⭐️
|
|
162
187
|
* The width of the window.
|
|
163
188
|
* @example
|
|
@@ -1871,6 +1896,8 @@ noCursor();
|
|
|
1871
1896
|
|
|
1872
1897
|
/** 🧮
|
|
1873
1898
|
* Calculates the distance between two points.
|
|
1899
|
+
*
|
|
1900
|
+
* This function also accepts two objects with `x` and `y` properties.
|
|
1874
1901
|
* @param {number} x1 x-coordinate of the first point
|
|
1875
1902
|
* @param {number} y1 y-coordinate of the first point
|
|
1876
1903
|
* @param {number} x2 x-coordinate of the second point
|
package/q5.js
CHANGED
|
@@ -20,14 +20,14 @@ function Q5(scope, parent, renderer) {
|
|
|
20
20
|
let autoLoaded = scope == 'auto';
|
|
21
21
|
scope ??= 'global';
|
|
22
22
|
if (scope == 'auto') {
|
|
23
|
-
if (!(window.setup || window.draw)) return;
|
|
23
|
+
if (!(window.setup || window.update || window.draw)) return;
|
|
24
24
|
scope = 'global';
|
|
25
25
|
}
|
|
26
26
|
$._scope = scope;
|
|
27
27
|
let globalScope;
|
|
28
28
|
if (scope == 'global') {
|
|
29
29
|
Q5._hasGlobal = $._isGlobal = true;
|
|
30
|
-
globalScope = !Q5._server ? window : global;
|
|
30
|
+
globalScope = Q5._esm ? globalThis : !Q5._server ? window : global;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
let q = new Proxy($, {
|
|
@@ -179,10 +179,7 @@ function Q5(scope, parent, renderer) {
|
|
|
179
179
|
delete Q5.Q5;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
if ($._webgpuFallback)
|
|
183
|
-
$.colorMode('rgb', 1);
|
|
184
|
-
$._beginRender = () => $.translate($.canvas.hw, $.canvas.hh);
|
|
185
|
-
}
|
|
182
|
+
if ($._webgpuFallback) $.colorMode('rgb', 1);
|
|
186
183
|
|
|
187
184
|
for (let m of Q5.methods.init) {
|
|
188
185
|
m.call($);
|
|
@@ -287,6 +284,7 @@ Q5.renderers = {};
|
|
|
287
284
|
Q5.modules = {};
|
|
288
285
|
|
|
289
286
|
Q5._server = typeof process == 'object';
|
|
287
|
+
Q5._esm = this === undefined;
|
|
290
288
|
|
|
291
289
|
Q5._instanceCount = 0;
|
|
292
290
|
Q5._friendlyError = (msg, func) => {
|
|
@@ -315,7 +313,7 @@ function createCanvas(w, h, opt) {
|
|
|
315
313
|
}
|
|
316
314
|
}
|
|
317
315
|
|
|
318
|
-
Q5.version = Q5.VERSION = '2.
|
|
316
|
+
Q5.version = Q5.VERSION = '2.13';
|
|
319
317
|
|
|
320
318
|
if (typeof document == 'object') {
|
|
321
319
|
document.addEventListener('DOMContentLoaded', () => {
|
|
@@ -1107,19 +1105,19 @@ Q5.renderers.q2d.drawing = ($) => {
|
|
|
1107
1105
|
};
|
|
1108
1106
|
|
|
1109
1107
|
$.beginShape = () => {
|
|
1110
|
-
curveBuff
|
|
1108
|
+
curveBuff = [];
|
|
1111
1109
|
$.ctx.beginPath();
|
|
1112
1110
|
firstVertex = true;
|
|
1113
1111
|
};
|
|
1114
1112
|
|
|
1115
1113
|
$.beginContour = () => {
|
|
1116
1114
|
$.ctx.closePath();
|
|
1117
|
-
curveBuff
|
|
1115
|
+
curveBuff = [];
|
|
1118
1116
|
firstVertex = true;
|
|
1119
1117
|
};
|
|
1120
1118
|
|
|
1121
1119
|
$.endContour = () => {
|
|
1122
|
-
curveBuff
|
|
1120
|
+
curveBuff = [];
|
|
1123
1121
|
firstVertex = true;
|
|
1124
1122
|
};
|
|
1125
1123
|
|
|
@@ -1128,7 +1126,7 @@ Q5.renderers.q2d.drawing = ($) => {
|
|
|
1128
1126
|
x *= $._da;
|
|
1129
1127
|
y *= $._da;
|
|
1130
1128
|
}
|
|
1131
|
-
curveBuff
|
|
1129
|
+
curveBuff = [];
|
|
1132
1130
|
if (firstVertex) {
|
|
1133
1131
|
$.ctx.moveTo(x, y);
|
|
1134
1132
|
} else {
|
|
@@ -1146,7 +1144,7 @@ Q5.renderers.q2d.drawing = ($) => {
|
|
|
1146
1144
|
x *= $._da;
|
|
1147
1145
|
y *= $._da;
|
|
1148
1146
|
}
|
|
1149
|
-
curveBuff
|
|
1147
|
+
curveBuff = [];
|
|
1150
1148
|
$.ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
1151
1149
|
};
|
|
1152
1150
|
|
|
@@ -1157,7 +1155,7 @@ Q5.renderers.q2d.drawing = ($) => {
|
|
|
1157
1155
|
x *= $._da;
|
|
1158
1156
|
y *= $._da;
|
|
1159
1157
|
}
|
|
1160
|
-
curveBuff
|
|
1158
|
+
curveBuff = [];
|
|
1161
1159
|
$.ctx.quadraticCurveTo(cp1x, cp1y, x, y);
|
|
1162
1160
|
};
|
|
1163
1161
|
|
|
@@ -1186,7 +1184,7 @@ Q5.renderers.q2d.drawing = ($) => {
|
|
|
1186
1184
|
};
|
|
1187
1185
|
|
|
1188
1186
|
$.endShape = (close) => {
|
|
1189
|
-
curveBuff
|
|
1187
|
+
curveBuff = [];
|
|
1190
1188
|
if (close) $.ctx.closePath();
|
|
1191
1189
|
ink();
|
|
1192
1190
|
};
|
|
@@ -1988,7 +1986,7 @@ Q5.renderers.q2d.text = ($, q) => {
|
|
|
1988
1986
|
lineAmount++;
|
|
1989
1987
|
if (lineAmount >= h) break;
|
|
1990
1988
|
}
|
|
1991
|
-
lines
|
|
1989
|
+
lines = [];
|
|
1992
1990
|
|
|
1993
1991
|
if (!$._fillSet) ctx.fillStyle = ogFill;
|
|
1994
1992
|
|
|
@@ -2645,8 +2643,8 @@ Q5.modules.input = ($, q) => {
|
|
|
2645
2643
|
};
|
|
2646
2644
|
|
|
2647
2645
|
if (window) {
|
|
2648
|
-
$.
|
|
2649
|
-
$.
|
|
2646
|
+
$.lockMouse = document.body?.requestPointerLock;
|
|
2647
|
+
$.unlockMouse = document.exitPointerLock;
|
|
2650
2648
|
}
|
|
2651
2649
|
|
|
2652
2650
|
$._onkeydown = (e) => {
|
|
@@ -2793,8 +2791,9 @@ Q5.modules.math = ($, q) => {
|
|
|
2793
2791
|
|
|
2794
2792
|
$.dist = function () {
|
|
2795
2793
|
let a = arguments;
|
|
2794
|
+
if (a.length == 2) return Math.hypot(a[0].x - a[1].x, a[0].y - a[1].y);
|
|
2796
2795
|
if (a.length == 4) return Math.hypot(a[0] - a[2], a[1] - a[3]);
|
|
2797
|
-
|
|
2796
|
+
return Math.hypot(a[0] - a[3], a[1] - a[4], a[2] - a[5]);
|
|
2798
2797
|
};
|
|
2799
2798
|
|
|
2800
2799
|
$.lerp = (a, b, t) => a * (1 - t) + b * t;
|
|
@@ -3746,12 +3745,12 @@ Q5.renderers.webgpu.canvas = ($, q) => {
|
|
|
3746
3745
|
|
|
3747
3746
|
const MAX_TRANSFORMS = 1e7, // or whatever maximum you need
|
|
3748
3747
|
MATRIX_SIZE = 16, // 4x4 matrix
|
|
3749
|
-
transforms = new Float32Array(MAX_TRANSFORMS * MATRIX_SIZE)
|
|
3748
|
+
transforms = new Float32Array(MAX_TRANSFORMS * MATRIX_SIZE);
|
|
3749
|
+
|
|
3750
|
+
let matrix,
|
|
3750
3751
|
matrices = [],
|
|
3751
3752
|
matricesIndexStack = [];
|
|
3752
3753
|
|
|
3753
|
-
let matrix;
|
|
3754
|
-
|
|
3755
3754
|
// tracks if the matrix has been modified
|
|
3756
3755
|
$._matrixDirty = false;
|
|
3757
3756
|
|
|
@@ -3813,6 +3812,8 @@ Q5.renderers.webgpu.canvas = ($, q) => {
|
|
|
3813
3812
|
$.scale = (x = 1, y, z = 1) => {
|
|
3814
3813
|
y ??= x;
|
|
3815
3814
|
|
|
3815
|
+
$._scale = Math.max(Math.abs(x), Math.abs(y));
|
|
3816
|
+
|
|
3816
3817
|
let m = matrix;
|
|
3817
3818
|
|
|
3818
3819
|
m[0] *= x;
|
|
@@ -4046,7 +4047,7 @@ Q5.renderers.webgpu.canvas = ($, q) => {
|
|
|
4046
4047
|
new Float32Array(colorsBuffer.getMappedRange()).set(colorStack.slice(0, colorStackIndex));
|
|
4047
4048
|
colorsBuffer.unmap();
|
|
4048
4049
|
|
|
4049
|
-
mainBindGroup = Q5.device.createBindGroup({
|
|
4050
|
+
let mainBindGroup = Q5.device.createBindGroup({
|
|
4050
4051
|
layout: mainLayout,
|
|
4051
4052
|
entries: [
|
|
4052
4053
|
{ binding: 0, resource: { buffer: uniformBuffer } },
|
|
@@ -4095,8 +4096,6 @@ Q5.renderers.webgpu.canvas = ($, q) => {
|
|
|
4095
4096
|
i++;
|
|
4096
4097
|
}
|
|
4097
4098
|
}
|
|
4098
|
-
|
|
4099
|
-
for (let m of $._hooks.postRender) m();
|
|
4100
4099
|
};
|
|
4101
4100
|
|
|
4102
4101
|
$._finishRender = () => {
|
|
@@ -4107,19 +4106,19 @@ Q5.renderers.webgpu.canvas = ($, q) => {
|
|
|
4107
4106
|
q.pass = $.encoder = null;
|
|
4108
4107
|
|
|
4109
4108
|
// clear the stacks for the next frame
|
|
4110
|
-
$.drawStack
|
|
4109
|
+
$.drawStack = drawStack = [];
|
|
4111
4110
|
colorIndex = 1;
|
|
4112
4111
|
colorStackIndex = 8;
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4112
|
+
matrices = [matrices[0]];
|
|
4113
|
+
matricesIndexStack = [];
|
|
4114
|
+
|
|
4115
|
+
for (let m of $._hooks.postRender) m();
|
|
4117
4116
|
};
|
|
4118
4117
|
};
|
|
4119
4118
|
|
|
4120
4119
|
Q5.initWebGPU = async () => {
|
|
4121
4120
|
if (!navigator.gpu) {
|
|
4122
|
-
console.warn('q5 WebGPU not supported on this browser!');
|
|
4121
|
+
console.warn('q5 WebGPU not supported on this browser! Use Google Chrome or Edge.');
|
|
4123
4122
|
return false;
|
|
4124
4123
|
}
|
|
4125
4124
|
if (!Q5.device) {
|
|
@@ -4413,9 +4412,9 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4413
4412
|
$.ellipseMode = (x) => ($._ellipseMode = x);
|
|
4414
4413
|
|
|
4415
4414
|
$.ellipse = (x, y, w, h) => {
|
|
4416
|
-
let n = getArcSegments(Math.max(w, h));
|
|
4417
|
-
let a =
|
|
4418
|
-
let b = w == h ? a :
|
|
4415
|
+
let n = getArcSegments(Math.max(Math.abs(w), Math.abs(h)) * $._scale);
|
|
4416
|
+
let a = w / 2;
|
|
4417
|
+
let b = w == h ? a : h / 2;
|
|
4419
4418
|
|
|
4420
4419
|
if ($._matrixDirty) $._saveMatrix();
|
|
4421
4420
|
let ti = $._matrixIndex;
|
|
@@ -4448,8 +4447,10 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4448
4447
|
}
|
|
4449
4448
|
};
|
|
4450
4449
|
|
|
4451
|
-
$.
|
|
4452
|
-
|
|
4450
|
+
$._strokeJoin = 'round';
|
|
4451
|
+
|
|
4452
|
+
$.strokeJoin = (x) => {
|
|
4453
|
+
$._strokeJoin = x;
|
|
4453
4454
|
};
|
|
4454
4455
|
|
|
4455
4456
|
$.line = (x1, y1, x2, y2) => {
|
|
@@ -4470,7 +4471,7 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4470
4471
|
|
|
4471
4472
|
addRect(x1 + px, -y1 - py, x1 - px, -y1 + py, x2 - px, -y2 + py, x2 + px, -y2 - py, ci, ti);
|
|
4472
4473
|
|
|
4473
|
-
if (sw > 2) {
|
|
4474
|
+
if (sw > 2 && $._strokeJoin != 'none') {
|
|
4474
4475
|
let n = getArcSegments(sw);
|
|
4475
4476
|
addEllipse(x1, y1, hsw, hsw, n, ci, ti);
|
|
4476
4477
|
addEllipse(x2, y2, hsw, hsw, n, ci, ti);
|
|
@@ -4561,17 +4562,26 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4561
4562
|
}
|
|
4562
4563
|
|
|
4563
4564
|
if ($._doFill) {
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4565
|
+
if (shapeVertCount == 5) {
|
|
4566
|
+
// for quads, draw two triangles
|
|
4567
|
+
addVert(sv[0], sv[1], sv[2], sv[3]); // v0
|
|
4568
|
+
addVert(sv[4], sv[5], sv[6], sv[7]); // v1
|
|
4569
|
+
addVert(sv[12], sv[13], sv[14], sv[15]); // v3
|
|
4570
|
+
addVert(sv[8], sv[9], sv[10], sv[11]); // v2
|
|
4571
|
+
drawStack.push(0, 4);
|
|
4572
|
+
} else {
|
|
4573
|
+
// triangulate the shape
|
|
4574
|
+
for (let i = 1; i < shapeVertCount - 1; i++) {
|
|
4575
|
+
let v0 = 0;
|
|
4576
|
+
let v1 = i * 4;
|
|
4577
|
+
let v2 = (i + 1) * 4;
|
|
4578
|
+
|
|
4579
|
+
addVert(sv[v0], sv[v0 + 1], sv[v0 + 2], sv[v0 + 3]);
|
|
4580
|
+
addVert(sv[v1], sv[v1 + 1], sv[v1 + 2], sv[v1 + 3]);
|
|
4581
|
+
addVert(sv[v2], sv[v2 + 1], sv[v2 + 2], sv[v2 + 3]);
|
|
4582
|
+
}
|
|
4583
|
+
drawStack.push(0, (shapeVertCount - 2) * 3);
|
|
4573
4584
|
}
|
|
4574
|
-
drawStack.push(0, (shapeVertCount - 2) * 3);
|
|
4575
4585
|
}
|
|
4576
4586
|
|
|
4577
4587
|
if ($._doStroke) {
|
|
@@ -4612,7 +4622,7 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4612
4622
|
};
|
|
4613
4623
|
|
|
4614
4624
|
$.background = (r, g, b, a) => {
|
|
4615
|
-
$.
|
|
4625
|
+
$.pushMatrix();
|
|
4616
4626
|
$.resetMatrix();
|
|
4617
4627
|
$._doStroke = false;
|
|
4618
4628
|
if (r.src) {
|
|
@@ -4627,7 +4637,7 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4627
4637
|
$.rect(-c.hw, -c.hh, c.w, c.h);
|
|
4628
4638
|
$._rectMode = og;
|
|
4629
4639
|
}
|
|
4630
|
-
$.
|
|
4640
|
+
$.popMatrix();
|
|
4631
4641
|
if (!$._fillSet) $._fill = 1;
|
|
4632
4642
|
};
|
|
4633
4643
|
|
|
@@ -4647,6 +4657,7 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
|
|
|
4647
4657
|
});
|
|
4648
4658
|
|
|
4649
4659
|
$._hooks.postRender.push(() => {
|
|
4660
|
+
drawStack = $.drawStack;
|
|
4650
4661
|
vertIndex = 0;
|
|
4651
4662
|
});
|
|
4652
4663
|
};
|
|
@@ -5293,11 +5304,19 @@ fn fragmentMain(f : FragmentParams) -> @location(0) vec4f {
|
|
|
5293
5304
|
|
|
5294
5305
|
$.text = (str, x, y, w, h) => {
|
|
5295
5306
|
if (!$._font) {
|
|
5296
|
-
// check if
|
|
5297
|
-
|
|
5298
|
-
if (navigator.onLine && !initLoadDefaultFont) {
|
|
5307
|
+
// check if loading the default font hasn't been attempted
|
|
5308
|
+
if (!initLoadDefaultFont) {
|
|
5299
5309
|
initLoadDefaultFont = true;
|
|
5300
|
-
|
|
5310
|
+
|
|
5311
|
+
if (navigator.onLine) {
|
|
5312
|
+
$.loadFont('https://q5js.org/defaultFont-msdf.json');
|
|
5313
|
+
} else {
|
|
5314
|
+
$.loadFont('/node_modules/q5/defaultFont-msdf.json');
|
|
5315
|
+
}
|
|
5316
|
+
// else if (Q5._esm && import.meta.url) {
|
|
5317
|
+
// let path = new URL('defaultFont-msdf.json', import.meta.url);
|
|
5318
|
+
// $.loadFont(path.href);
|
|
5319
|
+
// }
|
|
5301
5320
|
}
|
|
5302
5321
|
return;
|
|
5303
5322
|
}
|
|
@@ -5497,7 +5516,7 @@ fn fragmentMain(f : FragmentParams) -> @location(0) vec4f {
|
|
|
5497
5516
|
});
|
|
5498
5517
|
|
|
5499
5518
|
$._hooks.postRender.push(() => {
|
|
5500
|
-
charStack
|
|
5501
|
-
textStack
|
|
5519
|
+
charStack = [];
|
|
5520
|
+
textStack = [];
|
|
5502
5521
|
});
|
|
5503
5522
|
};
|