Commit 52eb6dd0 authored by tsergeant's avatar tsergeant Committed by Commit bot

Add Roboto-Medium webfont and factor out common Roboto WebUI CSS file.

The common file prevents duplication of the same @font-face definitions,
and allows additional font weights and character sets added by one
project to be automatically available for all other Roboto users.

This CL also updates the Roboto font files from Google Fonts and removes
the .woff file, since Chrome has complete support for woff2.

BUG=439114
TEST=Locally tested chrome://md-settings, chrome://proximity-auth and a
  PDF file on desktop, and chrome://contextual-search-promo/promo.html
  on Android.

Review URL: https://codereview.chromium.org/1142893002

Cr-Commit-Position: refs/heads/master@{#330689}
parent 3e898930
...@@ -2,15 +2,6 @@ ...@@ -2,15 +2,6 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. */ found in the LICENSE file. */
/* TODO: Need to clean up @font-face after we remove font-family from body. */
@font-face {
font-family: 'Roboto2';
font-weight: 400;
src: local('Roboto'), local('Roboto2-Regular'),
url(chrome://resources/roboto/roboto.woff2) format('woff2'),
url(chrome://resources/roboto/roboto.woff) format('woff');
}
/* TODO(pedrosimonetti): Find a better way to fix the problem when the /* TODO(pedrosimonetti): Find a better way to fix the problem when the
* text scaling preference is set to a high value. * text scaling preference is set to a high value.
* *
...@@ -26,7 +17,7 @@ ...@@ -26,7 +17,7 @@
} }
body { body {
font-family: 'Roboto2', sans-serif; font-family: 'Roboto', sans-serif;
margin: 0; margin: 0;
} }
...@@ -94,13 +85,13 @@ a.colored-link { ...@@ -94,13 +85,13 @@ a.colored-link {
/* Landscape */ /* Landscape */
@media screen and (orientation:landscape) { @media screen and (orientation:landscape) {
#heading { #heading {
margin-top: 0;
/* The heading text and description text should be aligned, therefore /* The heading text and description text should be aligned, therefore
* the left margin here will be equal to the header image width (156px) * the left margin here will be equal to the header image width (156px)
* plus its right margin (24px). Therefore the total left should be * plus its right margin (24px). Therefore the total left should be
* 156px + 24px = 180px. * 156px + 24px = 180px.
*/ */
margin-left: 180px; margin-left: 180px;
margin-top: 0;
padding-top: 8px; padding-top: 8px;
text-align: left; text-align: left;
} }
...@@ -132,7 +123,7 @@ button { ...@@ -132,7 +123,7 @@ button {
background: none; background: none;
border: none; border: none;
display: inline-block; display: inline-block;
font-family: 'Roboto2', sans-serif; font-family: 'Roboto', sans-serif;
font-size: 14px; font-size: 14px;
margin: 6px 0; margin: 6px 0;
/* We use a slightly different top-bottom padding because Roboto has a /* We use a slightly different top-bottom padding because Roboto has a
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no"> <meta name="viewport" content="width=device-width, user-scalable=no">
<title>Contextual Search First-Run</title> <title>Contextual Search First-Run</title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/roboto.css">
<link rel="stylesheet" href="promo.css"> <link rel="stylesheet" href="promo.css">
<script src="chrome://contextual-search-promo/config.js"></script> <script src="chrome://contextual-search-promo/config.js"></script>
<script src="chrome://contextual-search-promo/promo.js"></script> <script src="chrome://contextual-search-promo/promo.js"></script>
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
* Use of this source code is governed by a BSD-style license that can be * Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */ * found in the LICENSE file. */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto Regular'), local('Roboto-Regular'), url(chrome://resources/roboto/roboto.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
body { body {
font-family: Roboto; font-family: Roboto;
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script src="chrome://resources/js/load_time_data.js"></script> <script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://md-settings/strings.js"></script> <script src="chrome://md-settings/strings.js"></script>
<link rel="import" href="chrome://md-settings/settings.html"> <link rel="import" href="chrome://md-settings/settings.html">
<link rel="stylesheet" href="chrome://resources/css/roboto.css">
<link rel="stylesheet" href="md_settings.css"> <link rel="stylesheet" href="md_settings.css">
</head> </head>
<body> <body>
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
* Use of this source code is governed by a BSD-style license that can be * Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */ * found in the LICENSE file. */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto Regular'), local('Roboto-Regular'), url(chrome://resources/roboto/roboto.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
body { body {
background-color: #424242; background-color: #424242;
font-family: Roboto, 'Helvetica Neue', Helvetica, Arial; font-family: Roboto, 'Helvetica Neue', Helvetica, Arial;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<link rel="import" href="elements/viewer-zoom-toolbar/viewer-zoom-toolbar.html"> <link rel="import" href="elements/viewer-zoom-toolbar/viewer-zoom-toolbar.html">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/roboto.css">
<link rel="stylesheet" type="text/css" href="index-material.css"> <link rel="stylesheet" type="text/css" href="index-material.css">
</head> </head>
<body> <body>
......
...@@ -3,21 +3,13 @@ ...@@ -3,21 +3,13 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
@font-face {
font-family: "Roboto2";
font-weight: 400;
src: local("Roboto"), local("Roboto2-Regular"),
url(chrome://resources/roboto/roboto.woff2) format("woff2"),
url(chrome://resources/roboto/roboto.woff) format("woff");
}
html, body { html, body {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
font-family: "Roboto2", sans-serif; font-family: "Roboto", sans-serif;
} }
#logs { #logs {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1"> content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="proximity_auth.css"> <link rel="stylesheet" href="proximity_auth.css">
<link rel="stylesheet" href="chrome://resources/css/roboto.css">
<link rel="import" href="content-panel.html"> <link rel="import" href="content-panel.html">
<link rel="import" href="log-panel.html"> <link rel="import" href="log-panel.html">
</head> </head>
......
/* Copyright 2015 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'),
url(chrome://resources/roboto/roboto-regular-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC,
U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'),
url(chrome://resources/roboto/roboto-medium-latin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC,
U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
...@@ -18,8 +18,8 @@ without changes to the corresponding grd file. --> ...@@ -18,8 +18,8 @@ without changes to the corresponding grd file. -->
<include name="IDR_WEBUI_JSTEMPLATE_JS" file="js/jstemplate_compiled.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_WEBUI_JSTEMPLATE_JS" file="js/jstemplate_compiled.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_WEBUI_ANALYTICS_JS" file="js/analytics.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_WEBUI_ANALYTICS_JS" file="js/analytics.js" flattenhtml="true" type="BINDATA" />
<!-- Roboto Font --> <!-- Roboto Font -->
<include name="IDR_WEBUI_ROBOTO_ROBOTO_WOFF" file="roboto/roboto.woff" type="BINDATA" /> <include name="IDR_WEBUI_ROBOTO_ROBOTO_REGULAR_LATIN_WOFF2" file="roboto/roboto-regular-latin.woff2" type="BINDATA" />
<include name="IDR_WEBUI_ROBOTO_ROBOTO_WOFF2" file="roboto/roboto.woff2" type="BINDATA" /> <include name="IDR_WEBUI_ROBOTO_ROBOTO_MEDIUM_LATIN_WOFF2" file="roboto/roboto-medium-latin.woff2" type="BINDATA" />
<!-- Component apps common image resources - 1x --> <!-- Component apps common image resources - 1x -->
<!-- White button --> <!-- White button -->
...@@ -238,6 +238,8 @@ without changes to the corresponding grd file. --> ...@@ -238,6 +238,8 @@ without changes to the corresponding grd file. -->
<structure name="IDR_WEBUI_CSS_OVERLAY" <structure name="IDR_WEBUI_CSS_OVERLAY"
file="css/overlay.css" type="chrome_html" file="css/overlay.css" type="chrome_html"
flattenhtml="true" /> flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_ROBOTO"
file="css/roboto.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_SPINNER" <structure name="IDR_WEBUI_CSS_SPINNER"
file="css/spinner.css" type="chrome_html" /> file="css/spinner.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_TABLE" <structure name="IDR_WEBUI_CSS_TABLE"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment