Skip to content

Commit e7ab2f6

Browse files
committed
Self-host "Roboto" font assets
This change ends the project's reliance on Google Fonts as a remote font asset host. Roboto is released under the SIL Open Font License, Version 1.1: https://github.com/googlefonts/roboto-3-classic/?tab=OFL-1.1-1-ov-file The initial TTF font files were downloaded from GitHub: https://github.com/googlefonts/roboto-3-classic/releases/tag/v3.010 Then I ran `ftcli converter ft2wf --flavor woff2` on the files from the `web` directory to generate `woff2` files: https://ftcli.github.io/FoundryTools-CLI/commands/ftcli_converter.html
1 parent a59e8e5 commit e7ab2f6

File tree

7 files changed

+35
-4
lines changed

7 files changed

+35
-4
lines changed

djangoproject/scss/_utils.scss

+35
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,41 @@ $logo-bg-dark: #272c27;
4545

4646
// @font-face declarations
4747

48+
@font-face {
49+
font-family: 'Roboto';
50+
src: url('#{$font-path}/Roboto-Regular.woff2') format('woff2');
51+
font-weight: 400;
52+
font-style: normal;
53+
}
54+
55+
@font-face {
56+
font-family: 'Roboto';
57+
src: url('#{$font-path}/Roboto-Italic.woff2') format('woff2');
58+
font-weight: 400;
59+
font-style: italic;
60+
}
61+
62+
@font-face {
63+
font-family: 'Roboto';
64+
src: url('#{$font-path}/Roboto-Bold.woff2') format('woff2');
65+
font-weight: 700;
66+
font-style: normal;
67+
}
68+
69+
@font-face {
70+
font-family: 'Roboto';
71+
src: url('#{$font-path}/Roboto-BoldItalic.woff2') format('woff2');
72+
font-weight: 700;
73+
font-style: italic;
74+
}
75+
76+
@font-face {
77+
font-family: 'Roboto';
78+
src: url('#{$font-path}/Roboto-Light.woff2') format('woff2');
79+
font-weight: 300;
80+
font-style: normal;
81+
}
82+
4883
@font-face {
4984
font-family: 'Fira Mono';
5085
src: url('#{$font-path}/FiraMono-Regular.woff2') format('woff2');
67.6 KB
Binary file not shown.
Binary file not shown.
71.7 KB
Binary file not shown.
66 KB
Binary file not shown.
65.8 KB
Binary file not shown.

djangoproject/templates/base.html

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939

4040
<title>{% block title %}The web framework for perfectionists with deadlines{% endblock %} | Django</title>
4141

42-
<link rel="preconnect" href="https://fonts.googleapis.com">
43-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
44-
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
45-
4642
<link rel="stylesheet" href="{% static "css/output.css" %}" >
4743

4844
<script src="{% static "js/mod/switch-dark-mode.js" %}"></script>

0 commit comments

Comments
 (0)