StyledText API that uses a start offset and a length will always end with "Range". For example, getSelectionRange will return the selection as a start offset and a length. You can mix non-range based and range based StyledText API, as demonstrated by the code below. The behavior is the same. However, for the sake of clarity you should decide which kind of API to use and then use it consistently.