docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion
authorAkira Yokosawa <akiyks@gmail.com>
Wed, 29 Dec 2021 11:46:58 +0000 (20:46 +0900)
committerJonathan Corbet <corbet@lwn.net>
Thu, 10 Feb 2022 00:00:41 +0000 (17:00 -0700)
commit8ccd05697a9d2f837f77a858e81ba13cdb50adac
tree50288d8641d5d446f279cdec168d960d486d9cd9
parentecf5fb58cdcd93b9cf555b95da4ef73b1297de4c
docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion

Using convert(1) of ImageMagick for SVG -> PDF conversion results in
PDFs containing raster (bitmap) images which sometimes look blurry.

Ideally speaking, SVG to PDF conversion should retain vector graphics
in SVG.

rsvg-convert(1) can do such conversions with regard to SVG files
generated by dot(1).

Unfortunately, rsvg-convert(1) does not cover some of SVG features
specific to Inkscape.
inkscape(1) of Inkscape naturally covers such SVG features.

So add a route in svg2pdf() so that inkscape(1) is used when it is
available.

Note:
    After this change, if you have Inkscape installed, ImageMagick nor
    librsvg are not required.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/3eea2a8d-c52d-ee07-cf7b-83784c6f6e4b@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx/kfigure.py