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
<https://github.com/RazrFalcon/resvg/issues/140>. 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.
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to