Use nerd font patched Source Code Pro as default font for better rendering of glyphs (#16)

* Squashed commit of the following:

(Done for a cleaner merge)

commit 3f2ef96c66
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:23:23 2020 +0000

    Completely remove devDependencies

commit 5b7b34c86c
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:22:05 2020 +0000

    Change install deps from dev to production

commit 2b23f00d7d
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:08:30 2020 +0000

    Oops add more detail to Sauce Code Pro provenance

commit 56696b2bcb
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:07:54 2020 +0000

    Acknowledge SauceCodePro provenence/license

commit bfb93f4982
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 05:00:53 2020 +0000

    Revert "Regen assets_bundle.go"

    This reverts commit 51f189421b.

    This is because I don't want this diff in the squash just yet

commit ac15b25af6
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:57:49 2020 +0000

    Resolve unnecessary diffs

commit 8a274365dc
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:50:07 2020 +0000

    Add some fallback fonts if SauceCodePro is loading

commit 8ff2901bc7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:30:36 2020 +0000

    Remove SO comment ( wasnt relevant )

commit aa29bf232e
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Fri Sep 25 04:29:47 2020 +0000

    Finally fix font pathing

commit 86a5ec20cd
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:38:48 2020 +0000

    Use publicPath ?

commit d225edb5f9
Merge: 492a835 81295b8
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:28:19 2020 +0000

    Merge branch 'fonts' of https://github.com/mstr3336/tty-server into fonts

commit 492a83589d
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 10:26:59 2020 +0000

    Comment stack overflow link in webpack config

commit 81295b8689
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 20:26:22 2020 +1000

    Move stuff to static i guess?

commit a3a2238d35
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:49:58 2020 +1000

    Specify esmodule false for font loader

commit be7cc94ade
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:39:03 2020 +1000

    Hopefully make webpack load fonts?

commit 97e76cee0b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:31:28 2020 +1000

    Add file-loader npm module

commit 913ce076fb
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:25:40 2020 +1000

    Change font setting in tty-reciever.ts to new font

commit 2387c0132b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:24:44 2020 +1000

    Add nerd font rules

commit 622d834bf9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:23:43 2020 +1000

    Fix format spec for fonts

commit 6df46eacf7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:20:50 2020 +1000

    Finish script for building stylesheet

commit e47d0de28b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 19:15:58 2020 +1000

    Add python script for building css

commit b38526cca7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:35:54 2020 +1000

    Remove _Nerd_Font suffix

commit cfd461ad7e
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:34:40 2020 +1000

    Remove _Complete_Mono_Windows_Compatible suffix from new fonts

commit 2333f1bf61
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 24 18:28:48 2020 +1000

    Add sauce code pro fonts from nerdfonts

commit 778f2194c9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 22:20:32 2020 +1000

    Remove unnessary css rule

commit c86e17f9ed
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:11:44 2020 +0000

    Remove vagrantfile for clean feature branch

commit 51f189421b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:07:03 2020 +0000

    Regen assets_bundle.go

commit 3e0462604b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:06:39 2020 +0000

    Set the fontFamily of the tty-reciever to SourceCodePro

commit cd06e4b013
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 12:04:18 2020 +0000

    Rename font family string for source code pro

commit 87a50edcaf
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 20:46:07 2020 +1000

    Update css to include source code pro for font family

commit a036043573
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 19:59:51 2020 +1000

    Finally fixed env escapes

commit ed7dc41c46
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 19:24:27 2020 +1000

    Fix heredoc

commit a9ad558316
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 18:56:25 2020 +1000

    Add serve script to vagrantfile

commit 433353c70f
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au>
Date:   Thu Sep 17 18:33:11 2020 +1000

    added vagrantfile

* Regen frontend/package-lock.json after merging upstream into feature
pull/19/head
Matthew Strasiotto 4 years ago committed by GitHub
parent bae58e702c
commit 70fdd083eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1420,6 +1420,63 @@
"resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz",
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw=="
},
"file-loader": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.1.0.tgz",
"integrity": "sha512-26qPdHyTsArQ6gU4P1HJbAbnFTyT2r0pG7czh1GFAd9TZbj0n94wWbupgixZH/ET/meqi2/5+F7DhW4OAXD+Lg==",
"requires": {
"loader-utils": "^2.0.0",
"schema-utils": "^2.7.1"
},
"dependencies": {
"ajv": {
"version": "6.12.5",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz",
"integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ=="
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"schema-utils": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz",
"integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==",
"requires": {
"@types/json-schema": "^7.0.5",
"ajv": "^6.12.4",
"ajv-keywords": "^3.5.2"
}
}
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
@ -2084,6 +2141,13 @@
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
"requires": {
"minimist": "^1.2.5"
},
"dependencies": {
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
}
}
},
"kind-of": {

@ -12,6 +12,7 @@
"dependencies": {
"copy-webpack-plugin": "^6.0.0",
"css-loader": "^3.6.0",
"file-loader": "^6.1.0",
"style-loader": "^0.23.1",
"ts-loader": "^6.2.2",
"typescript": "^3.9.7",

@ -0,0 +1,55 @@
import re
from pathlib import Path
family = "Sauce_Code_Pro"
pat = r"^" + family + r"_?(?P<weight>[a-zA-Z]*)_?(?P<italic>[a-zA-Z]*)\.ttf"
weights = {
"medium" : 400,
"" : 400,
"extralight" : 250,
"light" : 300,
"semibold" : 600,
"bold" : 700,
"black": 800
}
styles = {
"italic" : "italic",
"" : "normal"
}
p = Path('.')
out = []
for font in p.iterdir():
m = re.match(pat, font.name)
match_dict = {"weight" : "", "italic" : ""}
if m:
match_dict = m.groupdict(default = "")
else:
print(f"No match for: {font.name}!")
weight = match_dict["weight"].lower()
italic = match_dict["italic"].lower()
css_weight = weights[""]
css_style = styles[""]
if weight in weights: css_weight = weights[weight]
if italic in styles: css_style = styles[italic]
out += [f"""
@font-face {{
font-family: {family};
font-style: {css_style};
font-weight: {css_weight};
src: url("assets/fonts/{font.name}") format("truetype");
}}
"""]
for f in out:
print(f)

@ -1,3 +1,123 @@
/* Sauce Code Pro / Source Code Pro
* Courtesy of:
* https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/SourceCodePro
* Licensed under OFL 1.1
* https://raw.githubusercontent.com/ryanoasis/nerd-fonts/c41890f/patched-fonts/SourceCodePro/Regular/complete/LICENSE.txt
*
* Fonts used are "Windows Compatible Monospaced"
* */
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 800;
src: url("../static/fonts/Sauce_Code_Pro_Black_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 800;
src: url("../static/fonts/Sauce_Code_Pro_Black.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 700;
src: url("../static/fonts/Sauce_Code_Pro_Bold_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 700;
src: url("../static/fonts/Sauce_Code_Pro_Bold.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 250;
src: url("../static/fonts/Sauce_Code_Pro_ExtraLight_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 250;
src: url("../static/fonts/Sauce_Code_Pro_ExtraLight.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 400;
src: url("../static/fonts/Sauce_Code_Pro_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 300;
src: url("../static/fonts/Sauce_Code_Pro_Light_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 300;
src: url("../static/fonts/Sauce_Code_Pro_Light.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 400;
src: url("../static/fonts/Sauce_Code_Pro_Medium_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 400;
src: url("../static/fonts/Sauce_Code_Pro_Medium.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 400;
src: url("../static/fonts/Sauce_Code_Pro.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: italic;
font-weight: 600;
src: url("../static/fonts/Sauce_Code_Pro_Semibold_Italic.ttf") format("truetype");
}
@font-face {
font-family: SauceCodePro;
font-style: normal;
font-weight: 600;
src: url("../static/fonts/Sauce_Code_Pro_Semibold.ttf") format("truetype");
}
html, body {
width: 100%;
height: 100%;

@ -20,6 +20,7 @@ class TTYReceiver {
scrollback: 0,
fontSize: 12,
letterSpacing: 0,
fontFamily: 'SauceCodePro, courier-new, monospace'
});
this.containerElement = container;

@ -26,7 +26,21 @@ let mainConfig = {
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
esModule: false,
publicPath: '/static/fonts/'
}
}
]
}
]
},
resolve: {

Loading…
Cancel
Save