tags:

views:

55

answers:

2

I have a css definition in the head of my page as follows:

@font-face {
    font-family: "ownfont";src: url("../fonts/ownfont.ttf");
}

Then i give a css class to the body (on button click) which changes the font type from:

font-family: Verdana,Arial,Helvetica,sans-serif;

to

font-family: "ownfont",Verdana,Arial,Helvetica,sans-serif;

"ownfont" is a 4-character font where spaces and hypen will be shown in order to show some non-visual characters.

Firefox 3.6.3 shows everything as excepted (looks the same as before except for spaces and hypen), but Safari (on Mac and Win; Versions 4.0.5, 5.0) changes the heigth of my text lines (or at least it looks like that or as if a padding/margin has been increased - but nothing has been changed except for the font).

Why does this font setting yield to different results in firefox and safari?

Is there a way here to force both browsers to behave the same?

any help or suggestion is appreciated - thanks in advance

A: 

Try specifying line-height: 1ex; in your css.

J-16 SDiZ
this looks somewhat terrible
Thariama
A: 

If you know what font(s) you're going to be using it with, it might be simpler to remake your font to have metrics more like the others'.

reisio
good suggestion - i will give it a try
Thariama
metric is almost the same except for the width of the 4 characters (i change that in order to have the same width shown in the browser when switching css)
Thariama
this does not work, is there a way to change the metric heigth somehow?
Thariama
Yeah, there's the height above the baseline, the height below, the total em height. Could be relevant.
reisio
it is better somehow; well i still have a difference between a local page and one one a test system (Safari on Mac), but that will have to do with something else i still need to figure out
Thariama