frameit 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a09eef67fb1b74cdf9233221b02a0bef2c90cdb7
4
- data.tar.gz: 254360304c3cae8929e7a06c142223de91fb9008
3
+ metadata.gz: 188b8ea20cad11a2393517fb8bba0ec2c829405d
4
+ data.tar.gz: 473304b521bb4260e1a0cd5eb4e37ce8d0e4b708
5
5
  SHA512:
6
- metadata.gz: edf0fda390e74e7a6f2ebf31b4400e0ccd1c952b61bcc76968084dc9d4fa5d12cdcdb9f766e64595dfae804ba6799decd1af72cf5825a28f1492637a70be3b38
7
- data.tar.gz: a9922bb2cb107ce9157b1d2be1bb7a95c5fa55205a91c5e768549382b86ee2f37accd817d74b82a978cf8f8b7cfeaacca791612e35b2f0429c14e2c378210985
6
+ metadata.gz: cafe220cb4a05c28778b37ec80cc1b3ec15eef12c338c6d428cf03a5678ab26b434b732799735ac3d90fd9b3ba04cf7c5c0e22f8b1be3c6714af2222b68cc6a7
7
+ data.tar.gz: 7dd45bc48124868b0057c55c6719307c20a6dbfc46120c151fbf0dfa97916dd3716e7b913f748cd3b6f10e3d2e36efc6081d1896fd729d5bedcb7323fbb755fa
data/README.md CHANGED
@@ -13,7 +13,11 @@
13
13
  <a href="https://github.com/KrauseFx/sigh">sigh</a> &bull;
14
14
  <a href="https://github.com/KrauseFx/produce">produce</a> &bull;
15
15
  <a href="https://github.com/KrauseFx/cert">cert</a> &bull;
16
- <a href="https://github.com/KrauseFx/codes">codes</a>
16
+ <a href="https://github.com/KrauseFx/codes">codes</a> &bull;
17
+ <a href="https://github.com/fastlane/spaceship">spaceship</a> &bull;
18
+ <a href="https://github.com/fastlane/pilot">pilot</a> &bull;
19
+ <a href="https://github.com/fastlane/boarding">boarding</a> &bull;
20
+ <a href="https://github.com/fastlane/gym">gym</a>
17
21
  </p>
18
22
  -------
19
23
 
@@ -170,6 +174,8 @@ Use it to define the general information:
170
174
 
171
175
  The `filter` value is a part of the screenshot named for which the given option should be used. If a screenshot is named `iPhone5_Brainstorming.png` the first entry in the `data` array will be used.
172
176
 
177
+ You can find a more complex [configuration](https://github.com/fastlane/examples/blob/master/MindNode/screenshots/Framefile.json) to also support Chinese, Japanese and Korean languages.
178
+
173
179
  The `Framefile.json` should be in the `screenshots` folder, as seen in the [example](https://github.com/fastlane/examples/tree/master/MindNode/screenshots).
174
180
 
175
181
  #### `.strings` files
@@ -214,20 +220,24 @@ With `frameit` 2.0 is possible to also frame Mac OS X Applications. You have to
214
220
  }
215
221
  ```
216
222
 
217
- Check out the [MindNode example project](https://github.com/fastlane/examples/tree/master/MindNode/screenshots)
223
+ Check out the [MindNode example project](https://github.com/fastlane/examples/tree/master/MindNode/screenshots).
218
224
 
219
225
  # Tips
220
226
 
221
227
  ## [`fastlane`](https://fastlane.tools) Toolchain
222
228
 
223
229
  - [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
224
- - [`deliver`](https://github.com/KrauseFx/deliver): Upload screenshots, metadata and your app to the App Store using a single command
230
+ - [`deliver`](https://github.com/KrauseFx/deliver): Upload screenshots, metadata and your app to the App Store
225
231
  - [`snapshot`](https://github.com/KrauseFx/snapshot): Automate taking localized screenshots of your iOS app on every device
226
232
  - [`PEM`](https://github.com/KrauseFx/pem): Automatically generate and renew your push notification profiles
227
233
  - [`sigh`](https://github.com/KrauseFx/sigh): Because you would rather spend your time building stuff than fighting provisioning
228
234
  - [`produce`](https://github.com/KrauseFx/produce): Create new iOS apps on iTunes Connect and Dev Portal using the command line
229
235
  - [`cert`](https://github.com/KrauseFx/cert): Automatically create and maintain iOS code signing certificates
230
236
  - [`codes`](https://github.com/KrauseFx/codes): Create promo codes for iOS Apps using the command line
237
+ - [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
238
+ - [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
239
+ - [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
240
+ - [`gym`](https://github.com/fastlane/gym): Building your iOS apps has never been easier
231
241
 
232
242
  ##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
233
243
 
@@ -246,17 +256,9 @@ You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/Simulator
246
256
  - ```rm -rf ~/.frameit```
247
257
 
248
258
  # Need help?
249
- - If there is a technical problem with ```frameit```, submit an issue.
250
- - I'm available for contract work - drop me an email: frameit@krausefx.com
259
+ Please submit an issue on GitHub and provide information about your setup
251
260
 
252
261
  # License
253
262
  This project is licensed under the terms of the MIT license. See the LICENSE file.
254
263
 
255
- # Contributing
256
-
257
- 1. Create an issue to discuss about your idea
258
- 2. Fork it (https://github.com/KrauseFx/frameit/fork)
259
- 3. Create your feature branch (`git checkout -b my-new-feature`)
260
- 4. Commit your changes (`git commit -am 'Add some feature'`)
261
- 5. Push to the branch (`git push origin my-new-feature`)
262
- 6. Create a new Pull Request
264
+ > This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.
@@ -126,7 +126,12 @@ module Frameit
126
126
  left_space = (background.width / 2.0 - image.width / 2.0).round
127
127
  bottom_space = -(image.height / 10).round # to be just a bit below the image bottom
128
128
  bottom_space -= 40 if screenshot.is_portrait? # even more for portrait mode
129
- bottom_space -= 50 if (screenshot.is_mini? and screenshot.is_portrait?) # super old devices
129
+
130
+ if screenshot.is_mini?
131
+ # Such small devices need special treatment
132
+ bottom_space -= 50 if screenshot.is_portrait?
133
+ bottom_space += 65 unless screenshot.is_portrait?
134
+ end
130
135
 
131
136
  self.top_space_above_device = background.height - image.height - bottom_space
132
137
 
@@ -152,18 +157,39 @@ module Frameit
152
157
  keyword = title_images[:keyword]
153
158
  title = title_images[:title]
154
159
 
155
- sum_width = (keyword.width rescue 0) + title.width + keyword_padding
156
- top_space = (top_space_above_device / 2.0 - actual_font_size / 2.0).round # centered
157
-
160
+ # sum_width: the width of both labels together including the space inbetween
161
+ # is used to calculate the ratio
162
+ sum_width = title.width
163
+ sum_width += keyword.width + keyword_padding if keyword
164
+
165
+ # Resize the 2 labels if necessary
166
+ smaller = 1.0 # default
167
+ ratio = (sum_width + keyword_padding * 2) / image.width.to_f
168
+ if ratio > 1.0
169
+ # too large - resizing now
170
+ smaller = (1.0 / ratio)
171
+
172
+ Helper.log.debug "Text for image #{self.screenshot.path} is quite long, reducing font size by #{(ratio - 1.0).round(2)}" if $verbose
173
+
174
+ title.resize"#{(smaller * title.width).round}x"
175
+ keyword.resize"#{(smaller * keyword.width).round}x" if keyword
176
+ sum_width *= smaller
177
+ end
178
+
179
+ top_space = (top_space_above_device / 2.0 - (actual_font_size / 2.0 * smaller)).round # centered
158
180
  left_space = (image.width / 2.0 - sum_width / 2.0).round
181
+
182
+ # First, put the keyword on top of the screenshot, if we have one
159
183
  if keyword
160
184
  @image = image.composite(keyword, "png") do |c|
161
185
  c.compose "Over"
162
186
  c.geometry "+#{left_space}+#{top_space}"
163
187
  end
164
- end
165
188
 
166
- left_space += (keyword.width rescue 0) + keyword_padding
189
+ left_space += keyword.width + (keyword_padding * smaller)
190
+ end
191
+
192
+ # Then, put the title on top of the screenshot next to the keyword
167
193
  @image = image.composite(title, "png") do |c|
168
194
  c.compose "Over"
169
195
  c.geometry "+#{left_space}+#{top_space}"
@@ -175,6 +201,7 @@ module Frameit
175
201
  [top_space_above_device / 3.0, @image.width / 30.0].max.round
176
202
  end
177
203
 
204
+ # The space between the keyword and the title
178
205
  def keyword_padding
179
206
  (actual_font_size / 2.0).round
180
207
  end
@@ -189,11 +216,14 @@ module Frameit
189
216
  title_image = MiniMagick::Image.open(empty_path)
190
217
  image_height = actual_font_size * 2 # gets trimmed afterwards anyway, and on the iPad the `y` would get cut
191
218
  title_image.combine_options do |i|
192
- i.resize "#{max_width}x#{image_height}!" # `!` says it should ignore the ratio
219
+ # * 2.0 as the text might be larger than the actual image. We're trimming afterwards anyway
220
+ i.resize "#{max_width * 2.0}x#{image_height}!" # `!` says it should ignore the ratio
193
221
  end
194
222
 
195
223
  current_font = font(key)
224
+ text = fetch_text(key)
196
225
  Helper.log.debug "Using #{current_font} as font the #{key} of #{screenshot.path}" if $verbose and current_font
226
+ Helper.log.debug "Adding text '#{fetch_text(key)}'"if $verbose
197
227
 
198
228
  # Add the actual title
199
229
  title_image.combine_options do |i|
@@ -268,8 +298,8 @@ module Frameit
268
298
  end
269
299
  end
270
300
 
271
- Helper.log.debug "No custom font specified, using the default one" if $verbose
301
+ Helper.log.debug "No custom font specified for #{screenshot}, using the default one" if $verbose
272
302
  return nil
273
303
  end
274
304
  end
275
- end
305
+ end
@@ -9,13 +9,13 @@ module Frameit
9
9
  case screenshot.screen_size
10
10
  when size::IOS_55
11
11
  return {
12
- 'offset' => '+42+147',
13
- 'width' => 539
12
+ 'offset' => '+41+146',
13
+ 'width' => 541
14
14
  }
15
15
  when size::IOS_47
16
16
  return {
17
- 'offset' => '+41+154',
18
- 'width' => 530
17
+ 'offset' => '+40+153',
18
+ 'width' => 532
19
19
  }
20
20
  when size::IOS_40
21
21
  return {
@@ -64,4 +64,4 @@ module Frameit
64
64
  end
65
65
  end
66
66
  end
67
- end
67
+ end
@@ -1,3 +1,3 @@
1
1
  module Frameit
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frameit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core