Corrections to measurement of justified Arabic text. Bug 187866, r=sfraser, sr=rbs@maths.uq.edu.au.

This commit is contained in:
smontagu%netscape.com 2003-01-09 21:15:52 +00:00
Родитель f703f5398e
Коммит 91b66de1fe
2 изменённых файлов: 44 добавлений и 26 удалений

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

@ -5426,25 +5426,34 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
mState &= ~TEXT_OPTIMIZE_RESIZE;
}
}
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(aPresContext, *aReflowState.rendContext, mStyleContext);
#ifdef IBMBIDI
if ( (mContentLength > 0) && (mState & NS_FRAME_IS_BIDI) ) {
startingOffset = mContentOffset;
}
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**)&charType, sizeof(charType));
PRBool isBidiSystem = (eCharType_RightToLeftArabic == charType) ?
(hints & NS_RENDERING_HINT_ARABIC_SHAPING) :
(hints & NS_RENDERING_HINT_BIDI_REORDERING);
aPresContext->SetIsBidiSystem(isBidiSystem);
if (ts.mSmallCaps || (0 != ts.mWordSpacing) || (0 != ts.mLetterSpacing)
|| ts.mJustifying) {
// simulate a non-Bidi system for char-by-char measuring and
// rendering
aPresContext->SetIsBidiSystem(PR_FALSE);
}
else {
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**)&charType, sizeof(charType));
PRBool isBidiSystem = (eCharType_RightToLeftArabic == charType) ?
(hints & NS_RENDERING_HINT_ARABIC_SHAPING) :
(hints & NS_RENDERING_HINT_BIDI_REORDERING);
aPresContext->SetIsBidiSystem(isBidiSystem);
}
}
#endif //IBMBIDI
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(aPresContext, *aReflowState.rendContext, mStyleContext);
// Clear out the reflow state flags in mState (without destroying
// the TEXT_BLINK_ON bit).

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

@ -5426,25 +5426,34 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
mState &= ~TEXT_OPTIMIZE_RESIZE;
}
}
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(aPresContext, *aReflowState.rendContext, mStyleContext);
#ifdef IBMBIDI
if ( (mContentLength > 0) && (mState & NS_FRAME_IS_BIDI) ) {
startingOffset = mContentOffset;
}
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**)&charType, sizeof(charType));
PRBool isBidiSystem = (eCharType_RightToLeftArabic == charType) ?
(hints & NS_RENDERING_HINT_ARABIC_SHAPING) :
(hints & NS_RENDERING_HINT_BIDI_REORDERING);
aPresContext->SetIsBidiSystem(isBidiSystem);
if (ts.mSmallCaps || (0 != ts.mWordSpacing) || (0 != ts.mLetterSpacing)
|| ts.mJustifying) {
// simulate a non-Bidi system for char-by-char measuring and
// rendering
aPresContext->SetIsBidiSystem(PR_FALSE);
}
else {
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**)&charType, sizeof(charType));
PRBool isBidiSystem = (eCharType_RightToLeftArabic == charType) ?
(hints & NS_RENDERING_HINT_ARABIC_SHAPING) :
(hints & NS_RENDERING_HINT_BIDI_REORDERING);
aPresContext->SetIsBidiSystem(isBidiSystem);
}
}
#endif //IBMBIDI
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(aPresContext, *aReflowState.rendContext, mStyleContext);
// Clear out the reflow state flags in mState (without destroying
// the TEXT_BLINK_ON bit).