Skip to content

Commit 88ab1dc

Browse files
committed
Changed to use self hosted fonts. Fixes issues for international uses accessing the site when google has been blocked.
1 parent f1818dd commit 88ab1dc

14 files changed

+47
-40
lines changed

fonts/cabin-v8-latin-700.woff

32.4 KB
Binary file not shown.

fonts/cabin-v8-latin-700.woff2

26.9 KB
Binary file not shown.

fonts/cabin-v8-latin-regular.woff

40.2 KB
Binary file not shown.

fonts/cabin-v8-latin-regular.woff2

33.3 KB
Binary file not shown.
15 KB
Binary file not shown.
11.8 KB
Binary file not shown.
15.3 KB
Binary file not shown.
12.1 KB
Binary file not shown.

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var staticAssets = [
2222
"./assets/**",
2323
"./php/!(cache)**",
2424
"*.ico",
25+
"fonts/**",
2526
".htaccess"
2627
];
2728

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<script src="js/regExWorker.template.js?no=<%=noCache %>"></script>
5353

5454
<link rel="stylesheet" href="css/regexr.css?no=<%=noCache %>">
55-
<script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
5655
</head>
5756
<body>
5857

js/index.template.js

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -187,42 +187,4 @@ function createRegExr() {
187187
}
188188
}
189189

190-
if (window["WebFont"] != null) {
191-
try {
192-
WebFont.load({
193-
google: {
194-
families: ["Source Code Pro:400,700", "Cabin:400,700"],
195-
fontinactive: function (family, fvd) {
196-
WebFont.load({
197-
custom: {
198-
families: ["Source Code Pro:400,700", "Cabin:400,700"]
199-
}
200-
});
201-
}
202-
},
203-
active: function () {
204-
xhr.abort();
205-
createRegExr();
206-
}
207-
});
208-
209-
// wdg:: Fix for https://github.com/gskinner/regexr/issues/111
210-
// If the cors header is non-existent WebFont will silently fail, so we manually check to see if font can be loaded.
211-
// and if not, just show the site.
212-
var xhr = window.XDomainRequest == null?new XMLHttpRequest():new XDomainRequest();
213-
xhr.onerror = function(evt) {
214-
createRegExr();
215-
};
216-
xhr.open('get', 'http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqZkF8H8ye47wsfpWywda8og.woff2');
217-
xhr.send();
218-
219-
// final fall back, if all other fall backs fail
220-
setTimeout(function() {
221-
createRegExr();
222-
}, 500);
223-
} catch (err) {
224-
createRegExr();
225-
}
226-
} else {
227-
createRegExr();
228-
}
190+
createRegExr();

js/views/DocView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ p.sourceMouseMove = function (evt) {
507507
if (rect) {
508508
rect.right = rect.left = evt.clientX;
509509
}
510+
510511
this.sourceTooltip.show(Docs.forMatch(this.hoverMatch), rect);
511512
};
512513

scss/fonts.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/****************************************************************************
2+
* File is generated from https://google-webfonts-helper.herokuapp.com/fonts *
3+
*****************************************************************************
4+
*/
5+
6+
/* cabin-regular - latin */
7+
@font-face {
8+
font-family: 'Cabin';
9+
font-style: normal;
10+
font-weight: 400;
11+
src: local('Cabin Regular'), local('Cabin-Regular'),
12+
url('../fonts/cabin-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
13+
url('../fonts/cabin-v8-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
14+
}
15+
/* cabin-700 - latin */
16+
@font-face {
17+
font-family: 'Cabin';
18+
font-style: normal;
19+
font-weight: 700;
20+
src: local('Cabin Bold'), local('Cabin-Bold'),
21+
url('../fonts/cabin-v8-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
22+
url('../fonts/cabin-v8-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
23+
}
24+
25+
/* source-code-pro-regular - latin */
26+
@font-face {
27+
font-family: 'Source Code Pro';
28+
font-style: normal;
29+
font-weight: 400;
30+
src: local('Source Code Pro'), local('SourceCodePro-Regular'),
31+
url('../fonts/source-code-pro-v6-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
32+
url('../fonts/source-code-pro-v6-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
33+
}
34+
/* source-code-pro-700 - latin */
35+
@font-face {
36+
font-family: 'Source Code Pro';
37+
font-style: normal;
38+
font-weight: 700;
39+
src: local('Source Code Pro Bold'), local('SourceCodePro-Bold'),
40+
url('../fonts/source-code-pro-v6-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
41+
url('../fonts/source-code-pro-v6-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
42+
}

scss/regexr.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
*/
24+
@import "fonts";
25+
2426
@import "compass";
2527
@import "compass/css3/transform";
2628

0 commit comments

Comments
 (0)