Open Bug 1548099 Opened 5 years ago Updated 2 years ago

Implement font_key_from_name in wrench for android

Categories

(Core :: Graphics: WebRender, task, P3)

Other Branch
task

Tracking

()

People

(Reporter: kats, Unassigned)

References

Details

It's not implemented on android: https://searchfox.org/mozilla-central/rev/f0ef51bfafc8ad0c3a2f523bf076edc57dc4891a/gfx/wr/wrench/src/wrench.rs#478

Some wrench reftests use this.

Lee, do you know if this is hard to implement?

Flags: needinfo?(lsalzman)
Type: defect → task

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #0)

It's not implemented on android: https://searchfox.org/mozilla-central/rev/f0ef51bfafc8ad0c3a2f523bf076edc57dc4891a/gfx/wr/wrench/src/wrench.rs#478

Some wrench reftests use this.

Lee, do you know if this is hard to implement?

As far as I know this is a bit ugly. In thebes we have to scan through all available font files in the system fonts directory, checking which family they are in one-by-one. In the stupid simplest way, we could literally just load each font in turn and check if it matches the criteria... Another idea might be to simply hard-code a lookup table from known families to standard font files, only for the ones we need for tests?

Then again, as far as I can see, we don't actually explicitly use it in reftests at all. All we do is use it for one mac-only test to load Apple Color Emoji, and then the only other case where it gets used is if for some reason a reftest does not specify a font, and then we always just load a default Arial font... Which we could hardcode for Android?

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

(In reply to Lee Salzman [:lsalzman] from comment #1)

then we always just load a default Arial font... Which we could hardcode for Android?

This is probably good enough for my purposes.

Flags: needinfo?(kats)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.