Skip to content

Commit a1f35a3

Browse files
authored
Merge pull request #66 from jessedoyle/release-4.1.0
chore: Release Version 4.1.0
2 parents 37c64e7 + 5f9e920 commit a1f35a3

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 4.1.0 - December 12, 2024
2+
3+
* Add a `size_mode` option to the `icon` method that scales the size of the rendered icon to fit within the requested value.
4+
5+
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)
6+
17
# 4.0.0 - November 25, 2024
28

39
* **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)

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ If you wish to fork this repository and add a new font, you'll likely need to su
101101

102102
## Examples
103103

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

106106
The command:
107107

@@ -121,6 +121,23 @@ Prawn::Icon.configure do |config|
121121
end
122122
```
123123

124+
## Icon Size Mode
125+
126+
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)).
127+
128+
Prawn::Icon provides a `size_mode` parameter that can be utilized to control this behaviour:
129+
130+
* `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.
131+
* `size_mode: :icon_height` - Renders the icon at a size scaled down to the requested size.
132+
133+
You can specify the size mode as follows:
134+
135+
```ruby
136+
Prawn::Document.generate('size_mode.pdf') do |pdf|
137+
pdf.icon 'far-circle', size: 100, size_mode: :icon_height
138+
end
139+
```
140+
124141
## Contributing
125142

126143
I'll gladly accept pull requests that are well tested for any bug found in Prawn::Icon.

lib/prawn/icon/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
module Prawn
1010
class Icon
11-
VERSION = '4.0.0'
11+
VERSION = '4.1.0'
1212
end
1313
end

0 commit comments

Comments
 (0)