Javadoc
Returns the position in the document that represents the last character
in the token that will fit into endBeforeX-startX
pixels.
For example, if you're using a monospaced 8-pixel-per-character font,
have the token "while" and startX
is 0
and
endBeforeX
is 30
, this method will return the
document position of the "i" in "while", because the "i" ends at pixel
24
, while the "l" ends at 32
. If not even the
first character fits in endBeforeX-startX
, the first
character's position is still returned so calling methods don't go into
infinite loops.