diff --git a/fonts/cabin-v8-latin-700.woff b/fonts/cabin-v8-latin-700.woff new file mode 100644 index 00000000..4372889b Binary files /dev/null and b/fonts/cabin-v8-latin-700.woff differ diff --git a/fonts/cabin-v8-latin-700.woff2 b/fonts/cabin-v8-latin-700.woff2 new file mode 100644 index 00000000..4602e27b Binary files /dev/null and b/fonts/cabin-v8-latin-700.woff2 differ diff --git a/fonts/cabin-v8-latin-regular.woff b/fonts/cabin-v8-latin-regular.woff new file mode 100644 index 00000000..b800e2ee Binary files /dev/null and b/fonts/cabin-v8-latin-regular.woff differ diff --git a/fonts/cabin-v8-latin-regular.woff2 b/fonts/cabin-v8-latin-regular.woff2 new file mode 100644 index 00000000..9b73f8a7 Binary files /dev/null and b/fonts/cabin-v8-latin-regular.woff2 differ diff --git a/fonts/source-code-pro-v6-latin-700.woff b/fonts/source-code-pro-v6-latin-700.woff new file mode 100644 index 00000000..6ac8a3b2 Binary files /dev/null and b/fonts/source-code-pro-v6-latin-700.woff differ diff --git a/fonts/source-code-pro-v6-latin-700.woff2 b/fonts/source-code-pro-v6-latin-700.woff2 new file mode 100644 index 00000000..735636b2 Binary files /dev/null and b/fonts/source-code-pro-v6-latin-700.woff2 differ diff --git a/fonts/source-code-pro-v6-latin-regular.woff b/fonts/source-code-pro-v6-latin-regular.woff new file mode 100644 index 00000000..7daeecc8 Binary files /dev/null and b/fonts/source-code-pro-v6-latin-regular.woff differ diff --git a/fonts/source-code-pro-v6-latin-regular.woff2 b/fonts/source-code-pro-v6-latin-regular.woff2 new file mode 100644 index 00000000..ea28ed1c Binary files /dev/null and b/fonts/source-code-pro-v6-latin-regular.woff2 differ diff --git a/gulpfile.js b/gulpfile.js index 7c1750b6..f7dd0998 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,6 +22,7 @@ var staticAssets = [ "./assets/**", "./php/!(cache)**", "*.ico", + "fonts/**", ".htaccess" ]; diff --git a/index.html b/index.html index 01c1c27d..be7b8fe0 100644 --- a/index.html +++ b/index.html @@ -52,7 +52,6 @@ - diff --git a/js/index.template.js b/js/index.template.js index 1d904080..fa5ec642 100644 --- a/js/index.template.js +++ b/js/index.template.js @@ -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(); diff --git a/js/views/DocView.js b/js/views/DocView.js index 7036f405..92746c79 100644 --- a/js/views/DocView.js +++ b/js/views/DocView.js @@ -507,6 +507,7 @@ p.sourceMouseMove = function (evt) { if (rect) { rect.right = rect.left = evt.clientX; } + this.sourceTooltip.show(Docs.forMatch(this.hoverMatch), rect); }; diff --git a/scss/fonts.scss b/scss/fonts.scss new file mode 100644 index 00000000..c2d88cfc --- /dev/null +++ b/scss/fonts.scss @@ -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+ */ +} \ No newline at end of file diff --git a/scss/regexr.scss b/scss/regexr.scss index 587c330d..4f067204 100644 --- a/scss/regexr.scss +++ b/scss/regexr.scss @@ -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";