Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG admonition icons don't work #828

Closed
rockyallen opened this issue Jun 29, 2017 · 4 comments
Closed

SVG admonition icons don't work #828

rockyallen opened this issue Jun 29, 2017 · 4 comments
Assignees

Comments

@rockyallen
Copy link

rockyallen commented Jun 29, 2017

Using:

Asciidoctor PDF 1.5.0.alpha.15 using Asciidoctor 1.5.5 [http://asciidoctor.org]
Runtime Environment (ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]) (lc:IBM437 fs:Windows-1252 in:- ex:IBM437)

With:

:icontype: svg

I get:

asciidoctor: WARNING: could not embed admonition icon image: images/icons/warning.svg; image file is an unrecognised format

SVGs work fine as images, can they be allowed for icons as well?

@janosvitok
Copy link

This is most probably a problem of prawn-svg gem (https://github.com/mogest/prawn-svg) that doesn't provide class Prawn::Image::SVG. See also https://github.com/prawnpdf/prawn/blob/master/lib/prawn/image_handler.rb and for example https://github.com/prawnpdf/prawn/blob/master/lib/prawn/images/jpg.rb

@mojavelinux
Copy link
Member

mojavelinux commented Jul 27, 2017

Another way to put it is that we have to add dedicated support for SVG whereever an image is allowed. It's more than just the fact that the Prawn SVG doesn't hook into the image helper in Prawn. It's that we always have to do special processing for SVGs because they simple require it.

This was just not one of the places for using SVG that we had considered.

@mojavelinux mojavelinux self-assigned this Jul 27, 2017
@mojavelinux mojavelinux added this to the v1.5.0.alpha.17 milestone Jul 27, 2017
@kalvdans
Copy link

I was bitten by this issue as well.
@mojavelinux, can you expand on what special handling is required on the asciidoctor-pdf side? I would like to help.

@mojavelinux
Copy link
Member

A PR is now available for this request. Please see #953.

keith-packard added a commit to keith-packard/asciidoctor-pdf that referenced this issue Nov 2, 2018
This checks the 'icontype' and uses prawn-svg to render svg icons.

Signed-off-by: Keith Packard <keithp@keithp.com>
mojavelinux pushed a commit that referenced this issue Nov 2, 2018
* add support for SVG admonition icons
* resize icon SVG if it doesn't fit within available space

Uses prawn-svg to render SVG icons when the value of the icontype attribute is svg.

Signed-off-by: Keith Packard <keithp@keithp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants