mirror of https://github.com/elisescu/tty-server
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) commitpull/19/head3f2ef96c66
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 05:23:23 2020 +0000 Completely remove devDependencies commit5b7b34c86c
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 05:22:05 2020 +0000 Change install deps from dev to production commit2b23f00d7d
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 commit56696b2bcb
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 05:07:54 2020 +0000 Acknowledge SauceCodePro provenence/license commitbfb93f4982
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 05:00:53 2020 +0000 Revert "Regen assets_bundle.go" This reverts commit51f189421b
. This is because I don't want this diff in the squash just yet commitac15b25af6
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 04:57:49 2020 +0000 Resolve unnecessary diffs commit8a274365dc
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 commit8ff2901bc7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 04:30:36 2020 +0000 Remove SO comment ( wasnt relevant ) commitaa29bf232e
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Fri Sep 25 04:29:47 2020 +0000 Finally fix font pathing commit86a5ec20cd
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 10:38:48 2020 +0000 Use publicPath ? commitd225edb5f9
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 commit492a83589d
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 10:26:59 2020 +0000 Comment stack overflow link in webpack config commit81295b8689
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 20:26:22 2020 +1000 Move stuff to static i guess? commita3a2238d35
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:49:58 2020 +1000 Specify esmodule false for font loader commitbe7cc94ade
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:39:03 2020 +1000 Hopefully make webpack load fonts? commit97e76cee0b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:31:28 2020 +1000 Add file-loader npm module commit913ce076fb
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 commit2387c0132b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:24:44 2020 +1000 Add nerd font rules commit622d834bf9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:23:43 2020 +1000 Fix format spec for fonts commit6df46eacf7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:20:50 2020 +1000 Finish script for building stylesheet commite47d0de28b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 19:15:58 2020 +1000 Add python script for building css commitb38526cca7
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 18:35:54 2020 +1000 Remove _Nerd_Font suffix commitcfd461ad7e
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 commit2333f1bf61
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 24 18:28:48 2020 +1000 Add sauce code pro fonts from nerdfonts commit778f2194c9
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 22:20:32 2020 +1000 Remove unnessary css rule commitc86e17f9ed
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 12:11:44 2020 +0000 Remove vagrantfile for clean feature branch commit51f189421b
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 12:07:03 2020 +0000 Regen assets_bundle.go commit3e0462604b
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 commitcd06e4b013
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 commit87a50edcaf
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 commita036043573
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 19:59:51 2020 +1000 Finally fixed env escapes commited7dc41c46
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 19:24:27 2020 +1000 Fix heredoc commita9ad558316
Author: Matthew Strasiotto <mstr3336@uni.sydney.edu.au> Date: Thu Sep 17 18:56:25 2020 +1000 Add serve script to vagrantfile commit433353c70f
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
parent
bae58e702c
commit
70fdd083eb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue