add Bidi support to isLeftToRight function

add Bidi support to isLeftToRight function