Closed Bug 1308316 Opened 5 years ago Closed 5 years ago

Skia does not respect font hinting settings

Categories

(Core :: Graphics: Text, defect, P3)

51 Branch
All
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- fixed
firefox52 --- fixed

People

(Reporter: heftig, Assigned: lsalzman)

Details

(Keywords: regression, Whiteboard: [gfx-noted])

Attachments

(1 file)

My system is configured not to hint text. The corresponding fontconfig snippet is:

  <match target="font">
    <edit name="hinting" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
  </match>

GTK is also configured to disable hinting:
"gsettings get org.gnome.settings-daemon.plugins.xsettings hinting" returns 'none'.

The default Skia content renderer does not respect this setting, instead always choosing full hinting. Returning to the old Cairo content renderer fixes this.
Priority: -- → P3
Whiteboard: [gfx-noted]
This was regressed by bug 1278957 when we enabled Skia content.
Assignee: nobody → lsalzman
Status: UNCONFIRMED → ASSIGNED
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Keywords: regression
In the case that the scaler context requested hinting, but fontconfig explicitly disabled it, we weren't properly disabling hinting.
Attachment #8803481 - Flags: review?(jmuizelaar)
I did set hintstyle=hintnone, so shouldn't the old code have disabled hinting already?
Ah, never mind, I think I get it. The old code didn't touch the context's hinting mode at all if hinting=false.
Attachment #8803481 - Flags: review?(jmuizelaar) → review+
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2321e1caa431
ensure Skia disables hinting if Fontconfig disables it. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/2321e1caa431
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment on attachment 8803481 [details] [diff] [review]
ensure Skia disables hinting if Fontconfig disables it

Approval Request Comment
[Feature/regressing bug #]: bug 1278957, so a regression was introduced starting with 51, which I would like to avoid introducing before 51 makes it to beta
[User impact if declined]: Linux users will not be able to disable font hinting for any/all fonts.
[Describe test coverage new/current, TreeHerder]: We don't currently have an explicit way to test different fontconfig settings within our testing framework, and this patch solely concerns fontconfig settings. However, the default fontconfig settings on Ubuntu disable hinting for some fonts at small sizes, so this gets some implicit testing from our existing reftests.
[Risks and why]: Low risk. This patch only affects Linux and will not otherwise impact other platforms. Even so, it just restores behavior to match what the previous Cairo font backend does, so is not introducing any new behavior.
[String/UUID change made/needed]: None
Attachment #8803481 - Flags: approval-mozilla-aurora?
Comment on attachment 8803481 [details] [diff] [review]
ensure Skia disables hinting if Fontconfig disables it

Fix a regression related to Skia. Take it in 51 aurora.
Attachment #8803481 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(In reply to Wes Kocher (:KWierso) from comment #10)
> I've been seeing frequent Wr failures like
> https://treeherder.mozilla.org/logviewer.html#?job_id=3952526&repo=mozilla-
> aurora since this got pushed to aurora:
> https://treeherder.mozilla.org/#/jobs?repo=mozilla-
> aurora&fromchange=4e2043b472d20feba39a349b220742f463983a67&bugfiler&noautocla
> ssify&filter-
> searchStr=85454b5eb1857d6f954b0f8216fb5cf259eab383&group_state=expanded&selec
> tedJob=3952526
> 
> 
> Backed out in
> https://hg.mozilla.org/releases/mozilla-aurora/rev/8da98b978cfc to see if
> that helps.

I would think this is a red herring. The assertion "Assertion failure: mFormat != gfx::SurfaceFormat::UNKNOWN (Could not find SurfaceFormat for visual!)" will gets triggered if when a window is resized or opened, it can't find one of our internal surface formats that match the X window's visual. My suspicion would be that it is some other patch.
Flags: needinfo?(lsalzman)
I kicked off some retriggers after the backout of my patch on aurora and it's still happening, so at least the evidence seems to support my innocence. :) My best guess would be bug 1278443 which got pushed to aurora at the same time as my patch.
Flags: needinfo?(wkocher)
You need to log in before you can comment on or make changes to this bug.