Skip to content

Commit b65938c

Browse files
authored
Remove Google fonts in Swagger UI (#4112)
1 parent 1ba7721 commit b65938c

21 files changed

+163
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.6.4
4+
5+
* Swagger UI: Remove Google fonts (#4112)
6+
37
## 2.6.3
48

59
* Identifiers: Re-allow `POST` operations even if no identifier is defined (#4052)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* open-sans-cyrillic-ext-400-normal*/
2+
@font-face {
3+
font-family: 'Open Sans';
4+
font-style: normal;
5+
font-display: swap;
6+
font-weight: 400;
7+
src: url('./files/open-sans-cyrillic-ext-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
8+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
9+
}
10+
/* open-sans-cyrillic-400-normal*/
11+
@font-face {
12+
font-family: 'Open Sans';
13+
font-style: normal;
14+
font-display: swap;
15+
font-weight: 400;
16+
src: url('./files/open-sans-cyrillic-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
17+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
18+
}
19+
/* open-sans-greek-ext-400-normal*/
20+
@font-face {
21+
font-family: 'Open Sans';
22+
font-style: normal;
23+
font-display: swap;
24+
font-weight: 400;
25+
src: url('./files/open-sans-greek-ext-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
26+
unicode-range: U+1F00-1FFF;
27+
}
28+
/* open-sans-greek-400-normal*/
29+
@font-face {
30+
font-family: 'Open Sans';
31+
font-style: normal;
32+
font-display: swap;
33+
font-weight: 400;
34+
src: url('./files/open-sans-greek-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
35+
unicode-range: U+0370-03FF;
36+
}
37+
/* open-sans-vietnamese-400-normal*/
38+
@font-face {
39+
font-family: 'Open Sans';
40+
font-style: normal;
41+
font-display: swap;
42+
font-weight: 400;
43+
src: url('./files/open-sans-vietnamese-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
44+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
45+
}
46+
/* open-sans-latin-ext-400-normal*/
47+
@font-face {
48+
font-family: 'Open Sans';
49+
font-style: normal;
50+
font-display: swap;
51+
font-weight: 400;
52+
src: url('./files/open-sans-latin-ext-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
53+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
54+
}
55+
/* open-sans-latin-400-normal*/
56+
@font-face {
57+
font-family: 'Open Sans';
58+
font-style: normal;
59+
font-display: swap;
60+
font-weight: 400;
61+
src: url('./files/open-sans-latin-400-normal.woff2') format('woff2'), url('./files/open-sans-all-400-normal.woff') format('woff');
62+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
63+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* open-sans-cyrillic-ext-700-normal*/
2+
@font-face {
3+
font-family: 'Open Sans';
4+
font-style: normal;
5+
font-display: swap;
6+
font-weight: 700;
7+
src: url('./files/open-sans-cyrillic-ext-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
8+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
9+
}
10+
/* open-sans-cyrillic-700-normal*/
11+
@font-face {
12+
font-family: 'Open Sans';
13+
font-style: normal;
14+
font-display: swap;
15+
font-weight: 700;
16+
src: url('./files/open-sans-cyrillic-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
17+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
18+
}
19+
/* open-sans-greek-ext-700-normal*/
20+
@font-face {
21+
font-family: 'Open Sans';
22+
font-style: normal;
23+
font-display: swap;
24+
font-weight: 700;
25+
src: url('./files/open-sans-greek-ext-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
26+
unicode-range: U+1F00-1FFF;
27+
}
28+
/* open-sans-greek-700-normal*/
29+
@font-face {
30+
font-family: 'Open Sans';
31+
font-style: normal;
32+
font-display: swap;
33+
font-weight: 700;
34+
src: url('./files/open-sans-greek-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
35+
unicode-range: U+0370-03FF;
36+
}
37+
/* open-sans-vietnamese-700-normal*/
38+
@font-face {
39+
font-family: 'Open Sans';
40+
font-style: normal;
41+
font-display: swap;
42+
font-weight: 700;
43+
src: url('./files/open-sans-vietnamese-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
44+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
45+
}
46+
/* open-sans-latin-ext-700-normal*/
47+
@font-face {
48+
font-family: 'Open Sans';
49+
font-style: normal;
50+
font-display: swap;
51+
font-weight: 700;
52+
src: url('./files/open-sans-latin-ext-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
53+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
54+
}
55+
/* open-sans-latin-700-normal*/
56+
@font-face {
57+
font-family: 'Open Sans';
58+
font-style: normal;
59+
font-display: swap;
60+
font-weight: 700;
61+
src: url('./files/open-sans-latin-700-normal.woff2') format('woff2'), url('./files/open-sans-all-700-normal.woff') format('woff');
62+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
63+
}

src/Bridge/Symfony/Bundle/Resources/public/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ header #logo img {
308308
outline: none;
309309
}
310310

311-
/** REMOVE TITILIUM FONT **/
311+
/** USE OPEN SANS FONT **/
312312

313313
.swagger-ui .opblock-tag,
314314
.swagger-ui .opblock .opblock-section-header label,

src/Bridge/Symfony/Bundle/Resources/views/SwaggerUi/index.html.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<title>{% if title %}{{ title }} - {% endif %}API Platform</title>
66

77
{% block stylesheet %}
8-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700">
8+
<link rel="stylesheet" href="{{ asset('bundles/apiplatform/fonts/open-sans/400.css') }}">
9+
<link rel="stylesheet" href="{{ asset('bundles/apiplatform/fonts/open-sans/700.css') }}">
910
<link rel="stylesheet" href="{{ asset('bundles/apiplatform/swagger-ui/swagger-ui.css', assetPackage) }}">
1011
<link rel="stylesheet" href="{{ asset('bundles/apiplatform/style.css', assetPackage) }}">
1112
{% endblock %}

update-js.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
rm -f yarn.lock
33
# Keep the yarn.lock file in the repo to benefit from GitHub security alerts: https://github.blog/2019-07-02-yarn-support-for-security-alerts/
4-
yarn add swagger-ui-dist
5-
yarn add --production es6-promise fetch react react-dom graphiql [email protected] redoc
4+
yarn add @fontsource/open-sans swagger-ui-dist
5+
yarn add --production es6-promise fetch react react-dom graphiql [email protected] redoc
6+
7+
dest=src/Bridge/Symfony/Bundle/Resources/public/fonts/open-sans/
8+
if [[ -d "$dest" ]]; then
9+
rm -Rf "$dest"
10+
fi
11+
mkdir -p "${dest}files/"
12+
cp node_modules/@fontsource/open-sans/400.css "$dest"
13+
cp node_modules/@fontsource/open-sans/files/open-sans-cyrillic-ext-400-normal.woff2 "${dest}files/"
14+
cp node_modules/@fontsource/open-sans/files/open-sans-cyrillic-400-normal.woff2 "${dest}files/"
15+
cp node_modules/@fontsource/open-sans/files/open-sans-greek-ext-400-normal.woff2 "${dest}files/"
16+
cp node_modules/@fontsource/open-sans/files/open-sans-greek-400-normal.woff2 "${dest}files/"
17+
cp node_modules/@fontsource/open-sans/files/open-sans-vietnamese-400-normal.woff2 "${dest}files/"
18+
cp node_modules/@fontsource/open-sans/files/open-sans-latin-ext-400-normal.woff2 "${dest}files/"
19+
cp node_modules/@fontsource/open-sans/files/open-sans-latin-400-normal.woff2 "${dest}files/"
20+
cp node_modules/@fontsource/open-sans/700.css "$dest"
21+
cp node_modules/@fontsource/open-sans/files/open-sans-cyrillic-ext-700-normal.woff2 "${dest}files/"
22+
cp node_modules/@fontsource/open-sans/files/open-sans-cyrillic-700-normal.woff2 "${dest}files/"
23+
cp node_modules/@fontsource/open-sans/files/open-sans-greek-ext-700-normal.woff2 "${dest}files/"
24+
cp node_modules/@fontsource/open-sans/files/open-sans-greek-700-normal.woff2 "${dest}files/"
25+
cp node_modules/@fontsource/open-sans/files/open-sans-vietnamese-700-normal.woff2 "${dest}files/"
26+
cp node_modules/@fontsource/open-sans/files/open-sans-latin-ext-700-normal.woff2 "${dest}files/"
27+
cp node_modules/@fontsource/open-sans/files/open-sans-latin-700-normal.woff2 "${dest}files/"
628

729
dest=src/Bridge/Symfony/Bundle/Resources/public/swagger-ui/
830
if [[ -d "$dest" ]]; then

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@
136136
resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.3.tgz#dda2fbf3dafa5ad8c63dadff7e01d3fdf4736025"
137137
integrity sha512-GoXw0U2Qaa33m3eUcxuHnHpNvHjNlLo0gtV091XBpaRINaB4X6FGCG5XKxSFNFiPpugUDqNruHzaqpTdDm4AOg==
138138

139+
"@fontsource/open-sans@^4.2.2":
140+
version "4.2.2"
141+
resolved "https://registry.yarnpkg.com/@fontsource/open-sans/-/open-sans-4.2.2.tgz#59046f772136a44c5999e0189d33c6a26676630c"
142+
integrity sha512-NbsL1a9asJO6N/5kRxYPCy0kNhKMi9T75kl4QfIGtmpd/5IfB+UIAUxd9AICmCLaH4Osc2TImeTJj94xc9MNKg==
143+
139144
"@redocly/react-dropdown-aria@^2.0.11":
140145
version "2.0.11"
141146
resolved "https://registry.yarnpkg.com/@redocly/react-dropdown-aria/-/react-dropdown-aria-2.0.11.tgz#532b864b329237e646abe45d0f8edc923e77370a"

0 commit comments

Comments
 (0)