#98281# Bidi - New function that checks if language is Arabic

This commit is contained in:
Frank Meies 2002-06-20 08:44:17 +00:00
parent 30fbddfddb
commit 8c509efd1a
3 changed files with 39 additions and 42 deletions

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: drawfont.hxx,v $ * $RCSfile: drawfont.hxx,v $
* *
* $Revision: 1.22 $ * $Revision: 1.23 $
* *
* last change: $Author: fme $ $Date: 2002-06-19 07:45:53 $ * last change: $Author: fme $ $Date: 2002-06-20 09:43:30 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -226,6 +226,16 @@ public:
USHORT KashidaJustify( long* pKernArray ,long* pScrArray, USHORT KashidaJustify( long* pKernArray ,long* pScrArray,
xub_StrLen nIdx, xub_StrLen nLen, xub_StrLen nIdx, xub_StrLen nLen,
USHORT nSpace = 0 ) const; USHORT nSpace = 0 ) const;
/** Checks if language is one of the 16 Arabic languages
@descr Checks if language is one of the 16 Arabic languages
@param aLang
The language which has to be checked.
@return Returns if the language is an Arabic language
*/
static BOOL IsArabicLanguage( LanguageType aLang );
#endif #endif
/** Performes a thai justification on the kerning array /** Performes a thai justification on the kerning array

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: porlay.cxx,v $ * $RCSfile: porlay.cxx,v $
* *
* $Revision: 1.27 $ * $Revision: 1.28 $
* *
* last change: $Author: fme $ $Date: 2002-05-06 15:03:50 $ * last change: $Author: fme $ $Date: 2002-06-20 09:42:40 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -1360,6 +1360,23 @@ USHORT SwScriptInfo::KashidaJustify( long* pKernArray, long* pScrArray,
return 0; return 0;
} }
/*************************************************************************
* SwScriptInfo::IsArabicLanguage()
*************************************************************************/
sal_Bool SwScriptInfo::IsArabicLanguage( LanguageType aLang )
{
return LANGUAGE_ARABIC == aLang || LANGUAGE_ARABIC_SAUDI_ARABIA == aLang ||
LANGUAGE_ARABIC_IRAQ == aLang || LANGUAGE_ARABIC_EGYPT == aLang ||
LANGUAGE_ARABIC_LIBYA == aLang || LANGUAGE_ARABIC_ALGERIA == aLang ||
LANGUAGE_ARABIC_MOROCCO == aLang || LANGUAGE_ARABIC_TUNISIA == aLang ||
LANGUAGE_ARABIC_OMAN == aLang || LANGUAGE_ARABIC_YEMEN == aLang ||
LANGUAGE_ARABIC_SYRIA == aLang || LANGUAGE_ARABIC_JORDAN == aLang ||
LANGUAGE_ARABIC_LEBANON == aLang || LANGUAGE_ARABIC_KUWAIT == aLang ||
LANGUAGE_ARABIC_UAE == aLang || LANGUAGE_ARABIC_BAHRAIN == aLang ||
LANGUAGE_ARABIC_QATAR == aLang;
}
#endif #endif
/************************************************************************* /*************************************************************************

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: fntcache.cxx,v $ * $RCSfile: fntcache.cxx,v $
* *
* $Revision: 1.44 $ * $Revision: 1.45 $
* *
* last change: $Author: fme $ $Date: 2002-06-19 07:43:41 $ * last change: $Author: fme $ $Date: 2002-06-20 09:44:17 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -989,18 +989,8 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
// Kashida Justification // Kashida Justification
if ( SW_CTL == nActual && nSpaceAdd ) if ( SW_CTL == nActual && nSpaceAdd )
{ {
LanguageType aLang = rInf.GetFont()->GetLanguage( SW_CTL ); if ( SwScriptInfo::IsArabicLanguage( rInf.GetFont()->
GetLanguage( SW_CTL ) ) )
// Oh my god!!!
if ( LANGUAGE_ARABIC == aLang || LANGUAGE_ARABIC_SAUDI_ARABIA == aLang ||
LANGUAGE_ARABIC_IRAQ == aLang || LANGUAGE_ARABIC_EGYPT == aLang ||
LANGUAGE_ARABIC_LIBYA == aLang || LANGUAGE_ARABIC_ALGERIA == aLang ||
LANGUAGE_ARABIC_MOROCCO == aLang || LANGUAGE_ARABIC_TUNISIA == aLang ||
LANGUAGE_ARABIC_OMAN == aLang || LANGUAGE_ARABIC_YEMEN == aLang ||
LANGUAGE_ARABIC_SYRIA == aLang || LANGUAGE_ARABIC_JORDAN == aLang ||
LANGUAGE_ARABIC_LEBANON == aLang || LANGUAGE_ARABIC_KUWAIT == aLang ||
LANGUAGE_ARABIC_UAE == aLang || LANGUAGE_ARABIC_BAHRAIN == aLang ||
LANGUAGE_ARABIC_QATAR == aLang )
{ {
if ( pSI && pSI->CountKashida() ) if ( pSI && pSI->CountKashida() )
pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(), pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(),
@ -1204,18 +1194,8 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
// Kashida Justification // Kashida Justification
if ( SW_CTL == nActual && nSpaceAdd ) if ( SW_CTL == nActual && nSpaceAdd )
{ {
LanguageType aLang = rInf.GetFont()->GetLanguage( SW_CTL ); if ( SwScriptInfo::IsArabicLanguage( rInf.GetFont()->
GetLanguage( SW_CTL ) ) )
// Oh my god!!!
if ( LANGUAGE_ARABIC == aLang || LANGUAGE_ARABIC_SAUDI_ARABIA == aLang ||
LANGUAGE_ARABIC_IRAQ == aLang || LANGUAGE_ARABIC_EGYPT == aLang ||
LANGUAGE_ARABIC_LIBYA == aLang || LANGUAGE_ARABIC_ALGERIA == aLang ||
LANGUAGE_ARABIC_MOROCCO == aLang || LANGUAGE_ARABIC_TUNISIA == aLang ||
LANGUAGE_ARABIC_OMAN == aLang || LANGUAGE_ARABIC_YEMEN == aLang ||
LANGUAGE_ARABIC_SYRIA == aLang || LANGUAGE_ARABIC_JORDAN == aLang ||
LANGUAGE_ARABIC_LEBANON == aLang || LANGUAGE_ARABIC_KUWAIT == aLang ||
LANGUAGE_ARABIC_UAE == aLang || LANGUAGE_ARABIC_BAHRAIN == aLang ||
LANGUAGE_ARABIC_QATAR == aLang )
{ {
if ( pSI && pSI->CountKashida() ) if ( pSI && pSI->CountKashida() )
pSI->KashidaJustify( pKernArray, pScrArray, rInf.GetIdx(), pSI->KashidaJustify( pKernArray, pScrArray, rInf.GetIdx(),
@ -1880,18 +1860,8 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
// Kashida Justification // Kashida Justification
if ( SW_CTL == nActual && rInf.GetSpace() ) if ( SW_CTL == nActual && rInf.GetSpace() )
{ {
LanguageType aLang = rInf.GetFont()->GetLanguage( SW_CTL ); if ( SwScriptInfo::IsArabicLanguage( rInf.GetFont()->
GetLanguage( SW_CTL ) ) )
// Oh my god!!!
if ( LANGUAGE_ARABIC == aLang || LANGUAGE_ARABIC_SAUDI_ARABIA == aLang ||
LANGUAGE_ARABIC_IRAQ == aLang || LANGUAGE_ARABIC_EGYPT == aLang ||
LANGUAGE_ARABIC_LIBYA == aLang || LANGUAGE_ARABIC_ALGERIA == aLang ||
LANGUAGE_ARABIC_MOROCCO == aLang || LANGUAGE_ARABIC_TUNISIA == aLang ||
LANGUAGE_ARABIC_OMAN == aLang || LANGUAGE_ARABIC_YEMEN == aLang ||
LANGUAGE_ARABIC_SYRIA == aLang || LANGUAGE_ARABIC_JORDAN == aLang ||
LANGUAGE_ARABIC_LEBANON == aLang || LANGUAGE_ARABIC_KUWAIT == aLang ||
LANGUAGE_ARABIC_UAE == aLang || LANGUAGE_ARABIC_BAHRAIN == aLang ||
LANGUAGE_ARABIC_QATAR == aLang )
{ {
if ( pSI && pSI->CountKashida() ) if ( pSI && pSI->CountKashida() )
pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(), rInf.GetLen(), pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(), rInf.GetLen(),