I am currently developing my own custom font to use for symbols and other graphics that I want to be vector based. The problem is how to create a font where the glyphs cover the full height of the given font-size.
If I have a block of 40px height and set the font-size and line-height to 40px I want the top-most part of the glyph to be at the block top and the bottom-most part to be at the bottom of the block. In other words, the glyph should vertically fully cover a block of the same height given the same font-size/line-height.
Well, the problem is, it doesn't... I have tried setting the baseline and descent to 0, and setting x-height, caps height and ascent to eg 1500. If I then draw all my glyphs between these vertical lines, they all show up the desired way. Except on a Mac! In Mac FF they are offset to the top by approximately 50%. In Safari and Chrome they don't show up at all, unless you set "display: inline-block" instead of "display: block".
I have also tried setting up a completely new font in Type 3.2, with default metrics etc. It seems to me that the descent line decides where the bottom-most tip of the glyph renders. The top on the other hand seems to be somewhere between the caps height and the ascent line, but more to the caps height. If I draw a glyph from descent to ascent the glyph top gets chopped off. If i draw a glyph from descent to caps height there is a space between block top and glyph top.
Are there any "standard" metrics that I could apply, and how should I position my glyphs to get it as described above?
A copy of the font in it's current state resides here:
https://s3-eu-west-1.amazonaws.com/public-karlis-rode/stack-overflow/Custom-Icon.ttf
EDIT:
A working example can be found here:
https://s3-eu-west-1.amazonaws.com/public-karlis-rode/stack-overflow/index.html
The left block contains an element of my custom font (case a). The next block contains an element from the font used in Twitter Bootstrap (case b). The last two blocks (case c and d) contain elements from a test font I have made that makes use of the default settings of Type 3.2. The first test element (c) has lowest point at the descent line and its top-most point at the caps height line. The last element (d) has its lowest point at the base line and its top-most point at the x-height line.
How it renders in all browsers on Ubuntu and Windows7 (in this case FF in Ubuntu):
This is the desired behaviour!
How it renders in FF on Mac:
How it renders in Safari on Mac:
Since both b, c and d render the same across all browsers and all operating systems, it really seems to me that my own custom font lacks and/or has some contradicting information in the metrics to make it render consistently.