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

Icons do not work in buttons #956

Closed
eiskasten opened this issue Nov 12, 2018 · 2 comments
Closed

Icons do not work in buttons #956

eiskasten opened this issue Nov 12, 2018 · 2 comments
Assignees
Labels

Comments

@eiskasten
Copy link

When I try to render

:icons: font
:experimental

btn:[icon:pencil[\]]

Asciidoctor PDF throws:

	62: from /home/richi/.gem/ruby/2.5.0/bin/asciidoctor-pdf:23:in `<main>'
	61: from /home/richi/.gem/ruby/2.5.0/bin/asciidoctor-pdf:23:in `load'
	60: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/bin/asciidoctor-pdf:31:in `<top (required)>'
	59: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:112:in `invoke!'
	58: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:112:in `each'
	57: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/cli/invoker.rb:129:in `block in invoke!'
	56: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `convert_file'
	55: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `open'
	54: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595:in `block in convert_file'
	53: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1521:in `convert'
	52: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:1190:in `convert'
	51: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
	50: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:207:in `convert_document'
	49: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:134:in `convert_content_for_block'
	48: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:1261:in `content'
	47: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `content'
	46: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `map'
	45: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `block in content'
	44: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:75:in `convert'
	43: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
	42: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:426:in `convert_section'
	41: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:134:in `convert_content_for_block'
	40: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `content'
	39: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `map'
	38: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `block in content'
	37: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:75:in `convert'
	36: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
	35: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:426:in `convert_section'
	34: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:134:in `convert_content_for_block'
	33: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `content'
	32: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `map'
	31: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:84:in `block in content'
	30: from /usr/lib/ruby/gems/2.5.0/gems/asciidoctor-1.5.8/lib/asciidoctor/abstract_block.rb:75:in `convert'
	29: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:118:in `convert'
	28: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:513:in `convert_paragraph'
	27: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:2248:in `layout_prose'
	26: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/converter.rb:3040:in `typeset_text'
	25: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text.rb:166:in `text'
	24: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text.rb:217:in `formatted_text'
	23: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text.rb:380:in `fill_formatted_text_box'
	22: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/box.rb:212:in `render'
	21: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:215:in `save_font'
	20: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/box.rb:213:in `block in render'
	19: from /home/richi/.gem/ruby/2.5.0/gems/pdf-core-0.7.0/lib/pdf/core/text.rb:214:in `character_spacing'
	18: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/box.rb:214:in `block (2 levels) in render'
	17: from /home/richi/.gem/ruby/2.5.0/gems/prawn-templates-0.1.1/lib/prawn/text.rb:19:in `text_rendering_mode'
	16: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/box.rb:219:in `block (3 levels) in render'
	15: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn_ext/extensions.rb:253:in `font_size'
	14: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:101:in `font_size'
	13: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/box.rb:226:in `block (4 levels) in render'
	12: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb:17:in `wrap'
	11: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/wrap.rb:53:in `wrap'
	10: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/line_wrap.rb:47:in `wrap_line'
	 9: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/line_wrap.rb:77:in `apply_font_settings_and_add_fragment_to_line'
	 8: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/arranger.rb:166:in `apply_font_settings'
	 7: from /home/richi/.gem/ruby/2.5.0/gems/pdf-core-0.7.0/lib/pdf/core/text.rb:214:in `character_spacing'
	 6: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/text/formatted/arranger.rb:169:in `block in apply_font_settings'
	 5: from /home/richi/.gem/ruby/2.5.0/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn_ext/extensions.rb:196:in `font'
	 4: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:57:in `font'
	 3: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:253:in `find_font'
	 2: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:301:in `load'
	 1: from /home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font.rb:301:in `new'
/home/richi/.gem/ruby/2.5.0/gems/prawn-2.2.2/lib/prawn/font/afm.rb:53:in `initialize':  is not a known font. (Prawn::Errors::UnknownFont

but using the kbd macro:

:icons: font
:experimental

kbd:[icon:pencil[\]]

works fine and renders the appropriate icon. I do not have this issue with the HTML backend.

@mojavelinux
Copy link
Member

This happens any time an inline icon is wrapped in formatted text. For example:

*icon:pencil[]*

@mojavelinux
Copy link
Member

It turns out, the problem is that it's looking for the bold version of the icon font. The icon font only supports the normal style. Therefore, we need to get it to ignore the style. I think I've figured out where that needs to go.

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