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:
- icons.css
- fonts/icons.eot
- fonts/icons.svg
- fonts/icons.ttf
- fonts/icons.woff
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).
asciidoctor-pdf does not have the same flexibility as asciidoctor for icon fonts, see https://docs.asciidoctor.org/pdf-converter/latest/icons/#font
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.The fonts available are: