Explorar o código

Ship Source Code Pro for monospace fonts (#3457)

* Don't load fonts from google

* Finish removing loading of fonts from googleapi

* Add TT version of Source Code Pro to theme font directory.

* Add style/fonts dir to package.json.

* Add font information to CSS files.
Brian E. Granger %!s(int64=7) %!d(string=hai) anos
pai
achega
584e755589

+ 0 - 2
buildutils/src/create-theme.ts

@@ -47,8 +47,6 @@ const plugin: JupyterLabPlugin<void> = {
     manager.register({
       name: '{{title}}',
       load: function() {
-        // Load the optional monospace font for the input/output prompt.
-        manager.loadCSS('https://fonts.googleapis.com/css?family=Roboto+Mono');
         return manager.loadCSS('{{name}}/index.css');
       },
       unload: function() {

+ 2 - 1
packages/theme-dark-extension/package.json

@@ -15,7 +15,8 @@
     "style/*.css",
     "style/images/*.*",
     "style/icons/*.*",
-    "style/icons/**/*.*"
+    "style/icons/**/*.*",
+    "style/fonts/*.*"
   ],
   "main": "lib/index.js",
   "types": "lib/index.d.ts",

+ 0 - 2
packages/theme-dark-extension/src/index.ts

@@ -20,8 +20,6 @@ const plugin: JupyterLabPlugin<void> = {
     manager.register({
       name: 'JupyterLab Dark',
       load: function() {
-        // Load the optional monospace font for the input/output prompt.
-        manager.loadCSS('https://fonts.googleapis.com/css?family=Roboto+Mono');
         return manager.loadCSS('@jupyterlab/theme-dark-extension/index.css');
       },
       unload: function() {

+ 20 - 0
packages/theme-dark-extension/style/fonts.css

@@ -0,0 +1,20 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+
+@font-face {
+    font-family: 'Source Code Pro';
+    src: url('fonts/SourceCodePro-Regular.ttf') format('truetype');
+    font-weight: 400;
+    font-style: normal;
+}
+
+
+@font-face {
+    font-family: 'Source Code Pro';
+    src: url('fonts/SourceCodePro-Bold.ttf') format('truetype');
+    font-weight: 700;
+    font-style: normal;
+}

BIN=BIN
packages/theme-dark-extension/style/fonts/SourceCodePro-Bold.ttf


BIN=BIN
packages/theme-dark-extension/style/fonts/SourceCodePro-Regular.ttf


+ 1 - 0
packages/theme-dark-extension/style/index.css

@@ -3,6 +3,7 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
+@import './fonts.css';
 @import './variables.css';
 @import './urls.css';
 

+ 2 - 1
packages/theme-light-extension/package.json

@@ -15,7 +15,8 @@
     "style/*.css",
     "style/images/*.*",
     "style/icons/*.*",
-    "style/icons/**/*.*"
+    "style/icons/**/*.*",
+    "style/fonts/*.*"
   ],
   "main": "lib/index.js",
   "types": "lib/index.d.ts",

+ 0 - 2
packages/theme-light-extension/src/index.ts

@@ -20,8 +20,6 @@ const plugin: JupyterLabPlugin<void> = {
     manager.register({
       name: 'JupyterLab Light',
       load: function() {
-        // Load the optional monospace font for the input/output prompt.
-        manager.loadCSS('https://fonts.googleapis.com/css?family=Roboto|Source+Code+Pro');
         return manager.loadCSS('@jupyterlab/theme-light-extension/index.css');
       },
       unload: function() {

+ 20 - 0
packages/theme-light-extension/style/fonts.css

@@ -0,0 +1,20 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+
+@font-face {
+    font-family: 'Source Code Pro';
+    src: url('fonts/SourceCodePro-Regular.ttf') format('truetype');
+    font-weight: 400;
+    font-style: normal;
+}
+
+
+@font-face {
+    font-family: 'Source Code Pro';
+    src: url('fonts/SourceCodePro-Bold.ttf') format('truetype');
+    font-weight: 700;
+    font-style: normal;
+}

BIN=BIN
packages/theme-light-extension/style/fonts/SourceCodePro-Bold.ttf


BIN=BIN
packages/theme-light-extension/style/fonts/SourceCodePro-Regular.ttf


+ 1 - 0
packages/theme-light-extension/style/index.css

@@ -3,6 +3,7 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
+@import './fonts.css';
 @import './variables.css';
 @import './urls.css';