Tanja sail (Malay: layar tanja) or tanja rig is a type of sail commonly used by the Malay people and other Austronesians, particularly in Maritime Southeast Asia. It is also known as the tilted square sail, canted rectangular sail, or balance lug sail in English. In historical sources, tanja sail is sometimes incorrectly to referred as lateen sail or simply square sail.
Also called tanjaq, tanjak, tanja', tanjong, or tanjung sail. The Mandar people call it sombal tanjaq because when the wind blows the lower part of the sail (peloang) would "mattanjaq" (lit. "kick"). In colonial British records, it is sometimes written as "lyre tanjong", a misspelling of layar tanjong (layar means "sail" in Malay; layag in Philippine languages).
Early contact with Arab ships in the Indian Ocean during Austronesian voyages is believed to have resulted in the development of the triangular Arabic lateen sail. In turn, Arab ships are believed to have influenced the development of the Austronesian rectangular tanja sail. However, there are also historians who disagree with this. Johnstone, Shaffer, and Hourani considered this sail as a genuine invention of Nusantaran people, which in turn influenced the Arabs to develop their lateen sail.
The 3rd century book "Strange Things of the South" () by Wan Chen () describes large ships which originates from K'un-lun (Southern country, either Java or Sumatra). The ships called K'un-lun po (or K'un-lun bo). He explains the ship's sail design as follows:
The four sails do not face directly forward, but are set obliquely, and so arranged that they can all be fixed in the same direction, to receive the wind and to spill it. Those sails which are behind the most windward one receiving the pressure of the wind, throw it from one to the other, so that they all profit from its force. If it is violent, (the sailors) diminish or augment the surface of the sails according to the conditions. This oblique rig, which permits the sails to receive from one another the breath of the wind, obviates the anxiety attendant upon having high masts. Thus these ships sail without avoiding strong winds and dashing waves, by the aid of which they can make great speed.-- Wan Chen, 
The invention of this type of sail made sailing around western coast of Africa possible, because of its ability to sail against the wind. As noted by Hourani:
"The Malays were also the first to use balance-lug sail, an invention of global significance. Balance-lugs are square sails set fore and aft and tilted down at the end. They can be pivoted sideways, which makes it possible to sail into the oncoming wind at an angle to tack against the wind - to sail at an angle first one way and then the other, in a zigzag pattern, so as to go in the direction from which the wind is blowing. Because of the way the sides of the sail were tilted, from a distance it looked somewhat triangular.... It is thus quite likely that the Malay balance-lug was the inspiration for the triangular lateen sail, which was developed by sailors living on either side of the Malays, the Polynesians to their east and the Arabs to their west.
Precisely when the Polynesians and the Arabs began using the lateen sail remains unknown, but it would seem to have been in the last centuries B.C.E. It is known that the Arabs in the vicinity of the Indian Ocean were accomplished sailors by the first century C.E. and both they and the Polynesians apparently had the lateen sail by then"
Most Southeast Asian and Austronesian vessels used the tanja sail. This type of sail brought Malay sailors as far as Ghana in the 8th century, and there is probability these sailor reached the New World as early as 1420 A.D. using Javanese junks. These are vessels that use tanja sail: