R – How to replace a sifr font of an existing site without changing the font size in the css

sifr

I've been tasked with re-skining a site that uses sifr extensively. Unfortunately the new glyphs seem to render both taller and fatter than the old ones, necessitating changes to the font-size of every instance. The site is quite large with many different templates and one-off page layouts, so identifying and tuning each instance will be time consuming.

Besides cutting down on the obviously excessive use of sIFR, or getting a better font is there any other workaround? The only thing I can think of is calculating a new font-size in javascript before I make this replacement.

Best Answer

With sIFR 3, you could:

  • Use the .sIFR-active class to specify a different font size for the elements that will be replaced when sIFR is active
  • Hard-code a pixel font size in the css parameter to sIFR.replace()