Skip to content

Commit

Permalink
Bundle the font
Browse files Browse the repository at this point in the history
For performance, offline support and privacy.

Cut down the CSS file from the package so that we only need to bundle
the one font file, like what Google was doing.
  • Loading branch information
tstarling committed Dec 9, 2022
1 parent 81a6f29 commit b7d026e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>speedscope</title>
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">
<link href="source-code-pro.css" rel="stylesheet">
<script>
// https://github.com/evanw/webgl-recorder
false && (function () {
Expand Down Expand Up @@ -169,4 +169,4 @@
<script src="../src/speedscope.tsx"></script>
</body>

</html>
</html>
7 changes: 7 additions & 0 deletions assets/source-code-pro.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face{
font-family: 'Source Code Pro';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url('../node_modules/source-code-pro/TTF/SourceCodePro-Regular.ttf') format('truetype');
}
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"preact": "10.4.1",
"prettier": "2.0.4",
"protobufjs": "6.8.8",
"source-code-pro": "2.38.0",
"source-map": "0.6.1",
"ts-jest": "24.3.0",
"typescript": "4.2.3",
Expand Down

0 comments on commit b7d026e

Please sign in to comment.