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 3ae065b
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 59 deletions.
1 change: 1 addition & 0 deletions .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 && \
curl https://github.com/synle/bashrc/raw/master/fonts/Trace.ttf -O -J -L && \
echo "Done downloading fonts"
3 changes: 3 additions & 0 deletions .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
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
60 changes: 38 additions & 22 deletions index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,35 @@ function EnhancedTextArea(props) {
);
}

/**
* Common applciations links DOM
*/
const CommonOtherAppDom = (
<>
<LinkButton block href='https://github.com/synle/bashrc/tree/master/fonts'>
Custom Fonts
</LinkButton>
<LinkButton block href='https://www.sublimetext.com/download'>
Sublime Text
</LinkButton>
<LinkButton block href='https://www.sublimemerge.com/download'>
Sublime Merge
</LinkButton>
<LinkButton block href='https://www.charlesproxy.com/download/latest-release/'>
Charles Proxy
</LinkButton>
<LinkButton block href='https://ultimaker.com/software/ultimaker-cura/#links'>
Ultimaker Cura
</LinkButton>
<LinkButton block href='https://design.cricut.com/#/'>
Cricut Design Space
</LinkButton>
<LinkButton block href='https://download.battle.net/en-us/?product=bnetdesk'>
Battle Net
</LinkButton>
</>
);

function MacOSXNotesDom() {
return (
<>
Expand All @@ -556,6 +585,10 @@ function MacOSXNotesDom() {
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-configurations' />
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-extensions-macosx' />
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-keybindings-macosx' />

{/* Mac */}
<div className='form-label'>Other Applications</div>
<div className='link-group'>{CommonOtherAppDom}</div>
</>
);
}
Expand All @@ -575,6 +608,9 @@ function LinuxNotesDom() {
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-configurations' />
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-extensions-linux' />
<DynamicTextArea url='https://raw.githubusercontent.com/synle/bashrc/master/.build/vs-code-keybindings-linux' />
{/* Linux */}
<div className='form-label'>Other Applications</div>
<div className='link-group'>{CommonOtherAppDom}</div>v
</>
);
}
Expand Down Expand Up @@ -634,32 +670,12 @@ function WindowsNotesDom() {
<div className='form-label'>Other Applications</div>
<div className='link-group'>
<LinkButton block href='https://github.com/synle/bashrc/raw/master/.build/Applications.zip'>
Prebuild Applications
</LinkButton>
<LinkButton block href='https://github.com/synle/bashrc/tree/master/fonts'>
Custom Fonts
Prebuilt Windows Applications
</LinkButton>
<LinkButton block href='https://ninite.com/'>
Ninite
</LinkButton>
<LinkButton block href='https://download.battle.net/en-us/?product=bnetdesk'>
Battle Net
</LinkButton>
<LinkButton block href='https://www.sublimetext.com/download'>
Sublime Text
</LinkButton>
<LinkButton block href='https://www.sublimemerge.com/download'>
Sublime Merge
</LinkButton>
<LinkButton block href='https://www.charlesproxy.com/download/latest-release/'>
Charles Proxy
</LinkButton>
<LinkButton block href='https://ultimaker.com/software/ultimaker-cura/#links'>
Ultimaker Cura
</LinkButton>
<LinkButton block href='https://design.cricut.com/#/'>
Cricut Design Space
</LinkButton>
{CommonOtherAppDom}
</div>

{/* extensions */}
Expand Down
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 3ae065b

Please sign in to comment.