Hi,
From the version m74 onwards we started getting this issue of uneven spacing between characters:

We realized this is happening because of getting integer values for the widths of individual glyphs, through the method `SkFont.getWidthBounds()` even though we give skScalar array for the values.
For example, we get following widths for Roboto font for font-size 38:
22.000000, 10.000000, 9.000000, 13.000000, 22.000000, 20.000000, 13.000000, 20.000000, 20.000000,
and for the same characters, for font-size 19, we get--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/e4f52ba5-7c10-4b70-b1e0-c926e5016f6c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/CAB7Ak%3DA77CO-9uKb45%2B_k9YhND-aNgHiOeB7XQ%3D%3Dq5hFmrmTOA%40mail.gmail.com.
I imagine what is happening is that you used to set SkFont::setSubpixel(true) (to allow for subpixel placement of the glyphs) and this used to also force linear metrics. If you want to force linear metrics you can now use SkFont::setLinearMetrics(true). If you want even spacing and glyphs without hinting you probably want to set SkFont::setHinting(SkFontHinting::kNone). I believe the issue you are seeing here is that various early versions of Roboto are rather poorly hinted and just look like that when hinting is enabled (which is probably why you're getting integers for the advances). If you provide the exact version of Roboto you are using (which really means provide the file itself, since the version wasn't always updated well) I can take a look and make sure it's actually the font.
On Tue, Sep 24, 2019 at 9:13 AM Hal Canary <halc...@gmail.com> wrote:
What is SkFont::isSubpixel() set to?
On Tue, Sep 24, 2019, 2:54 AM Sonaali Mittal <sonaal...@gmail.com> wrote:
--Hi,
From the version m74 onwards we started getting this issue of uneven spacing between characters:
We realized this is happening because of getting integer values for the widths of individual glyphs, through the method `SkFont.getWidthBounds()` even though we give skScalar array for the values.
For example, we get following widths for Roboto font for font-size 38:
22.000000, 10.000000, 9.000000, 13.000000, 22.000000, 20.000000, 13.000000, 20.000000, 20.000000,
and for the same characters, for font-size 19, we get10.000000, 4.000000, 5.000000, 7.000000, 10.000000, 10.000000, 7.000000, 10.000000, 10.000000
Similarly for bounds as well.
Earlier (in m72), we used to get proper decimal values of the widths(without the rounding off), and the positioning of the glyphs was hence working fineOn trying to log those values in the skia code, it perhaps seemed to me that in the method `SkScalerContext_FreeType::generateMetrics()` the values of `fFace->glyph->advance.x` are being set in such a way that `SkFDot6ToFloat()` method always returns an integer value.
I want to ask you if this change in the width values and bounds' values- is the expected behavior? If so what is the workaround for proper spacing of the characters?
Thanks,
Sonaali
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/e4f52ba5-7c10-4b70-b1e0-c926e5016f6c%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-d...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c71ba8a6-4ca7-48bc-acc3-2135eeb0d50d%40googlegroups.com.