зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1273154 - Avoid breaking a font run at U+202F (NNBSP) if possible, because Mongolian shaping depends on the text run continuing across it. r=jrmuizel
This commit is contained in:
Родитель
790ccce521
Коммит
c985e0ecb5
|
@ -2637,10 +2637,12 @@ gfxFontGroup::FindFontForChar(uint32_t aCh, uint32_t aPrevCh, uint32_t aNextCh,
|
|||
Script aRunScript, gfxFont *aPrevMatchedFont,
|
||||
uint8_t *aMatchType)
|
||||
{
|
||||
// If the char is a cluster extender, we want to use the same font
|
||||
// as the preceding character if possible. This is preferable to using
|
||||
// If the char is a cluster extender or NNBSP, we want to use the same
|
||||
// font as the preceding character if possible. This is preferable to using
|
||||
// the font group because it avoids breaks in shaping within a cluster.
|
||||
if (aPrevMatchedFont && IsClusterExtender(aCh) &&
|
||||
const uint32_t NARROW_NO_BREAK_SPACE = 0x202f;
|
||||
if (aPrevMatchedFont &&
|
||||
(IsClusterExtender(aCh) || aCh == NARROW_NO_BREAK_SPACE) &&
|
||||
aPrevMatchedFont->HasCharacter(aCh)) {
|
||||
RefPtr<gfxFont> ret = aPrevMatchedFont;
|
||||
return ret.forget();
|
||||
|
|
Загрузка…
Ссылка в новой задаче