Skip to content

Commit

Permalink
now construct the font list programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
synle committed Dec 29, 2023
1 parent a6d834c commit 7271189
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .build/font-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Medium.ttf -O -J
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Regular.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Retina.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-SemiBold.ttf -O -J -L && \
echo "Done downloading fonts"
curl https://github.com/synle/bashrc/raw/master/fonts/Trace.ttf -O -J -L && \
echo "Done downloading fonts"
5 changes: 4 additions & 1 deletion .build/font-windows.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
C:
cd C:
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaCode.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaCodePL.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaMono.ttf
Expand All @@ -8,4 +10,5 @@ Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/Fira
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Regular.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Retina.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-SemiBold.ttf
echo "Done downloading fonts"
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/Trace.ttf
echo "Done downloading fonts"
42 changes: 5 additions & 37 deletions fonts/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
These fonts are copied from the owner of Fira Code. Repo is at https://github.com/tonsky/FiraCode
These fonts are copied from the owner of Fira Code. Repo is at https://github.com/tonsky/FiraCode and https://www.fontspace.com/trace-font-f3625

### Bash
### Linux - Bash

```bash
cd ~/Desktop
curl https://github.com/synle/bashrc/raw/master/fonts/CascadiaCode.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/CascadiaCodePL.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/CascadiaMono.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/CascadiaMonoPL.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Bold.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Light.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Medium.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Regular.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Retina.ttf -O -J -L && \
curl https://github.com/synle/bashrc/raw/master/fonts/FiraCode-SemiBold.ttf -O -J -L && \
echo "Done downloading fonts"
```
https://raw.githubusercontent.com/synle/bashrc/master/.build/font-linux.md

### Powershell
### Windows - Powershell

```
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaCode.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaCodePL.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaMono.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/CascadiaMonoPL.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Bold.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Light.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Medium.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Regular.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-Retina.ttf
Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/FiraCode-SemiBold.ttf
echo "Done downloading fonts"
```

Source:

```
Trace.ttf
https://www.fontspace.com/trace-font-f3625
```
https://raw.githubusercontent.com/synle/bashrc/master/.build/font-windows.md
26 changes: 26 additions & 0 deletions software/scripts/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ async function doWork() {
return process.exit();
}

// write to build file
const fontBaseNames = fonts.map((font) => path.basename(font));
writeToBuildFile([
[
'font-linux.md',
`
cd ~/Desktop
${fontBaseNames.map((fontBaseName) => `curl https://github.com/synle/bashrc/raw/master/fonts/${fontBaseName} -O -J -L && \\`).join('\n')}
echo "Done downloading fonts"
`.trim(),
false,
],
[
'font-windows.md',
`
C:
cd C:
${fontBaseNames
.map((fontBaseName) => `Start-BitsTransfer -Source https://github.com/synle/bashrc/raw/master/fonts/${fontBaseName}`)
.join('\n')}
echo "Done downloading fonts"
`.trim(),
false,
],
]);

const promises = [];
for (const font of fonts) {
promises.push(
Expand Down

0 comments on commit 7271189

Please sign in to comment.