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

Can not generate a framed screen with a title. #1740

Closed
fastlane-bot opened this issue Sep 18, 2015 · 20 comments

Comments

Projects
None yet
4 participants
@fastlane-bot
Copy link

commented Sep 18, 2015

Original issue by @olutsenko - Imported from fastlane/frameit#49

Hello,

I am trying to get the example working. I want to have two screenshots framed with a title on top. Bellow is my configuration + output for the 'frameit --verbose'

screenshot 2015-09-18 08 46 47

Framefile.json

{
    "default": {
        "keyword": {
            "font": "./fonts/SF-UI-Display-Regular.otf",
            "supported": ["en-US"]
        },
        "title": {
            "font": "./fonts/SF-UI-Display-Regular.otf",
            "supported": ["en-US"],
            "color": "#545454"
        },
        "background": "./background.jpg",
        "padding": 50
    },

    "data": [
             {
             "keyword": {
             "color": "#d21559"
             }
             },
             {
             "keyword": {
             "color": "#feb909"
             }
             }
             ]
}

title.strings

"Brainstorming" = "Let Your Ideas Grow";
"Organizing" = "Think Content, Not Layout";

**keyword.strings**
"Brainstorming" = "BRAINSTORMING";
"Organizing" = "ORGANIZING";

Output

$ frameit --verbose
INFO [2015-09-18 08:44:19.03]: Parsing config file '/Users/oleg/Desktop/test/Framefile.json'
ERROR [2015-09-18 08:44:19.03]: no implicit conversion of nil into String
ERROR [2015-09-18 08:44:19.03]: Backtrace:
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `include?'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `block in fetch_value'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `each'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `find'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `fetch_value'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:252:in `fetch_config'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:83:in `should_add_title?'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:16:in `frame!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/screenshot.rb:72:in `frame!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:29:in `block in run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in `each'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in `run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:31:in `block (2 levels) in run'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:71:in `run!'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:55:in `run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:63:in `<top (required)>'
    /usr/bin/frameit:23:in `load'
    /usr/bin/frameit:23:in `<main>'
INFO [2015-09-18 08:44:21.42]: Parsing config file '/Users/oleg/Desktop/test/Framefile.json'
ERROR [2015-09-18 08:44:21.42]: no implicit conversion of nil into String
ERROR [2015-09-18 08:44:21.42]: Backtrace:
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `include?'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `block in fetch_value'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `each'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `find'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/config_parser.rb:27:in `fetch_value'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:252:in `fetch_config'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:83:in `should_add_title?'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:16:in `frame!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/screenshot.rb:72:in `frame!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:29:in `block in run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in `each'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in `run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:31:in `block (2 levels) in run'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:71:in `run!'
    /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:55:in `run'
    /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:63:in `<top (required)>'
    /usr/bin/frameit:23:in `load'
    /usr/bin/frameit:23:in `<main>'
@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 19, 2015

@skrew commented

I Had the same problem, you can try:

  • Use the same example, like you do in precedent issue.
  • Open files in Xcode (title.strings and keyword.strings) and in right panel, under "text settings", change text settings to "Unicode (UTF-16)"

Works for me only where files are encoded in UTF-16 (as mentioned in documentation)

frameit uses iconv for converting AND load content of files.
I had not tested but i think iconv return empty content if the file are not in UTF-16 format.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@olutsenko commented

@skrew Thanks a lot for your reply. Unfortunately your suggestion didn't solve the issue. Output is the same.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@skrew commented

@olutsenko add "filter" in "data" in Framefile.json (like MindNode example)

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@olutsenko commented

It looks like it doesn't go into 'en-US' folder to read the .strings file. Because of that it falls back to default title which must be specified in .json file. But what format for specifying the title?

I tried one bellow, but result is the same.

"data": [
{
"filter": "Brainstorming",
"title": "Test title",
"keyword": {
"color": "#d21559"
}
...

Output:

$ frameit --verbose
INFO [2015-09-20 13:04:44.39]: Parsing config file '/Users/oleg/Desktop/test/Framefile.json'
DEBUG [2015-09-20 13:04:45.55]: Falling back to default text as there was nothing specified in the .strings file
DEBUG [2015-09-20 13:04:45.55]: Falling back to default text as there was nothing specified in the .strings file
ERROR [2015-09-20 13:04:45.55]: Could not get title for screenshot ./en-US-Brainstorming.png. Please provide one in your Framefile.json
ERROR [2015-09-20 13:04:45.55]: Backtrace:
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:273:in fetch_text' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:inblock in build_title_images'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:in keep_if' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:inbuild_title_images'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:156:in add_title' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:102:incomplex_framing'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:17:in frame!' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/screenshot.rb:72:inframe!'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:29:in block in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:ineach'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:31:inblock (2 levels) in run'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in call' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:incall'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in run' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:inrun_active_command'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:71:in run!' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:inrun!'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:55:in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:63:in<top (required)>'
/usr/bin/frameit:23:in load' /usr/bin/frameit:23:in

'
INFO [2015-09-20 13:04:47.40]: Parsing config file '/Users/oleg/Desktop/test/Framefile.json'
DEBUG [2015-09-20 13:04:48.57]: Falling back to default text as there was nothing specified in the .strings file
DEBUG [2015-09-20 13:04:48.57]: Falling back to default text as there was nothing specified in the .strings file
ERROR [2015-09-20 13:04:48.57]: Could not get title for screenshot ./en-US-Organizing.png. Please provide one in your Framefile.json
ERROR [2015-09-20 13:04:48.57]: Backtrace:
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:273:in fetch_text' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:inblock in build_title_images'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:in keep_if' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:211:inbuild_title_images'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:156:in add_title' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:102:incomplex_framing'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/editor.rb:17:in frame!' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/screenshot.rb:72:inframe!'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:29:in block in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:ineach'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/lib/frameit/runner.rb:21:in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:31:inblock (2 levels) in run'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in call' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:incall'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in run' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:inrun_active_command'
/Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:71:in run!' /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:inrun!'
/Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:55:in run' /Library/Ruby/Gems/2.0.0/gems/frameit-2.2.1/bin/frameit:63:in<top (required)>'
/usr/bin/frameit:23:in load' /usr/bin/frameit:23:in'

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@skrew commented

Test with my config... It's works

title.strings: (in language directory)

"Brainstorming" = "Let Your Ideas Grow";
"Organizing" = "Think Content, Not Layout";
"Sharing" = "Spread Your Ideas Easily";
"Styling" = "Say It Your Way";

keyword.strings: (in language directory)

"Brainstorming" = "BRAINSTORMING";
"Organizing" = "ORGANIZING";
"Sharing" = "SHARING";
"Styling" = "STYLING";

Framefile.json

{
    "default": {
        "keyword": {
            "fonts": [
                      {
                      "font": "./fonts/SyrCOMAntioch.otf",
                      "supported": ["fr-FR"]
                      }
                      ]
        },
        "title": {
            "fonts": [
                      {
                      "font": "./fonts/SyrCOMAntioch.otf",
                      "supported": ["fr-FR"]
                      }
                      ],
            "color": "#545454"
        },
        "background": "./background.jpg",
        "padding": 50
    },

    "data": [
             {
             "filter": "Brainstorming",
             "keyword": {
             "color": "#d21559"
             }
             },
             {
             "filter": "Organizing",
             "keyword": {
             "color": "#feb909"
             }
             },
             {
             "filter": "Sharing",
             "keyword": {
             "color": "#aa4dbc"
             }
             },
             {
             "filter": "Styling",
             "keyword": {
             "color": "#31bb48"
             }
             }
             ]
}
@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@olutsenko commented

@skrew I have the same output with your configuration. Do I have to follow some file-naming format for the screenshots to match them with data in .strings file?

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

@skrew commented

@olutsenko yes, eg: i would use 1_iphone6_Brainstorming.png for the first in example. Tested, it works.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Sep 23, 2015

@kcandr commented

@olutsenko Are your .strings files encoded with UTF-16? Do you saw fastlane-old/frameit#32?

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Oct 19, 2015

@bartl-git commented

Hi. I got the same problem.
Strings files are utf-16 encoded.
Did anyone solve this?

fixed: There was troubles with incorrect strings file encoding. Xcode says that file is utf16, but it isn't. Retyping files in Xcode helps to solve this for me.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Oct 29, 2015

@chinnawatp commented

For anyone having this eror
Could not get title for screenshot " ". Please provide one in your Framefile.json"
My solution is to put filed "text" in "title":{} Framefile.json

*Example
Framefile.json

 "title": {
      "text" : "My very long title\nwith line break",   
      "fonts": [
        {
          "font": "./fonts/DB HELVETHAICAMON X MED V3.2.TTF",
          "supported": ["de-DE", "en-US", "es-ES", "fr-FR", "it-IT", "nl-NL", "sv-SE", "pt-BR"]
        }
      ],
      "color": "#545454"
    }
@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Nov 6, 2015

@soheil commented

Here is a sample for anyone else stuck:

{
  "default": {
    "keyword": {
      "font": "./Roboto-Regular.otf"
    },
    "title": {
      "font": "./Roboto-Bold.otf",
      "color": "#545454"
    },
    "background": "./background.jpg",
    "padding": 50
  },
  "data": [
    {
      "filter": "List",
      "keyword": {
        "color": "#d21559"
      },
      "title": {
        "text": "nice"
      }
    }
  ]
}
@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Dec 2, 2015

@zkirill commented

Had trouble with Xcode not saving in UTF-16 so I used TextWrangler. The setting is located on the status bar.

EDIT: Make sure your encoding says UTF-16 and not some other variant of UTF-16. Easy to miss.

screen shot 2015-12-02 at 3 12 43 pm

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Dec 9, 2015

@juliengomes commented

I spent the last 4 hours trying to make it work... and it still doesn't !
This is a great tool, but guys please provide the minimum vital doc please, it's a real PITA !

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Dec 14, 2015

@KrauseFx commented

@juliengomes I'm more than happy to merge a pull request improving the docs so they're easier to understand. Many users got a working setup using the example files and documentation.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Jan 22, 2016

@jeeftor commented

Maybe we could just link to this issue - if i get a chance i'll do ti.

@fastlane-bot

This comment has been minimized.

Copy link
Author

commented Feb 4, 2016

@Rico99 commented

@olutsenko For what it's worth, I ran into the same issue today and finally figured it out.

If you are using localized screenshots, you must place the screenshots into the language folder (e.g. en-US) that contains the .strings files.

Your test screenshots Organizing.png and Brainstorming.png are at the top level, but they have to go into the en-US folder (along with the .stings files).

@phynet

This comment has been minimized.

Copy link

commented May 2, 2016

I know this issue is closed, but I will like to add the steps to resolve the problems with frameit with titles in top:

  1. copy files keywords.string and * title.string* from [https://github.com/fastlane/examples/tree/master/MindNode/screenshots/en-US]
  2. open and edit with TextWrangler, make sure the file is UTF-16 Little-Endian
  3. use Frameit.json from the same example and update with your own keywords

The most important thing is to edit the file in UTF-16 Little-Endian, and TextWrangler help me to do so (Sublime, or Atom Editor did not)

(https://github.com/fastlane/examples/tree/master/MindNode/screenshots/en-US)

@TKBurner

This comment has been minimized.

Copy link

commented May 3, 2016

@phynet Thanks for sharing. I'm going to let the team know about this UTF-16 solution, I'm sure that'll help us improve going forward. 👍

@TKBurner TKBurner closed this May 3, 2016

@banaslee

This comment has been minimized.

Copy link

commented Sep 16, 2016

@TKBurner @phynet as of v2.7.0, I could only make the entries on my .strings files to be recognised work if I set them to UTF-16 (not Little-Endian).
I used iconv to check the encoding and Xcode to change it.

@TKBurner

This comment has been minimized.

Copy link

commented Sep 22, 2016

@banaslee Thanks for following up on this. Can you open a new issue with the full template. Also, what characters are you using in your strings?

@fastlane fastlane locked and limited conversation to collaborators Sep 22, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.