Skip to content

Commit

Permalink
Merge pull request #66 from jessedoyle/release-4.1.0
Browse files Browse the repository at this point in the history
chore: Release Version 4.1.0
  • Loading branch information
jessedoyle authored Dec 13, 2024
2 parents 37c64e7 + 5f9e920 commit a1f35a3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 4.1.0 - December 12, 2024

* Add a `size_mode` option to the `icon` method that scales the size of the rendered icon to fit within the requested value.

Please see the documentation [here](https://github.com/jessedoyle/prawn-icon?tab=readme-ov-file#icon-size-mode) for further information. Thanks @pepijnve! [Pull Request](https://github.com/jessedoyle/prawn-icon/pull/65)

# 4.0.0 - November 25, 2024

* **breaking change** - Update from FontAwesome 5.11.2 to 6.7.1. Please see the notes [here](https://fontawesome.com/changelog#v6-0-0) for information related to changed or removed icons in the set. Thanks @pepijnve! [Pull Request](https://github.com/jessedoyle/prawn-icon/pull/62)
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ If you wish to fork this repository and add a new font, you'll likely need to su

## Examples

A Rake task is included to generate documents that display each icon and it's corresponding icon key.
A Rake task is included to generate documents that display each icon and its corresponding icon key.

The command:

Expand All @@ -121,6 +121,23 @@ Prawn::Icon.configure do |config|
end
```

## Icon Size Mode

Some font families (in particular those of FontAwesome 6) define metrics that may render an icon at a size larger than requested (as described [here](https://github.com/jessedoyle/prawn-icon/pull/62#issuecomment-2501622305)).

Prawn::Icon provides a `size_mode` parameter that can be utilized to control this behaviour:

* `size_mode: :font_size` (**default**) - Renders the icon at a size calculated via font metrics. This may result in an icon that renders larger than requested due to ascender/descender metrics.
* `size_mode: :icon_height` - Renders the icon at a size scaled down to the requested size.

You can specify the size mode as follows:

```ruby
Prawn::Document.generate('size_mode.pdf') do |pdf|
pdf.icon 'far-circle', size: 100, size_mode: :icon_height
end
```

## Contributing

I'll gladly accept pull requests that are well tested for any bug found in Prawn::Icon.
Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/icon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

module Prawn
class Icon
VERSION = '4.0.0'
VERSION = '4.1.0'
end
end

0 comments on commit a1f35a3

Please sign in to comment.