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

FontAwesome version is too new, big difference with html version #1157

Closed
rv0 opened this issue Jul 15, 2019 · 9 comments
Closed

FontAwesome version is too new, big difference with html version #1157

rv0 opened this issue Jul 15, 2019 · 9 comments
Assignees
Labels
Milestone

Comments

@rv0
Copy link

rv0 commented Jul 15, 2019

Asciidoctor currently only supports FontAwesome 4 icons ( asciidoctor/asciidoctor#3222 )
Asciidoctor-pdf currently uses prawn-icon 2.2.0 which is based arround Fontawesome 5

As a result there's icons that wont show in asciidoctor html, and will in the pdf. Or vice versa.
Example, the icon hdd-o (https://fontawesome.com/v4.7.0/icon/hdd-o) or hdd (https://fontawesome.com/icons/hdd)

Is it an option to downgrade to prawn-icon 1.4.0? Thats the version with 4.7 FontAwesome.

@mojavelinux
Copy link
Member

mojavelinux commented Jul 15, 2019 via email

@rv0
Copy link
Author

rv0 commented Jul 16, 2019

Seems reasonable yes.
To be honest I just created this issue because I was confused by this inconsistent behaviour and nobody created it before, at least people can now find it easily without having to dig deep.
I think it makes more sense to have asciidoctor update to FA5, but I understand that's also not a simple task.

What about the option to use older version of prawn-icon (prawn-icon 1.4.0)? I see the version hardcoded here: /~https://github.com/asciidoctor/asciidoctor-pdf/blob/master/asciidoctor-pdf.gemspec

Also, for anyone reading this looking for a quick fix, here's an example to work around this restriction with the hdd icon:

ifndef::backend-pdf[]
  icon:hdd-o[size=2x]
endif::[]
ifdef::backend-pdf[]
  icon:hdd[size=2x]
endif::[]

@mojavelinux mojavelinux added this to the support milestone Jul 16, 2019
@mojavelinux
Copy link
Member

I think it makes more sense to have asciidoctor update to FA5, but I understand that's also not a simple task.

Yep. This was a safe place to begin experimenting with FontAwesome 5 so that we could better understand what's coming. It was also necessary since prawn-icon made the switch and we depend on that library.

@mojavelinux
Copy link
Member

What about the option to use older version of prawn-icon (prawn-icon 1.4.0)?

It's a hard dependency on the API, so Asciidoctor PDF cannot easily float between different versions. We have to pick a version to depend on.

@mojavelinux
Copy link
Member

There's a slightly simpler solution. You can set the icon set to fa4 (either on the document or on the icon) and prawn-icon will remap the old names to the new ones (if the icon is still available).

However, in saying that it seems like there is a bug that is preventing this from working for fa4. I will add a portability test and fix the issue so that it will work.

Here's what we expect to work:

icon:hdd-o[size=2x,set=fa4]

or

:icon-set: fa4

icon:hdd-o[size=2x]

I thought that worked, but clearly it's not working right now :/

@rv0
Copy link
Author

rv0 commented Jul 16, 2019

yeah that's what I had initially tried too.
in any case, thanks for clearing a few things up!

@mojavelinux
Copy link
Member

mojavelinux commented Jul 16, 2019

Thanks for bringing this to my attention because I had no idea this was broken. As it turns out, we are completely missing tests for this remapping, which certainly explains it. 😱

@mojavelinux mojavelinux modified the milestones: support, v1.5.0.beta.2 Jul 16, 2019
@mojavelinux mojavelinux self-assigned this Jul 16, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jul 16, 2019
@mojavelinux
Copy link
Member

With the change proposed in #1160, you should not have to change your document. It will work just as if you are using Font Awesome 4...only the style of icons will obviously be different.

@mojavelinux
Copy link
Member

(TBH, I really don't understand why the style of the Font Awesome icons was changed...but that's just the way it is).

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

No branches or pull requests

2 participants