Permalink
Browse files

Changed to use self hosted fonts. Fixes issues for international uses…

… accessing the site when google has been blocked.
1 parent f1818dd commit 88ab1dca977e89d7ffb5b670d8d19a342c49b0ee @wdamien wdamien committed Jul 29, 2016
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.
View
@@ -22,6 +22,7 @@ var staticAssets = [
"./assets/**",
"./php/!(cache)**",
"*.ico",
+ "fonts/**",
".htaccess"
];
View
@@ -52,7 +52,6 @@
<script src="js/regExWorker.template.js?no=<%=noCache %>"></script>
<link rel="stylesheet" href="css/regexr.css?no=<%=noCache %>">
- <script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
</head>
<body>
View
@@ -187,42 +187,4 @@ function createRegExr() {
}
}
-if (window["WebFont"] != null) {
- try {
- WebFont.load({
- google: {
- families: ["Source Code Pro:400,700", "Cabin:400,700"],
- fontinactive: function (family, fvd) {
- WebFont.load({
- custom: {
- families: ["Source Code Pro:400,700", "Cabin:400,700"]
- }
- });
- }
- },
- active: function () {
- xhr.abort();
- createRegExr();
- }
- });
-
- // wdg:: Fix for https://github.com/gskinner/regexr/issues/111
- // If the cors header is non-existent WebFont will silently fail, so we manually check to see if font can be loaded.
- // and if not, just show the site.
- var xhr = window.XDomainRequest == null?new XMLHttpRequest():new XDomainRequest();
- xhr.onerror = function(evt) {
- createRegExr();
- };
- xhr.open('get', 'http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqZkF8H8ye47wsfpWywda8og.woff2');
- xhr.send();
-
- // final fall back, if all other fall backs fail
- setTimeout(function() {
- createRegExr();
- }, 500);
- } catch (err) {
- createRegExr();
- }
-} else {
- createRegExr();
-}
+createRegExr();
View
@@ -507,6 +507,7 @@ p.sourceMouseMove = function (evt) {
if (rect) {
rect.right = rect.left = evt.clientX;
}
+
this.sourceTooltip.show(Docs.forMatch(this.hoverMatch), rect);
};
View
@@ -0,0 +1,42 @@
+/****************************************************************************
+* File is generated from https://google-webfonts-helper.herokuapp.com/fonts *
+*****************************************************************************
+*/
+
+/* cabin-regular - latin */
+@font-face {
+ font-family: 'Cabin';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Cabin Regular'), local('Cabin-Regular'),
+ url('../fonts/cabin-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('../fonts/cabin-v8-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+/* cabin-700 - latin */
+@font-face {
+ font-family: 'Cabin';
+ font-style: normal;
+ font-weight: 700;
+ src: local('Cabin Bold'), local('Cabin-Bold'),
+ url('../fonts/cabin-v8-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('../fonts/cabin-v8-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+
+/* source-code-pro-regular - latin */
+@font-face {
+ font-family: 'Source Code Pro';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Source Code Pro'), local('SourceCodePro-Regular'),
+ url('../fonts/source-code-pro-v6-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('../fonts/source-code-pro-v6-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
+/* source-code-pro-700 - latin */
+@font-face {
+ font-family: 'Source Code Pro';
+ font-style: normal;
+ font-weight: 700;
+ src: local('Source Code Pro Bold'), local('SourceCodePro-Bold'),
+ url('../fonts/source-code-pro-v6-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
+ url('../fonts/source-code-pro-v6-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+}
View
@@ -21,6 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
+@import "fonts";
+
@import "compass";
@import "compass/css3/transform";

0 comments on commit 88ab1dc

Please sign in to comment.