зеркало из https://github.com/mozilla/gecko-dev.git
Position soft hyphens correctly in right-to-left text. Bug 444656, r+sr=roc
This commit is contained in:
Родитель
31d026a0fe
Коммит
b19c640964
|
@ -4308,11 +4308,14 @@ nsTextFrame::DrawText(gfxContext* aCtx, const gfxPoint& aTextBaselinePt,
|
|||
aDirtyRect, aProvider, &aAdvanceWidth);
|
||||
|
||||
if (aDrawSoftHyphen) {
|
||||
gfxFloat hyphenBaselineX = aTextBaselinePt.x + mTextRun->GetDirection() * aAdvanceWidth;
|
||||
// Don't use ctx as the context, because we need a reference context here,
|
||||
// ctx may be transformed.
|
||||
gfxTextRunCache::AutoTextRun hyphenTextRun(GetHyphenTextRun(mTextRun, nsnull, this));
|
||||
if (hyphenTextRun.get()) {
|
||||
// For right-to-left text runs, the soft-hyphen is positioned at the left
|
||||
// of the text, minus its own width
|
||||
gfxFloat hyphenBaselineX = aTextBaselinePt.x + mTextRun->GetDirection() * aAdvanceWidth -
|
||||
(mTextRun->IsRightToLeft() ? hyphenTextRun->GetAdvanceWidth(0, hyphenTextRun->GetLength(), nsnull) : 0);
|
||||
hyphenTextRun->Draw(aCtx, gfxPoint(hyphenBaselineX, aTextBaselinePt.y),
|
||||
0, hyphenTextRun->GetLength(), aDirtyRect, nsnull, nsnull);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test soft hyphen in rtl text</title>
|
||||
<style>
|
||||
p { width: 240px; font-size: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body dir="rtl">
|
||||
<p>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשת</p>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>Test soft hyphen in rtl text</title>
|
||||
<style>
|
||||
p { width: 240px; font-size: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body dir="rtl">
|
||||
<p>אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת­אבגדהוזחטיכלמנסעפצקרשת</p>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -8,3 +8,4 @@ random == soft-hyphens-1c.html soft-hyphens-1-ref.html # bug 406299
|
|||
== zwnj-01.html zwnj-01-ref.html
|
||||
== zwnj-02.html zwnj-02-ref.html
|
||||
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") != zwnj-01.html zwnj-02-ref.html # Bad fonts on the tinderbox -- works locally
|
||||
== 444656.html 444656-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче