Skip to content

Commit

Permalink
upgrade to prawn-icon 3.1.x to add support for the Material Design Ic…
Browse files Browse the repository at this point in the history
…ons (mdi) as an available font-based icon set (PR #2334)

Co-authored-by: Perceval <perceval@trilogic.fr>
  • Loading branch information
maneex and Perceval committed Sep 7, 2022
1 parent 413c447 commit 631606e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Enhancements::
* allow optimizer to be specified using `:pdf_optimizer` API option (#1785)
* allow custom optimizer to be registered by extending `Asciidoctor::PDF::Optimizer::Base` and calling `register_for` method (#2330)
* allow custom optimizer to be selected using `pdf-optimizer` attribute (#2330)
* upgrade to prawn-icon 3.1.x to add support for the Material Design Icons (`mdi`) as an available font-based icon set (PR #2334)

Improvements::

Expand Down
2 changes: 1 addition & 1 deletion asciidoctor-pdf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
s.add_runtime_dependency 'prawn-svg', '~> 0.32.0'
s.add_runtime_dependency 'prawn-icon', '~> 3.0.0'
s.add_runtime_dependency 'prawn-icon', '~> 3.1.0'
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
s.add_runtime_dependency 'treetop', '~> 1.6.0'

Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/icons.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ You can use font-based icons from any of the following icon sets in your PDF doc
* *fab* - https://fontawesome.com/icons?d=gallery&s=brands[Font Awesome - Brands^]
* *far* - https://fontawesome.com/icons?d=gallery&s=regular[Font Awesome - Regular^]
* *fi* - http://zurb.com/playground/foundation-icon-fonts-3[Foundation Icons^]
* *mdi* - https://materialdesignicons.com[Material Design Icons^]

Use of the fa icon set is deprecated.
Please use one of the styled FontAwesome icon sets.
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor/pdf/ext/prawn/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Extensions
ColumnBox = ::Prawn::Document::ColumnBox

FontAwesomeIconSets = %w(fab far fas)
IconSets = %w(fab far fas fi).to_set
IconSets = %w(fab far fas fi mdi).to_set
IconSetPrefixes = IconSets.map {|it| it + '-' }
InitialPageContent = %(q\n)
(FontStyleToSet = {
Expand Down
1 change: 1 addition & 0 deletions spec/icon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
%W(far bell \uf0f3 FontAwesome5Free-Regular),
%W(fas lock \uf023 FontAwesome5Free-Solid),
%W(fi lock \uf16a fontcustom),
%W(mdi alien \uf089 MaterialDesignIcons),
].each do |icon_set, icon_name, char_code, font_name|
pdf = to_pdf <<~EOS, analyze: true
:icons: font
Expand Down

0 comments on commit 631606e

Please sign in to comment.