freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] SVG Rendering Library


From: Moazin Khatri
Subject: Re: [ft-devel] SVG Rendering Library
Date: Fri, 14 Jun 2019 16:45:15 +0500

Also, the reason why I was asking to ignore the case when an SVG document has multiple glyphs with different IDs is, because in that case, things become slightly simpler. 

In case of `resvg', it automatically calculates the bounding box and renders it so that all the `inked' part is in picture. It already had a function `resvg_get_node_bbox' that could return the bounding box for a particular node (that has a particular ID). However, it wouldn't work if the root node has that `ID' (which can be the case with documents that only have one glyph). See my discussion with him. Ultimately, he added a function `resvg_get_image_bbox' that can get the bounding box for the whole document. 

In case of `librsvg', even the older version has functions `rsvg_handle_get_position_sub' and `rsvg_handle_get_dimensions_sub' which can be used to get the bounding box, thus ultimately allow us to do a `cairo translate' for getting an exact `inked-part-only' render as well as getting `bitmap_left' and `bitmap_top'. The newer version has got better functions but I haven't been able to build it and thus haven't tested so far. Most likely, the newer ones would work for the whole SVG document, not only some sub node as is the case right now. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]