Add something new to Virb:

Virb

Are you sure you want to delete that?

or Cancel

 

It would be a pretty cool hack to implement a PostScript/PDF interpreter in JavaScript wouldn't it? That is exactly what has been done with WPS.

The code takes PS and really groks it so:

JAVASCRIPT:
  1.  
  2. /n 10 def
  3. /w 25 def
  4.  
  5. 0 0 n w mul dup .gbox
  6.  
  7. 4 dict begin
  8.   0 1 n 1 sub {
  9.     /i exch def
  10.     /ii 1 1 n div i mul sub def
  11.     0 1 n 1 sub {
  12.       /j exch def
  13.       /jj 1 1 n div j mul sub def
  14.       ii jj 0 setrgbcolor
  15.       w j mul w i mul w w rectfill
  16.     } for
  17.   } for
  18. end
  19.  

becomes:

And all in ~400 lines of code! Check out the examples..... just awesome!

Loading comments...

Likes

Details

Viewed 89 times

© 2009 Depositado.

virb.com/t/4036832
tweet!

Flag this text post!

Flag this text post as:

or Cancel

 

Advertisement

Flag this profile!

Flag this profile as:

or Cancel