diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index ea65b3905272e..14c7880a985e8 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -129,7 +129,14 @@ pub fn render( suffix = page.resource_suffix ) } else { - String::new() + // No CSS extension means there's probably no font overrides, so + // we add a preloading hint for fonts we always load remotely. + format!( + "\ + ", + font_attrs = "rel='preload' type='font/woff' as='font'", + static_root_path = static_root_path + ) }, content = Buffer::html().to_display(t), static_root_path = static_root_path,