How to specify a font from javascript?
- by Steven Lu
I am trying to customize a view-src bookmarklet for iPad. This one is looking pretty good so far.
But I want to make it just a little more readable: The Courier (New) font is a bit ugly even (especially?) on the retina display and I'd prefer any one of DejaVu Sans Mono, Monaco, Lucida Console, Bitstream Vera Sans Mono.
I tried to modify the bookmarklet script by adding:
pre.style.fontFamily = '"DejaVu Sans Mono", "Lucida Console", Monaco;';
It's not doing the trick.
Perhaps prettyprint cancels out my fontFamily setting when it loads. Maybe I can set it at the end of the script somehow...