Fix text metrics computation