Refactor font face

The context is:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51070

This is partly based on kipod's suggestion to refactor injectCSS.