8000 add script to download some google fonts · plotly/plotly.js@28077d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 28077d1

Browse files
committed
add script to download some google fonts
- download Raleway fonts
1 parent bb6abea commit 28077d1

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ jobs:
102102
name: install NotoSansCJK fonts
103103
command: sudo apt install fonts-noto-cjk
104104
- run:
105-
name: install google fonts
105+
name: download google fonts e.g. Raleway
106+
command: python3 ./.circleci/download_google_fonts.py
107+
- run:
108+
name: install all google fonts
106109
command: |
107110
sudo cp -r .circleci/fonts/ /usr/share/
108111
sudo fc-cache -f

.circleci/download_google_fonts.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import requests
2+
3+
dirOut = '.circleci/fonts/truetype/googleFonts'
4+
5+
family = 'Raleway'
6+
repo = 'https://github.com/impallari/' + family + '/blob/master/fonts/v3.000%20Fontlab/TTF/'
7+
8+
types = [
9+
'-Regular',
10+
'-Regular-Italic',
11+
'-Bold',
12+
'-Bold-Italic'
13+
]
14+
15+
for t in types :
16+
name = family + t + '.ttf'
17+
url = repo + name + '?raw=true'
18+
print(url)
19+
req = requests.get(url, allow_redirects=True)
20+
open(dirOut + name, 'wb').write(req.content)

0 commit comments

Comments
 (0)
0