stringPosToSquare and squareToStringPos