recursive-code-config icon indicating copy to clipboard operation
recursive-code-config copied to clipboard

Error when building the fonts

Open larsbs opened this issue 4 years ago • 1 comments

It seems that either the README is out of date or there's a bug in the script because when you try to run it you get:

Traceback (most recent call last):
  File "scripts/instantiate-code-fonts.py", line 33, in <module>
    fontPath = sys.argv[2]
IndexError: list index out of range

And it all seems to be related to this line introduced in the latest commit: https://github.com/arrowtype/recursive-code-config/blob/main/scripts/instantiate-code-fonts.py#L33

EDIT: There also seems to be an issue with the line endings of scripts/build-all.sh because if you try to run it as-is in linux you get:

scripts/build-all.sh: line 2: $'\r': command not found
scripts/build-all.sh: line 4: $'\r': command not found
: invalid optionl.sh: line 5: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
scripts/build-all.sh: line 6: $'\r': command not found
scripts/build-all.sh: line 23: syntax error near unexpected token `$'do\r''
'cripts/build-all.sh: line 23: `for config in $configs; do

This gets fixed by changing the line endings from CRLF to simply LF

larsbs avatar Oct 20 '21 11:10 larsbs

For the first issue, the script changed recently, to take in a source font-data path. In order to generate the font again, you'll need to run this instead:

python3 scripts/instantiate-code-fonts.py <premade-configs/casual.yaml> <font-data/Recursive_VF_1.081.ttf>

It's mentioned here.

I've pushed a PR fix that picks a default path. This is only if @arrowtype feels like keeping the previous api makes sense where we don't have to explicitly specify the path.

kaushikgopal avatar Nov 13 '21 00:11 kaushikgopal

Sorry this took me forever to get to. Thanks so much for your help, @kaushikgopal!

I’ll reopen this issue to see if I can solve for the shell script issue.

arrowtype avatar Apr 11 '23 14:04 arrowtype

Hey @larsbs, I’ve tried to update the line endings with a .gitattributes file ... if you have time, would you perhaps be willing to test this again on Linux, and let me know if this is still an issue? I am new to the idea of line ending normalization, so I may have missed a step!

arrowtype avatar Apr 11 '23 14:04 arrowtype

@arrowtype I just tried with a freshly cloned repo and it worked out the box. Good job! 👍

larsbs avatar Apr 12 '23 16:04 larsbs

That's amazing news – thanks for checking and letting me know, @larsbs!

arrowtype avatar Apr 13 '23 17:04 arrowtype