Add local roboto

This commit is contained in:
Paulus Schoutsen 2016-04-08 00:09:52 -07:00
parent a8d3b71f9f
commit d9232df18b
5 changed files with 158 additions and 4 deletions

View File

@ -13,6 +13,7 @@
"leaflet-map": "1.2.0",
"iron-elements": "PolymerElements/iron-elements#~1.0.9",
"paper-elements": "PolymerElements/paper-elements#~1.0.7",
"google-apis": "GoogleWebComponents/google-apis#~1.1.4"
"google-apis": "GoogleWebComponents/google-apis#~1.1.4",
"font-roboto-local": "^1.0.1"
}
}

View File

@ -11,7 +11,7 @@
"js_dev_demo": "BUILD_DEMO=1 webpack --colors --progress -d --watch",
"js_prod": "BUILD_DEV=0 webpack --colors --progress -p -d",
"js_demo": "BUILD_DEV=0 BUILD_DEMO=1 webpack --colors --progress -p -d",
"frontend_html": "vulcanize --inline-css --inline-scripts --strip-comments src/home-assistant.html > build/frontend.vulcan.html && node script/minify.js",
"frontend_html": "node script/fix-roboto.js && vulcanize --inline-css --inline-scripts --strip-comments src/home-assistant.html > build/frontend.vulcan.html && node script/minify.js",
"frontend_prod": "npm run js_prod && bower install && npm run frontend_html",
"frontend_demo": "npm run js_demo && bower install && npm run frontend_html",
"setup_js_dev": "npm install && cd node_modules && rm -rf home-assistant-js && git clone https://github.com/balloob/home-assistant-js.git && cd home-assistant-js && npm install",

9
script/fix-roboto.js Executable file
View File

@ -0,0 +1,9 @@
var fs = require('fs');
var path = 'bower_components/paper-styles/typography.html';
var html = fs.readFileSync(path).toString();
var fixedHtml = html.replace('<link rel="import" href="../font-roboto/roboto.html">', '');
fs.writeFileSync(path, fixedHtml);

View File

@ -1,10 +1,11 @@
<link rel='import' href='../bower_components/polymer/polymer.html'>
<link rel='import' href='../bower_components/iron-flex-layout/iron-flex-layout-classes.html'>
<link rel='import' href='./util/roboto.html'>
<link rel='import' href='../bower_components/paper-styles/typography.html'>
<link rel="import" href="../bower_components/iron-iconset-svg/iron-iconset-svg.html">
<link rel='import' href='layouts/login-form.html'>
<link rel='import' href='layouts/home-assistant-main.html'>
<link rel='import' href='./layouts/login-form.html'>
<link rel='import' href='./layouts/home-assistant-main.html'>
<link rel='import' href='resources/home-assistant-style.html'>

143
src/util/roboto.html Normal file
View File

@ -0,0 +1,143 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<style>
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Thin.ttf) format("truetype");
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-ThinItalic.ttf) format("truetype");
font-weight: 100;
font-style: italic;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Light.ttf) format("truetype");
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-LightItalic.ttf) format("truetype");
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Regular.ttf) format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Italic.ttf) format("truetype");
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Medium.ttf) format("truetype");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-MediumItalic.ttf) format("truetype");
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Bold.ttf) format("truetype");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-BoldItalic.ttf) format("truetype");
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-Black.ttf) format("truetype");
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: "Roboto";
src: url(/static/fonts/roboto/Roboto-BlackItalic.ttf) format("truetype");
font-weight: 900;
font-style: italic;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Thin.ttf) format("truetype");
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-ThinItalic.ttf) format("truetype");
font-weight: 100;
font-style: italic;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Light.ttf) format("truetype");
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-LightItalic.ttf) format("truetype");
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Regular.ttf) format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Italic.ttf) format("truetype");
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Medium.ttf) format("truetype");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-MediumItalic.ttf) format("truetype");
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-Bold.ttf) format("truetype");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Roboto Mono";
src: url(/static/fonts/robotomono/RobotoMono-BoldItalic.ttf) format("truetype");
font-weight: 700;
font-style: italic;
}
</style>