Skip to content

Commit 80b4fc2

Browse files
committed
Fix Roboto Flex download.
1 parent e73b8d3 commit 80b4fc2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/opentype_variations.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030

3131
path = Path(__file__).with_name(f"{DEFAULT_FONT}.ttf")
3232
if not path.exists():
33-
url = f"https://fonts.google.com/download?family={quote(DEFAULT_FONT)}"
33+
url = ("https://github.com/googlefonts/roboto-flex/"
34+
"releases/download/3.200/roboto-flex-fonts.zip")
35+
member = (
36+
"roboto-flex-fonts/fonts/variable/"
37+
"RobotoFlex[GRAD,XOPQ,XTRA,YOPQ,YTAS,YTDE,YTFI,YTLC,YTUC,opsz,slnt,wdth,wght].ttf")
3438
print(f"Downloading {url} to {path}")
3539
tmpfile, _ = urlretrieve(url)
3640
with ZipFile(tmpfile) as zfd:
37-
for member in zfd.namelist():
38-
if (member.startswith(DEFAULT_FONT.replace(" ", "")) and
39-
member.endswith(".ttf")):
40-
path.write_bytes(zfd.read(member))
41-
break
41+
path.write_bytes(zfd.read(member))
4242

4343

4444
def generate_font(family, size, axes):

0 commit comments

Comments
 (0)