Skip to content

Commit 3b0b7b6

Browse files
committed
webfonts: serve Source Code Pro locally
So that we have freestanding docs.
1 parent 4d5f4ff commit 3b0b7b6

File tree

7 files changed

+22
-4
lines changed

7 files changed

+22
-4
lines changed

src/doc/favicon.inc

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
2-
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400'
3-
rel='stylesheet' type='text/css'>

src/doc/rust.css

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
font-weight: 700;
4141
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
4242
}
43+
@font-face {
44+
font-family: 'Source Code Pro';
45+
font-style: normal;
46+
font-weight: 400;
47+
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
48+
}
4349

4450
*:not(body) {
4551
-webkit-box-sizing: border-box;

src/librustdoc/html/layout.rs

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ r##"<!DOCTYPE html>
4242
4343
<title>{title}</title>
4444
45-
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600'
46-
rel='stylesheet' type='text/css'>
4745
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
4846
4947
{favicon}

src/librustdoc/html/render.rs

+4
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ fn write_shared(cx: &Context,
484484
include_bin!("static/Heuristica-Italic.woff")));
485485
try!(write(cx.dst.join("SourceSerifPro-Bold.woff"),
486486
include_bin!("static/SourceSerifPro-Bold.woff")));
487+
try!(write(cx.dst.join("SourceCodePro-Regular.woff"),
488+
include_bin!("static/SourceCodePro-Regular.woff")));
489+
try!(write(cx.dst.join("SourceCodePro-Semibold.woff"),
490+
include_bin!("static/SourceCodePro-Semibold.woff")));
487491

488492
fn collect(path: &Path, krate: &str,
489493
key: &str) -> io::IoResult<Vec<String>> {
Binary file not shown.
Binary file not shown.

src/librustdoc/html/static/main.css

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
font-weight: 700;
4040
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
4141
}
42+
@font-face {
43+
font-family: 'Source Code Pro';
44+
font-style: normal;
45+
font-weight: 400;
46+
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
47+
}
48+
@font-face {
49+
font-family: 'Source Code Pro';
50+
font-style: normal;
51+
font-weight: 600;
52+
src: local('Source Code Pro Semibold'), url("SourceCodePro-Semibold.woff") format('woff');
53+
}
4254

4355
@import "normalize.css";
4456

0 commit comments

Comments
 (0)