I have an HTML page with some textual spans marked up something like this:
... p50 ...
You could try this JavaScript Vector Graphics Library - it's very clever stuff, hope it helps.
EDIT: As this link is dead, here is another link from Archive.org.