The docs say that calling CTTypesetterCreateLine is the same as calling CTTypesetterCreateLineWithOffset with offset set to 0.0, but the description of what offset means is rather lacking: “The line position offset.”
I’ve tried providing different values to it and it doesn’t seem to have any impact on the typographic bounds or image bounds of the resulting CTLineRef, nor does it seem to affect the result of drawing the line using CTLineDraw. Can anyone clue me in as to the purpose of this extra parameter?
The offset is a tab offset. It doesn’t apply to the line as a whole, but to the first tab-stop.
From http://lists.apple.com/archives/Coretext-dev/2011/Feb/msg00021.html
You create a string containing a tab like “A[tab]B” with Tab position at 200.
When you create a line with offset Zero and draw it at (x, y), it will appear like this.
When you create a line with offset 50 and draw it at (x + 50, y) (← you need to adjust X coordinate yourself), it will appear like this,
A B
(x+50,y) (x+200,y)
Note that “B” remains at the same position even though the line starts at a different position. If you were passing offset 0 and draw it at (x + 50, y), it would have been like the following.