Wiki.Novemberborn, sIFR 3 Documentation & FAQ

Ratio Calculation

The font size does not correspond directly to the height of the Flash movie. The relation between the font size, the number of lines and the height of the Flash movie is called the ratio. By defining ratios you'll stop the Flash movies from abruptly resizing, or at least you'll be able to lessen the impact.

The ratios are specific for each font, but luckily sIFR can calculate them for you. Make sure you've loaded sifr-debug.js into your X/HTML page -- after sifr.js and before sifr-config.js (the file-loading order is important). Then, assuming this is how you replace the elements:

sIFR.replace({ src: 'gothic.swf', selector: 'h1' });

Comment that out and do the following to get the ratios for gothic.swf (as of revision 229):

sIFR.debug.ratios({ src: 'gothic.swf', selector: 'h1' });

When the ratios have been calculated there'll be a prompt with the ratios. Copy the text so you can add it:

  sIFR.replace({ src: 'gothic.swf', selector: 'h1', ratios: […paste here…] });

Make sure not to have double brackets, like [[. And enjoy!

Note: Like sIFR itself, ratios will not be calculated if running from local, upload to a website and it'll be fine.


Updated on September 17, 2007 06:22 by Mark Wubben (130.89.219.101)

| See revision | Back in time (11 older revisions)


Navigation

sIFR 3 Documentation & FAQ

sIFR lets you use your favorite font on your websites by cleverly working with Flash, JavaScript and CSS. Here you'll find it's documentation and the FAQ. Leave a link to your implementation in the Examples!

Please donate

If you like sIFR, please consider making a donation so Mark can spend more time on it. Thank you.

Inside this wiki

Other destinations

Licensing

This wiki is licensed under the GNU Free Documentation License.

Miscellaneous

TextDrive

RubyOnRails