Dear All,

I totally confess to getting myself tied in knots with a coding issue and am appealing for help in establishing if my approach is correct or if I have I am off track and missing some really simple solution.

I am not sure if I should be posting here or in the php forum but I have opted for this forum first.

I wish to create a float based layout to display some mysql data. In order to make this dynamic and flexible 'ex' units have been used to size elements with in the layout and this works fine.

The trouble comes when attempting to size various elements in 'ex' units relative to elements sized in 'px' units. As far as I can establish there is no php function which returns font metrics of a given font without invoking Imagick or PDFlib and Javascript is not appropriate as I want to effect the sizing as I construct the html/css in php.

So I have built a couple of tables of Aspect Ratios assuming a default dpi of 96 with which I can convert from 'ex' to 'px' and visa versa. This works but it feels clumsy and I can't help thinking that there should be a more elegant approach to this.

The tables assume:

font in pixels = font in pts / 72 * 92
font in ex = font in pixels * aspect ratio

I note also that whilst my tables hold true to provide an approximate conversion for W3C compliant browsers they do not hold true for IE. I am concluding that IE uses a different default dpi or in some other way renders 'ex' units differently. Obviously using an appropriate assumed dpi resolves the problem with in my function but I would still like to understand why 'ex' units behave differently in IE.

I feel sure that relating 'ex' to 'px' must be a common layout issue so I am hoping that someone has a view on this an can guide me appropriately.

Many Thanks.