Skip to content

Commit b774067

Browse files
committed
update scripts
1 parent bfb2fed commit b774067

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

scripts/fontawesome_preamble.sty

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
%-------------------------------------------------------------------------------
1919
% requirements
2020
%-------------------------------------------------------------------------------
21-
\usepackage{fontspec}
21+
\RequirePackage{fontspec}
2222

2323

2424
%-------------------------------------------------------------------------------

scripts/fontawesome_tail.sty

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
\endinput
3+
4+
%% end of file `fontawesome.sty`.

scripts/fs_sty.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import os
34
import re
45
from sys import argv
56

@@ -47,17 +48,14 @@ def output_sty(sty, icons):
4748
for ic in icons:
4849
prefix = "\expandafter\def\csname faicon@"
4950
ic_name_h = prefix + ic[0] + "\endcsname"
50-
ic_code_tex = "{\symbol{\"" + ic[2] + "}} \\def\\fa" + ic[1]
51+
ic_code_tex = "{\symbol{\"" + ic[1] + "}} \\def\\fa" + ic[2]
5152
ic_name_tail = " {{\FA\csname faicon@" + ic[0] + "\endcsname}}\n"
5253
f.write(ic_name_h.ljust(63) + ic_code_tex.ljust(42) + ic_name_tail)
53-
with open(sty, 'a') as f:
54-
# tail
55-
f.write("\n")
56-
f.write("\\endinput\n")
57-
f.write("\n\n")
58-
f.write(r"%% end of file `fontawesome.sty`.")
5954

6055

6156
if __name__ == "__main__":
57+
print("output fontawesome.sty...")
6258
icons = get_icons(css)
63-
output_sty("fontawesome.sty", icons)
59+
temp_dir = os.path.dirname(css)
60+
sty = os.path.join(temp_dir, "fontawesome.sty")
61+
output_sty(sty, icons)

scripts/fs_sty.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ temp_root='/tmp/fs_script'
66
fs_src="${temp_root}/fontawesome"
77

88
[ -r "$fs_src" ] && $(rm -rf "$fs_src")
9-
#[ -d "$fs_src" ] && $(rm -r "$fs_src")
109
mkdir -p $fs_src
1110

1211
cp "$script_root/fs_sty.py" "$temp_root"
@@ -17,3 +16,4 @@ cp "${fs_src}/css/font-awesome.css" "${temp_root}/fontawesome.css"
1716
cp "${fs_src}/fonts/FontAwesome.otf" "${resume_root}/fonts/FontAwesome.otf"
1817
python "${temp_root}/fs_sty.py" "${temp_root}/fontawesome.css"
1918
cp "${temp_root}/fontawesome.sty" "${resume_root}"
19+
cat "${resume_root}/scripts/fontawesome_tail.sty" >> "${resume_root}/fontawesome.sty"

0 commit comments

Comments
 (0)