MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / parse

Function parse

libraries/p5.js:3288–3645  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

3286 }
3287
3288 function parse(code) {
3289 var b1;
3290 var b2;
3291 var b3;
3292 var b4;
3293 var codeIndex;
3294 var subrCode;
3295 var jpx;
3296 var jpy;
3297 var c3x;
3298 var c3y;
3299 var c4x;
3300 var c4y;
3301
3302 var i = 0;
3303 while (i < code.length) {
3304 var v = code[i];
3305 i += 1;
3306 switch (v) {
3307 case 1: // hstem
3308 parseStems();
3309 break;
3310 case 3: // vstem
3311 parseStems();
3312 break;
3313 case 4: // vmoveto
3314 if (stack.length > 1 && !haveWidth) {
3315 width = stack.shift() + font.nominalWidthX;
3316 haveWidth = true;
3317 }
3318
3319 y += stack.pop();
3320 newContour(x, y);
3321 break;
3322 case 5: // rlineto
3323 while (stack.length > 0) {
3324 x += stack.shift();
3325 y += stack.shift();
3326 p.lineTo(x, y);
3327 }
3328
3329 break;
3330 case 6: // hlineto
3331 while (stack.length > 0) {
3332 x += stack.shift();
3333 p.lineTo(x, y);
3334 if (stack.length === 0) {
3335 break;
3336 }
3337
3338 y += stack.shift();
3339 p.lineTo(x, y);
3340 }
3341
3342 break;
3343 case 7: // vlineto
3344 while (stack.length > 0) {
3345 y += stack.shift();

Callers 1

parseCFFCharstringFunction · 0.85

Calls 2

parseStemsFunction · 0.85
newContourFunction · 0.85

Tested by

no test coverage detected