Insert Kasida before final Heh not Hah

This code seems to follow the algorithm described in:
https://www.microsoft.com/middleeast/msdn/JustifyingText-CSS.aspx

But there seem to be a confusion due to the transliteration used there,
Haa can be the standard Arabic name for U+0647 ARABIC LETTER HEH or
U+062D ARABIC LETTER HAH. The code is using the later, but I’m pretty
sure it is the former given that the other character in this priority is
Teh Marbuta, which is a Heh-like character. Also before final Hah is a
bad place for kashida.

Change-Id: I9ad3fc432ac58f0e45c562a6b44ac5cbe751c3bf
This commit is contained in:
Khaled Hosny 2016-11-06 22:06:44 +02:00
parent ba28100d81
commit 4920ee168f

View File

@ -66,7 +66,7 @@ using namespace i18n::ScriptType;
#define isDalChar(c) IS_JOINING_GROUP((c), DAL)
#define isFehChar(c) IS_JOINING_GROUP((c), FEH)
#define isGafChar(c) IS_JOINING_GROUP((c), GAF)
#define isHahChar(c) IS_JOINING_GROUP((c), HAH)
#define isHehChar(c) IS_JOINING_GROUP((c), HEH)
#define isKafChar(c) IS_JOINING_GROUP((c), KAF)
#define isLamChar(c) IS_JOINING_GROUP((c), LAM)
#define isQafChar(c) IS_JOINING_GROUP((c), QAF)
@ -971,12 +971,12 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
}
// 3. Priority:
// before final form of Teh Marbuta, Hah, Dal
// before final form of Teh Marbuta, Heh, Dal
if ( nPriorityLevel >= 2 && nIdx > 0 )
{
if ( isTehMarbutaChar ( cCh ) || // Teh Marbuta (right joining)
isDalChar ( cCh ) || // Dal (right joining) final form may appear in the middle of word
( isHahChar ( cCh ) && nIdx == nWordLen - 1)) // Hah (dual joining) only at end of word
( isHehChar ( cCh ) && nIdx == nWordLen - 1)) // Heh (dual joining) only at end of word
{
SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );