
--
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/e4cfdec4-6b58-492a-8f59-1129a9b0e597o%40googlegroups.com.
So there is SkFont::setScaleX and ::setSkewX which do what you want to the x direction. Internally we actually have a 2x2 matrix for this but we don't seem to allow setting SkewY (ScaleY is essentially the size). One way to do this right now is probably to call SkFont::getPath or ::getPaths to get the paths, transform them (and their positions) using the 'text matrix', then draw them (or their outlines) to the canvas. Note that you'll need to take care of non-path based glyphs by drawing them 'normally' but these are usually color glyphs to which don't use the fill. However, this doesn't use the glyph cache as well and may run into other strange bits.
On Mon, Jun 29, 2020 at 5:38 AM Edwin Steiner <estei...@gmail.com> wrote:
Dear Skia community,--I'm using Skia to render PDF content and I ran into the following problem when stroking glyphs:PDF defines a "text rendering matrix" that can be used to stretch glyphs, for example, independently in the horizontal and vertical directions.The tricky thing is that this transformation matrix is supposed to be only used for defining the glyph path, not for stroking it, i.e. it should not affect the line width.When I use Skia's "drawTextBlob" with the text rendering matrix set up and a stroking paint, the transformation also applies to the stroke, which is not desired in this case.Can you advise me about the best way to use separate transformations for the glyph path construction and the subsequent painting?(I guess this is also relevant for filling/shading etc. if the fill depends on the coordinate space in any way. I found some special-case handling for shaders in the Skia code with regard to RSX forms for glyph drawing but I don't think it is sufficient for my case.)I attach a rendering example showing the expected result rendered by Adobe Reader on the left and my current rendering using Skia on the right.best regardsEdwin
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.