compute cap line as was done in SubSupText