scrolling: vertical [horizontal? usually unneccessary] word-wrapping scroll bar settings estimate all long lines that are not within view (do NOT correct the estimation later on while the scrollbar is in use, otherwise the scrollbar would be jumping). calculate the starts of all lines that are within view.