开发者

Why sifr text's swf takes more width than actual text?

I think if we can match swf size with original text width's then rendering wi开发者_如何转开发ll be fast.


The font-replacement flash generated by sIFR takes the same space as the replaced HTML element. So if for example the text you are replacing is inside of an h1 tag, sIFR will take up the whole space of that h1 element and not the space of the text inside of it.

I guess the element that you are replacing has a width of 100%. You can set a border on it (style="border: solid 1px black;") so you can see the bounds of the element.


Getting SIFR to be rendered in the exact layout (except for the font) is always challenging.

You might get some hints/helps here:
SO - SIFR 3 text resizing to fit width
sIFR Width Problem
Font Sizing with sIFR


sIFR text might take up more space (or less!) because the font is different than the HTML font. You can influence the width of the HTML text using letter-spacing in a CSS rule prefixed with .sIFR-active.


If you are having difficulty with sIFR, you might try Cufon instead. It's very easy to integrate and gives very good results.

To be on the right side of the law, you have to make sure that the fonts you use allow web embedding. You can read more about it here -

  • Cufon home: http://cufon.shoqolate.com/
  • Cufon documentation: https://github.com/sorccu/cufon/wiki

You should also look into Typekit here. Typekit is an elegant, although not free, solution from Jeff Veen and Small Batch:

  • http://typekit.com/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜