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

Icon fonts missing from PDF #97

Closed
aalmiray opened this issue Mar 3, 2015 · 14 comments
Closed

Icon fonts missing from PDF #97

aalmiray opened this issue Mar 3, 2015 · 14 comments
Assignees

Comments

@aalmiray
Copy link
Member

aalmiray commented Mar 3, 2015

If :icons: font is applied to the document then icons go missing in the final PDF. Asciidoctor outputs the following warning

asciidoctor: WARNING: conversion missing in backend pdf for inline_image

gradle 2.3
asciidoctor 1.5.2
asciidoctorj-pdf 1.5.0-alpha.6

@DavidGamba
Copy link
Contributor

Take a look at: #9

@madmas
Copy link

madmas commented Mar 26, 2015

I think it's also related to #15 and could maybe be solved with PR #90 .

@mojavelinux
Copy link
Member

Indeed. This seems like good Hackergarten material to me :)

@mojavelinux mojavelinux added this to the v1.5.0 milestone Mar 30, 2015
@mojavelinux
Copy link
Member

@madmas this is only partially solved by #90. We still need to parse the inline image. Once we do that, then we can delegate to the icon method to draw the font-based icon. I'd say this is really a duplicate of #9.

@mojavelinux mojavelinux self-assigned this May 17, 2015
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 5, 2015
- add support for inline icon macro
- allow font set to be changed globally (icon-set=<icon-set> attribute)
- allow font set to be changed per icon (set=<icon-set> attribute or append @<icon-set> to target)
mojavelinux added a commit that referenced this issue Jun 5, 2015
resolves #97 add support for inline icon macro
@mojavelinux
Copy link
Member

I just got inline icon macros working. What's more, you can use one of 4 icon sets.

  • fa - Font Awesome
  • octicon - Octicons
  • fi - Foundation icons
  • pf - Payment font

Here's a full example:

Available now at icon:amazon@pf[].

That reads "the amazon icon in the pf (payment font) icon set". You can also write it as:

Available now at icon:amazon[set=pf].

You can also set the icon set globally.

= Icons
:icons: font
:icon-set: octicon

icon:alert[] Don't miss this!

In addition to the sizes supported in the HTML backend (lg, 1x, 2x, etc), you can enter any relative value in the size attribute (e.g., 1.5em, 150%, etc).

icon:android[size=40em]

We don't yet support any way to color the icon.

@anandchida
Copy link
Contributor

I'm on Fedora 22 x86_64 with

asciidoctor -v
Asciidoctor 1.5.2 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

asciidoctor-pdf -v
Asciidoctor PDF 1.5.0.alpha.9 using Asciidoctor 1.5.2 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

I do not see the Font Awesome icons in the PDF but I do see them in HTML.

I've declared :icon-set: fa and use font like this icon:android[size=2x] this works in HTML but in PDF I see text [android]

I generate PDF using
asciidoctor-pdf asciidoctor-example.adoc

I also see admonition text and not icons in PDF while in HTML I see icons as expected

I'm sure I'm missing something here and any help is appreciated! Thank you for working on such an awesome project! This has made documentation so easy :)

@mojavelinux
Copy link
Member

Can you try?

asciidoctor-pdf -a icons=font asciidoctor-example.adoc

anandchida added a commit to anandchida/asciidoctor-pdf that referenced this issue Oct 14, 2015
Most of the icon enabling instructions is copied from issue asciidoctor#97. Also moved the important tip about sourcecode highlighting within the coderay section
@anandchida
Copy link
Contributor

This worked like a charm for both icons and admonition icons. Thank you!

I've sent in a pull request to improve some documentation around this.

Could we use multiple icon sets in a single document?

@mojavelinux
Copy link
Member

👍

@jfthuong
Copy link

I just got inline icon macros working. What's more, you can use one of 4 icon sets.

  • fa - Font Awesome
  • octicon - Octicons
  • fi - Foundation icons
  • pf - Payment font

Here's a full example:

Available now at icon:amazon@pf[].

@mojavelinux Does it also work on asciidoctor generating HTML?

I can't make it work (I tried with octicon, with/without :icon-set:).

Thanks

@mojavelinux
Copy link
Member

No, this is a feature specific to PDF.

There's some discussion about adding it for HTML in this PR: asciidoctor/asciidoctor#1801, but there are technical challenges yet unsolved.

@jfthuong
Copy link

I'm amazed by your quick answer.

I have been in this PR and that's when I tried the icon-set Feather.

Looking forward the integration... and by the way, a big 👍 for the great work on Ascidoctor: this really revolutionized my way of doing technical documentation and presentations (+ Reveal.js) since I have discovered it in January 2018.

@mojavelinux
Copy link
Member

Thanks!

@jfthuong
Copy link

jfthuong commented Jun 25, 2019

Could we use multiple icon sets in a single document?

To answer a super old question of @anandchida : yes, you can

For example:

:icons: font
...
icon:mortar-board[] icon:settings@octicon[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants