Write font files as binary instead of text (#3039)
This caused the font files to be corrupt and rejected by the browser's sanitising engine.
This commit is contained in:
parent
e77c2e3e10
commit
888658dbff
22 changed files with 2 additions and 2 deletions
|
@ -100,9 +100,9 @@ for line in original_contents:
|
|||
font_family, font_lang, font_style, font_weight
|
||||
)
|
||||
font_filepath = font_output_dir + filename
|
||||
with open(font_filepath, "w") as f:
|
||||
with open(font_filepath, "wb") as f:
|
||||
print("Writing font file:", font_filepath)
|
||||
f.write(resp.text)
|
||||
f.write(resp.content)
|
||||
|
||||
# Replace google URL with local URL
|
||||
line = re.sub(r"url\(.+\)", f"url({css_font_path + filename})", line)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue