Skip to content

Commit 21e262f

Browse files
committed
download Roboto fonts
1 parent f7f4cf1 commit 21e262f

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
name: install NotoSansCJK fonts
103103
command: sudo apt install fonts-noto-cjk
104104
- run:
105-
name: download google fonts e.g. Raleway
105+
name: download google fonts e.g. Raleway, Roboto
106106
command: python3 ./.circleci/download_google_fonts.py
107107
- run:
108108
name: install all google fonts

.circleci/download_google_fonts.py

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
import requests
22

3-
dirOut = '.circleci/fonts/truetype/googleFonts'
3+
dirOut = '.circleci/fonts/truetype/googleFonts/'
44

5-
family = 'Raleway'
6-
repo = 'https://github.com/impallari/' + family + '/blob/master/fonts/v3.000%20Fontlab/TTF/'
5+
def download(repo, family, types) :
6+
for t in types :
7+
name = family + t + '.ttf'
8+
url = repo + name + '?raw=true'
9+
print(url)
10+
req = requests.get(url, allow_redirects=True)
11+
open(dirOut + name, 'wb').write(req.content)
712

8-
types = [
9-
'-Regular',
10-
'-Regular-Italic',
11-
'-Bold',
12-
'-Bold-Italic'
13-
]
13+
download(
14+
'https://github.com/impallari/Raleway/blob/master/fonts/v3.000%20Fontlab/TTF/',
15+
'Raleway',
16+
[
17+
'-Regular',
18+
'-Regular-Italic',
19+
'-Bold',
20+
'-Bold-Italic'
21+
]
22+
)
1423

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)
24+
download(
25+
'https://github.com/googlefonts/roboto/blob/main/src/hinted/',
26+
'Roboto',
27+
[
28+
'-Regular',
29+
'-Italic',
30+
'-Bold',
31+
'-BoldItalic'
32+
]
33+
)

0 commit comments

Comments
 (0)