Add Roboto and Roboto-Medium to bazel build

New design mocks have the site's fonts entirely in Roboto and Roboto
Medium. This change adds the fonts as dependncies.

Bug: Issue 7139
Change-Id: I4e8175e49dda42a68b22d4a5966aba597c84c132
This commit is contained in:
Becky Siegel 2017-09-01 16:34:08 -07:00
parent c65126d5b2
commit 792e418600
9 changed files with 16 additions and 4 deletions

View File

@ -41,6 +41,10 @@
// @see https://github.com/w3c/preload/issues/32 regarding crossorigin
<link rel="preload" href="{$staticResourcePath}/fonts/RobotoMono-Regular.woff2" as="font" type="font/woff2" crossorigin>{\n}
<link rel="preload" href="{$staticResourcePath}/fonts/RobotoMono-Regular.woff" as="font" type="font/woff" crossorigin>{\n}
<link rel="preload" href="{$staticResourcePath}/fonts/Roboto.woff2" as="font" type="font/woff2" crossorigin>{\n}
<link rel="preload" href="{$staticResourcePath}/fonts/Roboto.woff" as="font" type="font/woff" crossorigin>{\n}
<link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Medium.woff2" as="font" type="font/woff2" crossorigin>{\n}
<link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Medium.woff" as="font" type="font/woff" crossorigin>{\n}
<link rel="stylesheet" href="{$staticResourcePath}/styles/fonts.css">{\n}
<link rel="stylesheet" href="{$staticResourcePath}/styles/main.css">{\n}
<script src="{$staticResourcePath}/bower_components/webcomponentsjs/webcomponents-lite.js"></script>{\n}

View File

@ -3,8 +3,12 @@ load("//tools/bzl:genrule2.bzl", "genrule2")
# Roboto Mono. Version 2.136
# https://github.com/google/roboto/releases/tag/v2.136
filegroup(
name = "robotomono",
name = "robotofonts",
srcs = [
"Roboto.woff",
"Roboto.woff2",
"Roboto-Medium.woff",
"Roboto-Medium.woff2",
"RobotoMono-Regular.woff",
"RobotoMono-Regular.woff2",
],

Binary file not shown.

Binary file not shown.

BIN
lib/fonts/Roboto.woff Normal file

Binary file not shown.

BIN
lib/fonts/Roboto.woff2 Normal file

Binary file not shown.

View File

@ -29,7 +29,7 @@ bower_component_bundle(
genrule2(
name = "fonts",
srcs = [
"//lib/fonts:robotomono",
"//lib/fonts:robotofonts",
],
outs = ["fonts.zip"],
cmd = " && ".join([

View File

@ -26,6 +26,10 @@ RobotoMono fonts are used in styles/fonts.css
-->
<link rel="preload" href="/fonts/RobotoMono-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/RobotoMono-Regular.woff" as="font" type="font/woff" crossorigin>
<link rel="preload" href="/fonts/Roboto.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Roboto.woff" as="font" type="font/woff" crossorigin>
<link rel="preload" href="/fonts/Roboto-Medium.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Roboto-Medium.woff" as="font" type="font/woff" crossorigin>
<link rel="stylesheet" href="/styles/fonts.css">
<link rel="stylesheet" href="/styles/main.css">
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>

View File

@ -72,7 +72,7 @@ def polygerrit_bundle(name, srcs, outs, app):
name + "_app_sources",
name + "_css_sources",
name + "_top_sources",
"//lib/fonts:robotomono",
"//lib/fonts:robotofonts",
"//lib/js:highlightjs_files",
# we extract from the zip, but depend on the component for license checking.
"@webcomponentsjs//:zipfile",
@ -82,7 +82,7 @@ def polygerrit_bundle(name, srcs, outs, app):
cmd = " && ".join([
"mkdir -p $$TMP/polygerrit_ui/{styles,fonts,bower_components/{highlightjs,webcomponentsjs},elements}",
"for f in $(locations " + name + "_app_sources); do ext=$${f##*.}; cp -p $$f $$TMP/polygerrit_ui/elements/" + appName + ".$$ext; done",
"cp $(locations //lib/fonts:robotomono) $$TMP/polygerrit_ui/fonts/",
"cp $(locations //lib/fonts:robotofonts) $$TMP/polygerrit_ui/fonts/",
"for f in $(locations " + name + "_top_sources); do cp $$f $$TMP/polygerrit_ui/; done",
"for f in $(locations "+ name + "_css_sources); do cp $$f $$TMP/polygerrit_ui/styles; done",
"for f in $(locations //lib/js:highlightjs_files); do cp $$f $$TMP/polygerrit_ui/bower_components/highlightjs/ ; done",