Bug 1697666 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Thanks.

Tested the behavior with `gfx.e10s.font-list.shared == false`.

For bug 1687426 regression ("PingFang SC Regular" is used for monospace), the issue seems to be the following:

In the following code, `mFirstGeneric` is set to `StyleGenericFontFamily::Monospace`, and `pfl->GetDefaultGeneric(currentLang)` is `StyleGenericFontFamily::SansSerif` for `ja` lang.

https://searchfox.org/mozilla-central/rev/1a47a74bd5ba89f2474aa27c40bd478e853f3276/gfx/thebes/gfxTextRun.cpp#3687-3690
```
  for (i = 0; i < numLangs; i++) {
    eFontPrefLang currentLang = prefLangs[i];
    StyleGenericFontFamily generic =
        mFirstGeneric != StyleGenericFontFamily::None
            ? mFirstGeneric
            : pfl->GetDefaultGeneric(currentLang);
```

Before the patch, the code was the following:

```
  for (i = 0; i < numLangs; i++) {
    eFontPrefLang currentLang = prefLangs[i];
    StyleGenericFontFamily defaultGeneric = pfl->GetDefaultGeneric(currentLang);
```

So, before bug 1687426 patch, it was using sans-serif font,
and after bug 1687426 patch, it's using monospace,
and that is the reason why the different font is used between them.

I'm not sure why choosing `StyleGenericFontFamily::Monospace` results in "PingFang SC Regular" tho... (it's not monospace font I guess?)

Then, I'll investigate the first regression about "wrong font is used for monospace".
(if it's just because sans-serif is used for monospace, there might be yet another regression about monospace font lookup)
Thanks.

Tested the behavior with `gfx.e10s.font-list.shared == false`.

For bug 1687426 regression ("PingFang SC Regular" is used for monospace), the issue seems to be the following:

In the following code, `mFirstGeneric` is set to `StyleGenericFontFamily::Monospace`, and `pfl->GetDefaultGeneric(currentLang)` is `StyleGenericFontFamily::SansSerif` for `ja` lang.

https://searchfox.org/mozilla-central/rev/1a47a74bd5ba89f2474aa27c40bd478e853f3276/gfx/thebes/gfxTextRun.cpp#3687-3690
```
  for (i = 0; i < numLangs; i++) {
    eFontPrefLang currentLang = prefLangs[i];
    StyleGenericFontFamily generic =
        mFirstGeneric != StyleGenericFontFamily::None
            ? mFirstGeneric
            : pfl->GetDefaultGeneric(currentLang);
```

Before the patch, the code was the following:

```
  for (i = 0; i < numLangs; i++) {
    eFontPrefLang currentLang = prefLangs[i];
    StyleGenericFontFamily defaultGeneric = pfl->GetDefaultGeneric(currentLang);
```

So, before bug 1687426 patch, it was using sans-serif font,
and after bug 1687426 patch, it's using monospace,
and that is the reason why the different font is used between them.

I'm not sure why choosing `StyleGenericFontFamily::Monospace` results in "PingFang SC Regular" tho... (it's not monospace font I guess?)

Then, I'll investigate the first regression about "wrong font is used for monospace".
(if it's just because sans-serif is used for monospace, there might be yet another regression about monospace font lookup, in between first and second regression)

Back to Bug 1697666 Comment 14