[mcclim-devel] Yet another half-baked half-finished backend

David Lichteblau david at lichteblau.com
Mon Jul 9 09:49:56 UTC 2007


Quoting Christophe Rhodes (csr21 at cantab.net):
> I should warn that I'm one Web Coder short of a project; I don't
> really have a feeling for how to take this backend much further:
> specifically, missing features that are moderately essential are text
> (<canvas> doesn't support text; apparently styled <div>s are the way
> forward) -- which would get the backend about up to Postscript levels
> of functionality -- and interactivity, which would be utterly cool but
> clearly won't work currently given that that html file is about 1MB
> big.  So, any ideas?

Hand-written JavaScript code could fetch a description of the shapes to
render using XMLHttpReqest, which has "XML" in its name, but can
actually also fetch arbitrary text/plain documents.  At least on Firefox
this approach also works for documents in the local file system, so a
web server is not necessary initially.

Interactive use is then just a matter of repeating these requests to
wait for more events from the server or to send keyboard events back
(but will obviously require a web server at that point).

(Since you mentioned lack of a web coder, see
http://www.lichteblau.com/blubba/responsetext/test.html for a trivial
XMLHttpRequest example that renders a text file from the same
directory.)

So the next step could be to define a textual format that describes the
shapes to render which is as compact as possible.

Made-up example for a syntax that might or might not be more compact:
  M42R0,0,100,100
could mean "medium operation", "the medium with ID 42", "draw a
rectangle", "here are the coordinates".

If that is still not compact enough, (ab)use the full range of Unicode
characters for a binary format.



More information about the mcclim-devel mailing list