Reputation: 33
I have managed to use a custom icon font replacing FontAwesome in AsciiDoc by doing the following.
I have placed my font files in my AsciiDoc root directory:
I have set the following properties in the AsciiDoc document:
:icons: font
:iconfont-remote!:
:iconfont-name: icons
The icon is rendered correctly in the HTML output and in the VS code plugin preview. When creating a pdf from the asciidoc, though, the icon doesn't appear. I use this command to generate the pdf:
bundle exec asciidoctor-pdf book.adoc -o out/book.pdf
And I receive this error (the icon is not renderered):
asciidoctor: WARNING: my-icon is not a valid icon name in the fa icon set
Does asciidoctor-pdf need to be pointed to the custom icon font in some way? I have tried looking for answers in the docs but couldn't find any (as a matter of fact, also making this work with HTML took some experimentation).
Upvotes: 0
Views: 1318
Reputation: 535
asciidoctor-pdf does not have the same flexibility as asciidoctor for icon fonts, see https://docs.asciidoctor.org/pdf-converter/latest/icons/#font
Icon-based fonts are handled by the prawn-icon gem.
If you want to use one of the available set you will need to set the :icons:
and :icon-set:
document attributes, at best from the command line so you do not have a conflict with HTML conversion.
asciidoctor-pdf -a icons=font -a icon-set=fas sample.adoc
The fonts available are:
Upvotes: 0