Open Bug 1573135 Opened 5 years ago Updated 2 years ago

fontconfig font replacement with size condition doesn't work anymore

Categories

(Core :: Layout: Text and Fonts, defect, P3)

70 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lilydjwg, Unassigned)

References

(Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Use fontconfig to replace a font if the font size is small. The config is something like this:

<match target="pattern">
<test name="family">
<string>DejaVu Sans</string>
</test>
<test compare="less_eq" name="size">
<double>18</double>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
</edit>
</match>

Actual results:

The font being replaced is still used.

Expected results:

The font in use should be the one I "prepend".

Using the opposite condition (replacing "less_eq" with "more") also doesn't work: The replacement never takes place. It works if I remove the whole size condition.

I do this because one font used here in China (simsun) looks ugly in small sizes but OK in big sizes. I've tested with different fonts.

mozregression gives me the following:

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ea523d724c7137a326c0e8d3dc7513b36ef489a7&tochange=3cbbfc5127e473345c8b0f040a0ed1b254d800ed

It's a weird place so I tested twice. It still points to here.

I'm on Arch Linux with fontconfig 2:2.13.1+12+g5f5ec56-1 and pango 1:1.44.3-1.

The testing program pango-view (from pango) gives the expected result.

BTW, I noticed only recently so maybe the recent pango upgrade may be relevant, i.e. Firefox might always work with old versions of pango but not newer ones.

Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Hi,

It seems to technical for me, but what can I do for now is to set a component so developers can take a look over it. If this is not the correct component please feel free to change it to an appropriate one. Maybe someone more experienced can help.

Thanks for the report.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core
See Also: → 1243194

The mozregression range does seem odd. Jonathan, do you know why Pango font substitution might start failing like this?

Flags: needinfo?(jfkthame)
Priority: -- → P3

(In reply to Cameron McCormack (:heycam) from comment #3)

The mozregression range does seem odd. Jonathan, do you know why Pango font substitution might start failing like this?

s/Pango/fontconfig/, fwiw. But no, I don't know why that behavior would have changed. ni?Lee just in case he has any thoughts.

Flags: needinfo?(jfkthame) → needinfo?(lsalzman)

Nothing I can see that was really changed around that date on my end that would cause this.

Flags: needinfo?(lsalzman)

I can confirm this issue. I have a similar problem. If I modify a font (such as change it's weight based on certain fontconfig conditions), Firefox doesn't pick up on that change. I can test the results with other applications including Chromium and these work as expected, except for Firefox.

Has Regression Range: --- → yes
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.