summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/bastyp/breakit.cxx13
-rw-r--r--sw/source/core/text/itrform2.cxx5
-rw-r--r--sw/source/core/text/makefile.mk3
-rw-r--r--sw/source/core/text/porlay.cxx25
-rw-r--r--sw/source/core/txtnode/fntcache.cxx1
5 files changed, 43 insertions, 4 deletions
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index f463c818c604..1dd1616df3b7 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -32,6 +32,7 @@
#include "precompiled_sw.hxx"
#include "breakit.hxx"
+#include <unicode/uchar.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
@@ -119,6 +120,18 @@ USHORT SwBreakIt::GetRealScriptOfText( const String& rTxt,
--nPos;
nScript = xBreak->getScriptType( rTxt, nPos );
sal_Int32 nChgPos = 0;
+ if ( i18n::ScriptType::WEAK == nScript && nPos + 1 < rTxt.Len() )
+ {
+ // A weak character followed by a mark may be meant to combine with
+ // the mark, so prefer the following character's script
+ switch ( u_charType(rTxt.GetChar(nPos + 1) ) ) {
+ case U_NON_SPACING_MARK:
+ case U_ENCLOSING_MARK:
+ case U_COMBINING_SPACING_MARK:
+ nScript = xBreak->getScriptType( rTxt, nPos+1 );
+ break;
+ }
+ }
if( i18n::ScriptType::WEAK == nScript && nPos &&
0 < (nChgPos = xBreak->beginOfScript( rTxt, nPos, nScript )) )
nScript = xBreak->getScriptType( rTxt, nChgPos-1 );
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 00440427eaf8..2f01085b89f9 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1973,6 +1973,7 @@ long SwTxtFormatter::CalcOptRepaint( xub_StrLen nOldLineEnd,
nReformat -= 2;
#ifndef QUARTZ
+#ifndef ENABLE_GRAPHITE
// --> FME 2004-09-27 #i28795#, #i34607#, #i38388#
// step back six(!) more characters for complex scripts
// this is required e.g., for Khmer (thank you, Javier!)
@@ -1981,6 +1982,10 @@ long SwTxtFormatter::CalcOptRepaint( xub_StrLen nOldLineEnd,
if( ::i18n::ScriptType::COMPLEX == rSI.ScriptType( nReformat ) )
nMaxContext = 6;
#else
+ // Some Graphite fonts need context for scripts not marked as complex
+ static const xub_StrLen nMaxContext = 10;
+#endif
+#else
// some fonts like Quartz's Zapfino need more context
// TODO: query FontInfo for maximum unicode context
static const xub_StrLen nMaxContext = 8;
diff --git a/sw/source/core/text/makefile.mk b/sw/source/core/text/makefile.mk
index 5cb00b95881e..fbc000002ee1 100644
--- a/sw/source/core/text/makefile.mk
+++ b/sw/source/core/text/makefile.mk
@@ -45,6 +45,9 @@ AUTOSEG=true
CDEFS+=-Dmydebug
.ENDIF
+.IF "$(ENABLE_GRAPHITE)" == "TRUE"
+CFLAGS+=-DENABLE_GRAPHITE
+.ENDIF
# --- Files --------------------------------------------------------
.IF "$(product)$(cap)" == ""
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 0a0a99087fc9..b4b739528cd7 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: porlay.cxx,v $
- * $Revision: 1.67.190.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -45,6 +42,7 @@
#include <porrst.hxx> // SwHangingPortion
#include <pormulti.hxx> // SwMultiPortion
#include <breakit.hxx>
+#include <unicode/uchar.h>
#include <com/sun/star/i18n/ScriptType.hdl>
#include <com/sun/star/i18n/CTLScriptType.hdl>
#include <com/sun/star/i18n/WordType.hdl>
@@ -1030,7 +1028,26 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
// <--
- aScriptChg.Insert( nChg, nCnt );
+ // special case for dotted circle since it can be used with complex
+ // before a mark, so we want it associated with the mark's script
+ if (nChg < rTxt.Len() && nChg > 0 && (i18n::ScriptType::WEAK ==
+ pBreakIt->xBreak->getScriptType(rTxt,nChg - 1)))
+ {
+ int8_t nType = u_charType(rTxt.GetChar(nChg) );
+ if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
+ nType == U_COMBINING_SPACING_MARK )
+ {
+ aScriptChg.Insert( nChg - 1, nCnt );
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
+ }
+ else
+ {
+ aScriptChg.Insert( nChg, nCnt );
+ }
aScriptType.Insert( nScript, nCnt++ );
// if current script is asian, we search for compressable characters
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 516741fe12b3..3f8c9914c10f 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -152,6 +152,7 @@ SwFntObj::SwFntObj( const SwSubFont &rFont, const void *pOwn, ViewShell *pSh ) :
|| UNDERLINE_NONE != aFont.GetOverline()
|| STRIKEOUT_NONE != aFont.GetStrikeout() )
&& !aFont.IsWordLineMode();
+ aFont.SetLanguage(rFont.GetLanguage());
}
SwFntObj::~SwFntObj()