Fixed legend in IE and Firefox.
Abstracted text rendering.