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

chore: Release Version 4.1.0 #66

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading