about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-20 12:58:26 +0100
committerGitHub <noreply@github.com>2019-11-20 12:58:26 +0100
commit423137b7794710d61a44252d838fef5b837dfd88 (patch)
treee05f4bd00b43b4d880c9125de06f0da11819ac42 /src/librustdoc
parentf50d6ea348c2dd7c2f76e35ecde6560d87bb98ec (diff)
parentea9519bf16f0be137a814a49c9fbaf232ba49a43 (diff)
downloadrust-423137b7794710d61a44252d838fef5b837dfd88.tar.gz
rust-423137b7794710d61a44252d838fef5b837dfd88.zip
Rollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Update Source Code Pro and include italics

Fixes #65502.

A few notes:
  * As stated in #65502, this does increase the download size.
  * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged.
  * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files ([Source Code Pro otf renders poorly on older Windows system apps](https://github.com/adobe-fonts/source-code-pro/issues/25#issuecomment-9019600)).
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/html/render.rs6
-rw-r--r--src/librustdoc/html/static/COPYRIGHT.txt3
-rw-r--r--src/librustdoc/html/static/SourceCodePro-It.ttf.woffbin0 -> 84264 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Regular.ttf.woffbin0 -> 95872 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Regular.woffbin55472 -> 0 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woffbin0 -> 95576 bytes
-rw-r--r--src/librustdoc/html/static/SourceCodePro-Semibold.woffbin55360 -> 0 bytes
-rw-r--r--src/librustdoc/html/static/rustdoc.css10
-rw-r--r--src/librustdoc/html/static_files.rs12
9 files changed, 22 insertions, 9 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 1207c5e3bc5..2fa56f58512 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -697,10 +697,12 @@ themePicker.onblur = handleThemeButtonsBlur;
           static_files::source_serif_pro::ITALIC)?;
     write(cx.dst.join("SourceSerifPro-LICENSE.md"),
           static_files::source_serif_pro::LICENSE)?;
-    write(cx.dst.join("SourceCodePro-Regular.woff"),
+    write(cx.dst.join("SourceCodePro-Regular.ttf.woff"),
           static_files::source_code_pro::REGULAR)?;
-    write(cx.dst.join("SourceCodePro-Semibold.woff"),
+    write(cx.dst.join("SourceCodePro-Semibold.ttf.woff"),
           static_files::source_code_pro::SEMIBOLD)?;
+    write(cx.dst.join("SourceCodePro-It.ttf.woff"),
+          static_files::source_code_pro::ITALIC)?;
     write(cx.dst.join("SourceCodePro-LICENSE.txt"),
           static_files::source_code_pro::LICENSE)?;
     write(cx.dst.join("LICENSE-MIT.txt"),
diff --git a/src/librustdoc/html/static/COPYRIGHT.txt b/src/librustdoc/html/static/COPYRIGHT.txt
index af77776cca4..24bdca6544d 100644
--- a/src/librustdoc/html/static/COPYRIGHT.txt
+++ b/src/librustdoc/html/static/COPYRIGHT.txt
@@ -23,7 +23,8 @@ included, and carry their own copyright notices and license terms:
     Copyright (c) Nicolas Gallagher and Jonathan Neal.
     Licensed under the MIT license (see LICENSE-MIT.txt).
 
-* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
+* Source Code Pro (SourceCodePro-Regular.ttf.woff,
+    SourceCodePro-Semibold.ttf.woff, SourceCodePro-It.ttf.woff):
 
     Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
     with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
diff --git a/src/librustdoc/html/static/SourceCodePro-It.ttf.woff b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff
new file mode 100644
index 00000000000..ebaaf91de06
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-It.ttf.woff
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff
new file mode 100644
index 00000000000..117c7e5142c
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Regular.ttf.woff
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Regular.woff b/src/librustdoc/html/static/SourceCodePro-Regular.woff
deleted file mode 100644
index 5576670903a..00000000000
--- a/src/librustdoc/html/static/SourceCodePro-Regular.woff
+++ /dev/null
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff
new file mode 100644
index 00000000000..270873a86a0
--- /dev/null
+++ b/src/librustdoc/html/static/SourceCodePro-Semibold.ttf.woff
Binary files differdiff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.woff b/src/librustdoc/html/static/SourceCodePro-Semibold.woff
deleted file mode 100644
index ca972a11dc4..00000000000
--- a/src/librustdoc/html/static/SourceCodePro-Semibold.woff
+++ /dev/null
Binary files differdiff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 64c858238db..6d2f6c7eda6 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -39,13 +39,19 @@
 	font-weight: 400;
 	/* Avoid using locally installed font because bad versions are in circulation:
 	 * see https://github.com/rust-lang/rust/issues/24355 */
-	src: url("SourceCodePro-Regular.woff") format('woff');
+	src: url("SourceCodePro-Regular.ttf.woff") format('woff');
+}
+@font-face {
+	font-family: 'Source Code Pro';
+	font-style: italic;
+	font-weight: 400;
+	src: url("SourceCodePro-It.ttf.woff") format('woff');
 }
 @font-face {
 	font-family: 'Source Code Pro';
 	font-style: normal;
 	font-weight: 600;
-	src: url("SourceCodePro-Semibold.woff") format('woff');
+	src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
 }
 
 * {
diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs
index 9fc1d76185f..34055f386fb 100644
--- a/src/librustdoc/html/static_files.rs
+++ b/src/librustdoc/html/static_files.rs
@@ -96,11 +96,15 @@ pub mod source_serif_pro {
 
 /// Files related to the Source Code Pro font.
 pub mod source_code_pro {
-    /// The file `SourceCodePro-Regular.woff`, the Regular variant of the Source Code Pro font.
-    pub static REGULAR: &'static [u8] = include_bytes!("static/SourceCodePro-Regular.woff");
+    /// The file `SourceCodePro-Regular.ttf.woff`, the Regular variant of the Source Code Pro font.
+    pub static REGULAR: &'static [u8] = include_bytes!("static/SourceCodePro-Regular.ttf.woff");
 
-    /// The file `SourceCodePro-Semibold.woff`, the Semibold variant of the Source Code Pro font.
-    pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.woff");
+    /// The file `SourceCodePro-Semibold.ttf.woff`, the Semibold variant of the Source Code Pro
+    /// font.
+    pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.ttf.woff");
+
+    /// The file `SourceCodePro-It.ttf.woff`, the Italic variant of the Source Code Pro font.
+    pub static ITALIC: &'static [u8] = include_bytes!("static/SourceCodePro-It.ttf.woff");
 
     /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font.
     pub static LICENSE: &'static [u8] = include_bytes!("static/SourceCodePro-LICENSE.txt");