O'Reilly logo

Unicode Demystified by Richard Gillam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Line Breaking

If you're drawing more than a few words, the first thing you have to do when drawing text on the screen is to break it up into lines. Usually a text-rendering process will maintain a line starts array that lists the offset in the backing store of the first character of each line of rendered text. To draw a block of text, you must first build that line starts array.

Dividing a block of text up into lines generally proceeds in three conceptual phases:

1.
Locate all the positions in the text where a line break has to go. This step divides the text into a series of blocks. For the purposes of this discussion, we'll call these blocks “paragraphs,” although most word processing programs allow forced line breaks within a paragraph.
2. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required