Returns the range containing the character closest to the given X and Y coordinates