Skip to content

Commit

Permalink
WIP: enable fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
saharj committed Mar 22, 2016
1 parent 81cec59 commit 7de07d8
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 106 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

// App CSS files
require('font-awesome-webpack');
require('./styles/main.less');

// App JavaScript files
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"font-awesome": "^4.5.0",
"font-awesome-webpack": "0.0.4",
"http-server": "^0.8.0",
"jasmine-core": "^2.3.4",
"jquery": "^2.2.1",
Expand Down Expand Up @@ -60,6 +61,7 @@
"protractor": "^3.1.1",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"source-code-pro": "git://github.com/adobe-fonts/source-code-pro.git#release",
"style-loader": "^0.13.0",
"svg-inline-loader": "^0.4.1",
"url-loader": "^0.5.7",
Expand Down
36 changes: 17 additions & 19 deletions styles/components.less
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
@import "colors";
@import "fonts";
@import "components/path";
@import "components/operation";
@import "components/schema-model";
@import "components/try-operation";
@import "components/modal";
@import "components/path-headers";
@import "components/collapse-when";
@import "components/error-presenter";
@import "components/preview";
@import "components/editor";
@import "components/header";
@import "components/menu-bar";
@import "components/intro";
@import "components/tags";
@import "components/security-definitions";
@import "components/tooltip";
@import "components/preferences-modal";
@import "./components/path";
@import "./components/operation";
@import "./components/schema-model";
@import "./components/try-operation";
@import "./components/modal";
@import "./components/path-headers";
@import "./components/collapse-when";
@import "./components/error-presenter";
@import "./components/preview";
@import "./components/editor";
@import "./components/header";
@import "./components/menu-bar";
@import "./components/intro";
@import "./components/tags";
@import "./components/security-definitions";
@import "./components/tooltip";
@import "./components/preferences-modal";
161 changes: 81 additions & 80 deletions styles/fonts.less
Original file line number Diff line number Diff line change
@@ -1,86 +1,87 @@
@fonts-folder: '../fonts';

// @font-face {
// font-family: 'Droid Sans';
// font-style: normal;
// font-weight: 400;
// src:
// local('Droid Sans'),
// local('DroidSans'),
// url('@{fonts-folder}/Droid_Sans_400.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Droid_Sans_400.woff') format('woff'),
// url('@{fonts-folder}/Droid_Sans_400.ttf') format('truetype'),
// url('@{fonts-folder}/Droid_Sans_400.svg#DroidSans') format('svg');
// }
// @font-face {
// font-family: 'Droid Sans';
// font-style: normal;
// font-weight: 700;
// src:
// local('Droid Sans Bold'),
// local('DroidSans-Bold'),
// url('@{fonts-folder}/Droid_Sans_700.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Droid_Sans_700.woff') format('woff'),
// url('@{fonts-folder}/Droid_Sans_700.ttf') format('truetype'),
// url('@{fonts-folder}/Droid_Sans_700.svg#DroidSans') format('svg');
// }
// @font-face {
// font-family: 'Open Sans';
// font-style: normal;
// font-weight: 300;
// src:
// local('Open Sans Light'),
// local('OpenSans-Light'),
// url('@{fonts-folder}/Open_Sans_300.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Open_Sans_300.woff') format('woff'),
// url('@{fonts-folder}/Open_Sans_300.ttf') format('truetype'),
// url('@{fonts-folder}/Open_Sans_300.svg#OpenSans') format('svg');
// }
// @font-face {
// font-family: 'Open Sans';
// font-style: normal;
// font-weight: 400;
// src:
// local('Open Sans'),
// local('OpenSans'),
// url('@{fonts-folder}/Open_Sans_400.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Open_Sans_400.woff') format('woff'),
// url('@{fonts-folder}/Open_Sans_400.ttf') format('truetype'),
// url('@{fonts-folder}/Open_Sans_400.svg#OpenSans') format('svg');
// }
// @font-face {
// font-family: 'Open Sans';
// font-style: normal;
// font-weight: 600;
// src:
// local('Open Sans Semibold'),
// local('OpenSans-Semibold'),
// url('@{fonts-folder}/Open_Sans_600.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Open_Sans_600.woff') format('woff'),
// url('@{fonts-folder}/Open_Sans_600.ttf') format('truetype'),
// url('@{fonts-folder}/Open_Sans_600.svg#OpenSans') format('svg');
// }
// @font-face {
// font-family: 'Open Sans';
// font-style: normal;
// font-weight: 700;
// src:
// local('Open Sans Bold'),
// local('OpenSans-Bold'),
// url('@{fonts-folder}/Open_Sans_700.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/Open_Sans_700.woff') format('woff'),
// url('@{fonts-folder}/Open_Sans_700.ttf') format('truetype'),
// url('@{fonts-folder}/Open_Sans_700.svg#OpenSans') format('svg');
// }
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 400;
src:
local('Droid Sans'),
local('DroidSans'),
url('@{fonts-folder}/Droid_Sans_400.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Droid_Sans_400.woff') format('woff'),
url('@{fonts-folder}/Droid_Sans_400.ttf') format('truetype'),
url('@{fonts-folder}/Droid_Sans_400.svg#DroidSans') format('svg');
}
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 700;
src:
local('Droid Sans Bold'),
local('DroidSans-Bold'),
url('@{fonts-folder}/Droid_Sans_700.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Droid_Sans_700.woff') format('woff'),
url('@{fonts-folder}/Droid_Sans_700.ttf') format('truetype'),
url('@{fonts-folder}/Droid_Sans_700.svg#DroidSans') format('svg');
}

@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src:
local('Open Sans Light'),
local('OpenSans-Light'),
url('@{fonts-folder}/Open_Sans_300.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Open_Sans_300.woff') format('woff'),
url('@{fonts-folder}/Open_Sans_300.ttf') format('truetype'),
url('@{fonts-folder}/Open_Sans_300.svg#OpenSans') format('svg');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src:
local('Open Sans'),
local('OpenSans'),
url('@{fonts-folder}/Open_Sans_400.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Open_Sans_400.woff') format('woff'),
url('@{fonts-folder}/Open_Sans_400.ttf') format('truetype'),
url('@{fonts-folder}/Open_Sans_400.svg#OpenSans') format('svg');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src:
local('Open Sans Semibold'),
local('OpenSans-Semibold'),
url('@{fonts-folder}/Open_Sans_600.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Open_Sans_600.woff') format('woff'),
url('@{fonts-folder}/Open_Sans_600.ttf') format('truetype'),
url('@{fonts-folder}/Open_Sans_600.svg#OpenSans') format('svg');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src:
local('Open Sans Bold'),
local('OpenSans-Bold'),
url('@{fonts-folder}/Open_Sans_700.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/Open_Sans_700.woff') format('woff'),
url('@{fonts-folder}/Open_Sans_700.ttf') format('truetype'),
url('@{fonts-folder}/Open_Sans_700.svg#OpenSans') format('svg');
}

// @font-face {
// font-family: 'Glyphicons Halflings';
// src: url('@{fonts-folder}/glyphicons-halflings-regular.eot');
// src: url('@{fonts-folder}/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
// url('@{fonts-folder}/glyphicons-halflings-regular.woff') format('woff'),
// url('@{fonts-folder}/glyphicons-halflings-regular.ttf') format('truetype'),
// url('@{fonts-folder}/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
// }
@font-face {
font-family: 'Glyphicons Halflings';
src: url('@{fonts-folder}/glyphicons-halflings-regular.eot');
src: url('@{fonts-folder}/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('@{fonts-folder}/glyphicons-halflings-regular.woff') format('woff'),
url('@{fonts-folder}/glyphicons-halflings-regular.ttf') format('truetype'),
url('@{fonts-folder}/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

.pre-font {
font-family: 'Source Code Pro', monospace;
Expand Down
13 changes: 7 additions & 6 deletions styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
@import "~json-schema-view-js/dist/style.css";
@import "~bootstrap/less/bootstrap.less";
@import "~font-awesome/less/font-awesome.less";
@import "~source-code-pro/source-code-pro.css";

@import "fonts";
@import "buttons";
@import "components";
@import "markdown";
@import "print";
@import "colors";
@import "./fonts";
@import "./buttons";
@import "./components";
@import "./markdown";
@import "./print";
@import "./colors";

@splitter-width: 4px;

Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
loader: 'svg-inline'
},
{
test: /\.(ttf|eot|svg|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
test: /\.(ttf|eot|svg|woff|woff2|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
}
]
Expand Down

0 comments on commit 7de07d8

Please sign in to comment.