1. A computer-implemented method of converting a source layout of a bi-directional text to a target layout of a bi-directional text, comprising using a processor of the computer for: detecting a shaping attribute of said text based on scanning said text to detect at least one character of a specific shape; detecting a text type attribute of said text from said shaping attribute; detecting an orientation attribute of said text from the detected text type attribute; detecting a swapping attribute of said text, using the detected text type attribute and the detected orientation attribute; and converting the source layout to the target layout, based on the detected attributes.
1. A computer-implemented method of converting a source layout of a bi-directional text to a target layout of a bi-directional text, comprising using a processor of the computer for: detecting a shaping attribute of said text based on scanning said text to detect at least one character of a specific shape; detecting a text type attribute of said text from said shaping attribute; detecting an orientation attribute of said text from the detected text type attribute; detecting a swapping attribute of said text, using the detected text type attribute and the detected orientation attribute; and converting the source layout to the target layout, based on the detected attributes. 10. The method of claim 1 , further comprising comparing, responsive to detecting that the text type attribute is logical, a number of Arabic script words in the text to a number of non-Arabic script words in the text, and: if the number of Arabic script words in the text is higher than the number of non-Arabic script words in the text, setting the orientation attribute to RTL; if the number of Arabic script words in the text is lower than the number of non-Arabic script words in the text, setting the orientation attribute to LTR; and if the number of Arabic script words in the text is equal to the number of non-Arabic script words in the text, setting the orientation attribute based on a bi-directionality of a first character in the text.