frameit 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -13
- data/lib/frameit/editor.rb +15 -58
- data/lib/frameit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0386691d3d975aaa1470d94950208b4f086d776b
|
4
|
+
data.tar.gz: a7ae4164557057c19324728f3a0ba5883e81cdac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f2afb9854ac5040fb8fec9ade1a5e073d8e002a02be5aa715638a5f2ad4f69e375cad43b77c74cef24c7da8e24f11c2e8d3e316482055e14e466618f163a6e8
|
7
|
+
data.tar.gz: afdb2af3b99176e503fedb2910bccd7a477e6900e8b3e2fbaff64d884792002c303025ec40d9f8d65a1bfb82335627fb871a81044d1cea026966ca1c4a029138
|
data/README.md
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
</a>
|
7
7
|
</h3>
|
8
8
|
<p align="center">
|
9
|
-
<a href="https://github.com/fastlane/deliver">deliver</a> •
|
10
|
-
<a href="https://github.com/fastlane/snapshot">snapshot</a> •
|
11
|
-
<b>frameit</b> •
|
12
|
-
<a href="https://github.com/fastlane/pem">pem</a> •
|
13
|
-
<a href="https://github.com/fastlane/sigh">sigh</a> •
|
9
|
+
<a href="https://github.com/fastlane/deliver">deliver</a> •
|
10
|
+
<a href="https://github.com/fastlane/snapshot">snapshot</a> •
|
11
|
+
<b>frameit</b> •
|
12
|
+
<a href="https://github.com/fastlane/pem">pem</a> •
|
13
|
+
<a href="https://github.com/fastlane/sigh">sigh</a> •
|
14
14
|
<a href="https://github.com/fastlane/produce">produce</a> •
|
15
15
|
<a href="https://github.com/fastlane/cert">cert</a> •
|
16
16
|
<a href="https://github.com/fastlane/spaceship">spaceship</a> •
|
@@ -41,10 +41,10 @@ Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.c
|
|
41
41
|
|
42
42
|
-------
|
43
43
|
<p align="center">
|
44
|
-
<a href="#features">Features</a> •
|
45
|
-
<a href="#installation">Installation</a> •
|
46
|
-
<a href="#usage">Usage</a> •
|
47
|
-
<a href="#tips">Tips</a> •
|
44
|
+
<a href="#features">Features</a> •
|
45
|
+
<a href="#installation">Installation</a> •
|
46
|
+
<a href="#usage">Usage</a> •
|
47
|
+
<a href="#tips">Tips</a> •
|
48
48
|
<a href="#need-help">Need help?</a>
|
49
49
|
</p>
|
50
50
|
|
@@ -101,7 +101,7 @@ You only have to do this once per computer.
|
|
101
101
|
- Press ```Enter```
|
102
102
|
- Unzip and move the content of the zip files to ```~/.frameit/devices_frames```
|
103
103
|
- Press ```Enter```
|
104
|
-
|
104
|
+
|
105
105
|
# Usage
|
106
106
|
|
107
107
|
Why should you have to use Photoshop, just to add a frame around your screenshots?
|
@@ -113,7 +113,7 @@ Just navigate to your folder of screenshots and use the following command:
|
|
113
113
|
To use the silver version of the frames:
|
114
114
|
|
115
115
|
frameit silver
|
116
|
-
|
116
|
+
|
117
117
|
To run the setup process again to add new frames use:
|
118
118
|
|
119
119
|
frameit setup
|
@@ -122,7 +122,7 @@ When using `frameit` without titles on top, the screenshots will have the full r
|
|
122
122
|
|
123
123
|
# Titles and Background (optional)
|
124
124
|
|
125
|
-
With `frameit` 2.0 you are now able to add a custom background, title and text colors to your screenshots.
|
125
|
+
With `frameit` 2.0 you are now able to add a custom background, title and text colors to your screenshots. Optionally you can also set a custom font size.
|
126
126
|
|
127
127
|
A working example can be found in the [fastlane examples](https://github.com/fastlane/examples/tree/master/MindNode/screenshots) project.
|
128
128
|
|
@@ -239,7 +239,7 @@ Check out the [MindNode example project](https://github.com/fastlane/examples/tr
|
|
239
239
|
- [`cert`](https://github.com/fastlane/cert): Automatically create and maintain iOS code signing certificates
|
240
240
|
- [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
|
241
241
|
- [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
|
242
|
-
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
242
|
+
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
243
243
|
- [`gym`](https://github.com/fastlane/gym): Building your iOS apps has never been easier
|
244
244
|
- [`scan`](https://github.com/fastlane/scan): The easiest way to run tests of your iOS and Mac app
|
245
245
|
- [`match`](https://github.com/fastlane/match): Easily sync your certificates and profiles across your team using git
|
data/lib/frameit/editor.rb
CHANGED
@@ -5,8 +5,6 @@ module Frameit
|
|
5
5
|
attr_accessor :image # the current image used for editing
|
6
6
|
attr_accessor :top_space_above_device
|
7
7
|
|
8
|
-
FONT_SIZE_REFERENCE_WIDTH = 640.0 # The size of device a, e.g. "12px" is defined for
|
9
|
-
|
10
8
|
def frame!(screenshot)
|
11
9
|
self.screenshot = screenshot
|
12
10
|
prepare_image
|
@@ -174,22 +172,18 @@ module Frameit
|
|
174
172
|
sum_width = title.width
|
175
173
|
sum_width += keyword.width + keyword_padding if keyword
|
176
174
|
|
177
|
-
#
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
title.resize "#{(smaller * title.width).round}x"
|
190
|
-
keyword.resize "#{(smaller * keyword.width).round}x" if keyword
|
191
|
-
sum_width *= smaller
|
192
|
-
end
|
175
|
+
# Resize the 2 labels if necessary
|
176
|
+
smaller = 1.0 # default
|
177
|
+
ratio = (sum_width + keyword_padding * 2) / image.width.to_f
|
178
|
+
if ratio > 1.0
|
179
|
+
# too large - resizing now
|
180
|
+
smaller = (1.0 / ratio)
|
181
|
+
|
182
|
+
UI.message "Text for image #{self.screenshot.path} is quite long, reducing font size by #{(ratio - 1.0).round(2)}" if $verbose
|
183
|
+
|
184
|
+
title.resize "#{(smaller * title.width).round}x"
|
185
|
+
keyword.resize "#{(smaller * keyword.width).round}x" if keyword
|
186
|
+
sum_width *= smaller
|
193
187
|
end
|
194
188
|
|
195
189
|
vertical_padding = vertical_frame_padding
|
@@ -216,13 +210,13 @@ module Frameit
|
|
216
210
|
background
|
217
211
|
end
|
218
212
|
|
219
|
-
def
|
213
|
+
def actual_font_size
|
220
214
|
[@image.width / 10.0].max.round
|
221
215
|
end
|
222
216
|
|
223
217
|
# The space between the keyword and the title
|
224
218
|
def keyword_padding
|
225
|
-
(
|
219
|
+
(actual_font_size / 2.0).round
|
226
220
|
end
|
227
221
|
|
228
222
|
# This will build 2 individual images with the title, which will then be added to the real image
|
@@ -240,7 +234,6 @@ module Frameit
|
|
240
234
|
end
|
241
235
|
|
242
236
|
current_font = font(key)
|
243
|
-
custom_font_size = font_size(key)
|
244
237
|
text = fetch_text(key)
|
245
238
|
UI.message "Using #{current_font} as font the #{key} of #{screenshot.path}" if $verbose and current_font
|
246
239
|
UI.message "Adding text '#{text}'" if $verbose
|
@@ -251,12 +244,7 @@ module Frameit
|
|
251
244
|
title_image.combine_options do |i|
|
252
245
|
i.font current_font if current_font
|
253
246
|
i.gravity "Center"
|
254
|
-
|
255
|
-
i.pointsize custom_font_size
|
256
|
-
UI.message "Using custom font size #{custom_font_size}" if $verbose
|
257
|
-
else
|
258
|
-
i.pointsize derived_font_size
|
259
|
-
end
|
247
|
+
i.pointsize actual_font_size
|
260
248
|
i.draw "text 0,0 '#{text}'"
|
261
249
|
i.fill fetch_config[key.to_s]['color']
|
262
250
|
end
|
@@ -328,36 +316,5 @@ module Frameit
|
|
328
316
|
UI.message "No custom font specified for #{screenshot}, using the default one" if $verbose
|
329
317
|
return nil
|
330
318
|
end
|
331
|
-
|
332
|
-
def scaled_font_size(font_size)
|
333
|
-
font_ratio = font_size / FONT_SIZE_REFERENCE_WIDTH
|
334
|
-
return (font_ratio * screenshot.size[0].to_f).round
|
335
|
-
end
|
336
|
-
|
337
|
-
# The fontSize we want to use
|
338
|
-
def font_size(key)
|
339
|
-
single_font_size = fetch_config[key.to_s]['fontSize']
|
340
|
-
return single_font_size if single_font_size
|
341
|
-
|
342
|
-
fonts = fetch_config[key.to_s]['fonts']
|
343
|
-
if fonts
|
344
|
-
fonts.each do |font|
|
345
|
-
if font['supported']
|
346
|
-
font['supported'].each do |language|
|
347
|
-
if screenshot.path.include? language
|
348
|
-
return scaled_font_size(font["fontSize"])
|
349
|
-
end
|
350
|
-
end
|
351
|
-
else
|
352
|
-
# No `supported` array, this will always be true
|
353
|
-
UI.message "Found a fontSize with no list of supported languages, using this now" if $verbose
|
354
|
-
return scaled_font_size(font["fontSize"])
|
355
|
-
end
|
356
|
-
end
|
357
|
-
end
|
358
|
-
|
359
|
-
UI.message "No custom fontSize specified for #{screenshot}, using the default one" if $verbose
|
360
|
-
return nil
|
361
|
-
end
|
362
319
|
end
|
363
320
|
end
|
data/lib/frameit/version.rb
CHANGED