Closed Bug 1418564 Opened 3 years ago Closed 3 years ago

fakebold support for bitmap fonts

Categories

(Core :: Graphics: WebRender, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- unaffected
firefox58 --- unaffected

People

(Reporter: tjtncks, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

(Whiteboard: [wr-reserve])

Attachments

(3 files)

Attached image fakebold.PNG
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20171117222953

Steps to reproduce:

using bold option on bitmap fonts that has no bold fonts in it.


Actual results:

while each letters a pixel wider, but not bolded.


Expected results:

it should use fakebold to make it somewhat look thicker
(Mostly overapping same latter a pixel right to do that, IIRC)
Whiteboard: [wr-mvp] [triage]
Whiteboard: [wr-mvp] [triage] → [wr-mvp] [triage][wr-reserve-candidate]
Whiteboard: [wr-mvp] [triage][wr-reserve-candidate] → [wr-reserve]
Please attach the html file you were using as a testcase to make it easier for us to debug this.
Flags: needinfo?(tjtncks)
Attached file example.zip
Any page that uses those fonts will cause this bug. 
while this is korean font that only included in korean version of windows, they have english letters so you can see it.
use buttommost area in naver.com (screenshot attached) to see it. 
I don't know any bitmap fonts in english, sorry.
Flags: needinfo?(tjtncks)
I can reproduce this. The issue is we're not correctly supply DWrite font simulation information to WebRender, nor can WebRender currently actually process this. This will require some refactoring of webrender_api and some extension of dwrote-rs to properly fix. I will handle this.
Assignee: nobody → lsalzman
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: P3 → P1
See Also: → 1394570
Blocks: 1330734
This works in coordination with WR PR https://github.com/servo/webrender/pull/2120 to supply FontInstanceFlags::SYNTHETIC_BOLD to the DWrite font backend which will finally request the proper DWrite font simulation to match what we are expecting the Gecko end.
Attachment #8932505 - Flags: review?(jmuizelaar)
(In reply to Lee Salzman [:lsalzman] from comment #4)
> Created attachment 8932505 [details] [diff] [review]
> pass FontInstanceFlags to WebRender
> 
> This works in coordination with WR PR
> https://github.com/servo/webrender/pull/2120 to supply
> FontInstanceFlags::SYNTHETIC_BOLD to the DWrite font backend which will
> finally request the proper DWrite font simulation to match what we are
> expecting the Gecko end.

Should note, some slight messiness here with FontInstanceFlags, as I wanted to consolidate the definition rather than having it littered about in Moz2d. I made it part of a type prelude in webrender_ffi.h, since the type must be available for use by FontInstanceOptions. We can't just mark webrender_bindings as expanded, because that will remove the #[cfg] annotations, which prevents us from properly generating #ifdefs. Further, cbindgen doesn't really handle the output yet. Pre-expansion, cbindgen just ignores the bitflags! construct entirely, which allows us at least to do a suitable manual translation of it. cbindgen issued filed here https://github.com/eqrion/cbindgen/issues/100
Attachment #8932505 - Flags: review?(jmuizelaar) → review+
WR PR 2120 got merged, so this patch is now required for the next WR update.
Blocks: 1421275
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.