зеркало из https://github.com/mozilla/gecko-dev.git
Bug 534919: do not inherit font from ZWNJ to adjacent character. r=roc
This commit is contained in:
Родитель
3cdc12064a
Коммит
3108a65009
|
@ -542,10 +542,8 @@ public:
|
|||
PRUint32 aPlatformCode, PRUint32 aScriptCode,
|
||||
PRUint32 aLangCode, nsAString& dest);
|
||||
|
||||
static inline bool IsJoiner(PRUint32 ch) {
|
||||
return (ch == 0x200C ||
|
||||
ch == 0x200D ||
|
||||
ch == 0x2060);
|
||||
static inline bool IsJoinCauser(PRUint32 ch) {
|
||||
return (ch == 0x200D);
|
||||
}
|
||||
|
||||
static inline bool IsInvalid(PRUint32 ch) {
|
||||
|
|
|
@ -1564,9 +1564,9 @@ gfxFontGroup::FindFontForChar(PRUint32 aCh, PRUint32 aPrevCh, PRUint32 aNextCh,
|
|||
{
|
||||
nsRefPtr<gfxFont> selectedFont;
|
||||
|
||||
// if this character or the next one is a joiner use the
|
||||
// same font as the previous range if we can
|
||||
if (gfxFontUtils::IsJoiner(aCh) || gfxFontUtils::IsJoiner(aPrevCh) || gfxFontUtils::IsJoiner(aNextCh)) {
|
||||
// if this character or the previous one is a join-causer,
|
||||
// use the same font as the previous range if we can
|
||||
if (gfxFontUtils::IsJoinCauser(aCh) || gfxFontUtils::IsJoinCauser(aPrevCh)) {
|
||||
if (aPrevMatchedFont && aPrevMatchedFont->HasCharacter(aCh)) {
|
||||
selectedFont = aPrevMatchedFont;
|
||||
return selectedFont.forget();
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<html lang="ar">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: foo, sans-serif;
|
||||
font-size: 300%;
|
||||
line-height: 2em;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<p>گ ز</p>
|
||||
<p>گ ز</p>
|
||||
<p>گ ز</p>
|
||||
<p>گ ز</p>
|
||||
<p>گ ز</p>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<html lang="ar">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: foo, sans-serif;
|
||||
font-size: 300%;
|
||||
line-height: 2em;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<p>گ ز</p>
|
||||
<p>‌گ ز</p>
|
||||
<p>گ‌ ز</p>
|
||||
<p>گ ‌ز</p>
|
||||
<p>گ ز‌</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1353,3 +1353,4 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
|
|||
== 530686-1.html 530686-1-ref.html
|
||||
== 531098-1.html 531098-1-ref.html
|
||||
== 531371-1.html 531371-1-ref.html
|
||||
== 534919-1.html 534919-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче