I am designing italics to fit with a roman, and I am having trouble knowing where to place the glyphs so that the word space looks right either side of a bit of italics in line with roman.
Suppose I have a slanted rectangle glyph, as tall as the x height. If I set the sidebearings such that the baseline part of the glyph is central in the set width, then this glyph will look displaced to the right relative to upright glyphs, due to the rightward slant. So I offset the glyph to the left, such that the top sticks out to the right as much as the bottom sticks out to the left. I can then apply the same offset to all glyphs. The problem is, this simple formula does not work for all glyphs. For example, italic capitals can be modelled as a slanted rectangle as tall as the cap height, so these need more offset than the x height rectangle. Ascenders and descenders in the lower case have a similar effect, I think. Since the italics must be correctly spaced within themselves, the same offset must be applied to all italic glyphs, so a compromise of some kind is needed.
Is there some standard formula for working out the offset from the italic angle and the vertical proportions (x height, ascender, cap height, etc), or is there some recommended test to help adjust the offset by eye?