Dynamically calculate y offset based on line height