Skia doesn't scale fonts to the correct size




5 years ago
5 years ago


(Reporter: mark, Unassigned)


24 Branch
Windows 7

Firefox Tracking Flags

(Not tracked)



(3 attachments)



5 years ago
Created attachment 8358913 [details]

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20131205180928

Steps to reproduce:

1. Disable Direct2D (I did this as a workaround for Bug 958931 )
2. Render text in different font sizes (percentage) and check rendered sizes against what they should be.

Actual results:

See attached file. 120% and 125% are scaled to the exact same size; this is incorrect.

Expected results:

Font should have been scaled accurately to the proper size.

Comment 1

5 years ago
Created attachment 8360326 [details]

I have installed Firefox/24.2.0 on windows 7. But I can't reproduce it by the attached. The following is config setting to repro this: -> skia
gfx.direct2d.disabled -> true

Did I miss something?

Comment 2

5 years ago
Created attachment 8360380 [details]
Font size rendering example

it seems the base scale of fonts in your example is a little larger than what I found on the forum, but regardless:

It's not a matter of drawing on canvas, it's a matter of drawing content and disabling Direct2D (which switches the content back-end to skia). See attach.

Simply setting gfx.direct2d.enabled to false will do this.

With Direct2D disabled, scaling of the fonts (for me at least) puts 110+115, 118+120, 123+125+127, and 130+133 at the same size. With it enabled, scaling seems to be accurate (but displays the anomaly from the other bug I mentioned).

I don't know how skia scales the fonts - if it uses GDI fixed-point scaling for fonts then I guess this is "by design"?

Comment 3

5 years ago
I meant gfx.direct2d.disabled to true, of course. Sorry.

Comment 4

5 years ago
*facepalm* my bad, skia doesn't apply to content. I should pay more attention, I guess.
Last Resolved: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.