scrrape fonts

This commit is contained in:
bel
2023-07-06 23:25:30 -06:00
parent e6c1d153b7
commit d1278dc5b7
5 changed files with 34 additions and 17 deletions

View File

@@ -12,8 +12,24 @@ cat resume.html \
| sed 's/margin-top: 12pt;/margin-top: 17pt;/g' \
| sed 's/margin-top: 8pt;/margin-top: 12pt;/g' \
| sed 's/margin-top: 6pt;/margin-top: 10pt;/g' \
| sed 's#"/fonts/#"https://www.open-resume.com/fonts/#g' \
| sed 's#<link [^>]*as="font"[^>]*/fonts/[^L][^>]*>##g' \
| sed "s#<link [^>]*as=\"font\"[^>]*/fonts/[^${font_family:0:1}][^>]*>##g" \
| sed "s#<link [^>]*as=\"font\"[^>]*/fonts/${font_family:0:1}[^${font_family:1:1}][^>]*>##g" \
| sed "s#/fonts/#./fonts/#g" \
> resume.html.2 \
|| rm resume.html.2
for font_file in $(
cat resume.html.2 \
| grep -o 'href="./fonts/[^"]*' \
| sed 's#.*"./##'
); do
if [ ! -f "$font_file" ]; then
mkdir -p ./${font_file%/*}/
curl -sS -L https://www.open-resume.com/$font_file > $font_file
fi
done
# | sed 's#"/fonts/#"https://www.open-resume.com/fonts/#g' \