Do Arabic shaping earlier before measuring the text so that it gets laid out correctly. Bugs 117041, 138097. r=ftang, sr=waterson

This commit is contained in:
smontagu@netscape.com 2007-06-28 13:02:46 -07:00
Родитель f204991597
Коммит 249011d8fa
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -256,7 +256,7 @@ nsresult ArabicShaping(const PRUnichar* aString, PRUint32 aLen,
PRBool aInputLogical, PRBool aOutputLogical) PRBool aInputLogical, PRBool aOutputLogical)
{ {
nsAutoString tempString(aString); nsAutoString tempString(aString);
PRUnichar *tempBuf = (PRUnichar*)tempString.get(); PRUnichar *tempBuf = NS_CONST_CAST(PRUnichar*, tempString.get());
if (aInputLogical) { if (aInputLogical) {
ReverseString(tempBuf, aLen); ReverseString(tempBuf, aLen);
} }
@ -318,7 +318,8 @@ nsresult ArabicShaping(const PRUnichar* aString, PRUint32 aLen,
for(i=0;i<8;i++) { for(i=0;i<8;i++) {
if(key == gArabicLigatureMap[i]) { if(key == gArabicLigatureMap[i]) {
done = PR_TRUE; done = PR_TRUE;
*lDest++ = 0x200B;//ZERO WIDTH SPACE // lam and alef in the source are mapped to a lam-alef ligature in the
// destination, so lSrc is incremented by 2 here
*lDest++ = 0xFEF5 + i; *lDest++ = 0xFEF5 + i;
lSrc+=2; lSrc+=2;
break; break;