Skip to content

Commit ae47fac

Browse files
authored
Feature/avalonia font (#193)
* Change Avalonia apps to use Fira Sans and Fire Code fonts. Unicode symbols were not rendered correct in Avalonia Browser, so those symbols remade as controls with drawn vector graphics. * Tweak Avalonia layout * Secure docs publish by forcing hash verification of pip dependencies. * Bump VSCode extension node dependencies with security vulnerabilities
1 parent e4083eb commit ae47fac

37 files changed

Lines changed: 1013 additions & 226 deletions

.github/workflows/docs-publish-to-gh-pages.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ on:
1010
- 'docs/**'
1111
- 'includes/**'
1212
- 'mkdocs.yml'
13+
- 'requirements-docs.in'
1314
- 'requirements-docs.txt'
15+
- '.pip-tools.toml'
1416
- '.github/workflows/docs-publish-to-gh-pages.yml'
1517

1618
# Prevent concurrent deployments to GitHub Pages
@@ -38,7 +40,7 @@ jobs:
3840
cache-dependency-path: requirements-docs.txt
3941

4042
- name: Install MkDocs and dependencies
41-
run: "pip install --only-binary :all: -r requirements-docs.txt"
43+
run: "pip install --require-hashes --only-binary :all: -r requirements-docs.txt"
4244

4345
- name: Build static site with MkDocs
4446
run: mkdocs build --strict --site-dir ${{ env.BUILD_OUTPUT_WORKING_DIR }}

.pip-tools.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool.pip-tools]
2+
generate-hashes = true

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/jazzband/pip-tools
3+
rev: v7.5.3
4+
hooks:
5+
- id: pip-compile
6+
name: pip-compile requirements-docs.in
7+
files: ^requirements-docs\.(in|txt)$
8+
args:
9+
- --output-file=requirements-docs.txt
10+
- requirements-docs.in

BUILD_DOCS.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,27 @@ pip install -r requirements-docs.txt
6565

6666
## 3. Upgrade dependencies
6767

68-
Dependencies are managed with [`pip-tools`](https://pip-tools.readthedocs.io/). The file you edit is `requirements-docs.in` (top-level only); the lock file `requirements-docs.txt` is auto-generated.
68+
Dependencies are managed with [`pip-tools`](https://pip-tools.readthedocs.io/). The file you edit is `requirements-docs.in` (top-level only); the lock file `requirements-docs.txt` is auto-generated and includes artifact hashes.
6969

7070
**One-time setup:**
7171

7272
```bash
7373
python3 -m pip install pip-tools
7474
```
7575

76+
**Optional: auto-regenerate the lock file on commit:**
77+
78+
```bash
79+
python3 -m pip install pre-commit
80+
pre-commit install
81+
```
82+
83+
With the pre-commit hook installed, editing `requirements-docs.in` will automatically refresh `requirements-docs.txt` during commit.
84+
7685
**To upgrade mkdocs-material** (or add new deps):
7786

7887
1. Edit `requirements-docs.in` — e.g. change `mkdocs-material==9.7.6` to a newer version.
79-
2. Regenerate the lock file:
88+
2. Regenerate the lock file (if you are not using the pre-commit hook):
8089

8190
```bash
8291
python3 -m piptools compile requirements-docs.in -o requirements-docs.txt

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ For the full list of missing features and constraints, see [Limitations](https:/
7070

7171
# Credits
7272

73-
- [Kristoffer Strube](https://github.com/KristofferStrube) for the original Blazor WASM async interop code for [WebAudio](https://github.com/KristofferStrube/Blazor.WebAudio), [DOM](https://github.com/KristofferStrube/Blazor.DOM), and [IDL](https://github.com/KristofferStrube/Blazor.WebIDL) that was the basis for a synchronous implementation in this repo. Copyright notice [here](src/libraries/Highbyte.DotNet6502.Impl.AspNet/JSInterop/JSInterop_OriginalLicense.MD).
73+
- Third-party credits, including bundled fonts, are listed in [References](docs/home/references.md#credits).
74+

docs/home/references.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,6 @@ Used during development to verify behavior of the 6502 CPU and C64.
6666

6767
## Credits
6868

69-
- [Kristoffer Strube](https://github.com/KristofferStrube) for the original Blazor WASM async interop code for [WebAudio](https://github.com/KristofferStrube/Blazor.WebAudio), [DOM](https://github.com/KristofferStrube/Blazor.DOM), and [IDL](https://github.com/KristofferStrube/Blazor.WebIDL) that was the basis for a synchronous implementation in this repo.
69+
- Bundled UI fonts: [Fira Sans](https://fonts.google.com/specimen/Fira+Sans) from [Google Fonts](https://fonts.google.com/) and [Fira Code](https://github.com/tonsky/FiraCode) from the official project. Both are distributed under the [SIL Open Font License 1.1](https://openfontlicense.org/), with license text included alongside the bundled font files in the repository.
70+
71+
- [Kristoffer Strube](https://github.com/KristofferStrube) for the original Blazor WASM async interop code for [WebAudio](https://github.com/KristofferStrube/Blazor.WebAudio), [DOM](https://github.com/KristofferStrube/Blazor.DOM), and [IDL](https://github.com/KristofferStrube/Blazor.WebIDL) that was the basis for a synchronous implementation in this repo. Copyright notice [here](https://github.com/highbyte/dotnet-6502/blob/master/src/libraries/Highbyte.DotNet6502.Impl.AspNet/Audio/WebAudioAPISynth/JSInterop/JSInterop_OriginalLicense.MD).

requirements-docs.txt

Lines changed: 412 additions & 32 deletions
Large diffs are not rendered by default.

src/apps/Avalonia/Highbyte.DotNet6502.App.Avalonia.Android/Highbyte.DotNet6502.App.Avalonia.Android.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
</AndroidResource>
1818
</ItemGroup>
1919

20-
<ItemGroup>
21-
<PackageReference Include="Avalonia.Android" />
22-
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" />
23-
</ItemGroup>
20+
<ItemGroup>
21+
<PackageReference Include="Avalonia.Android" />
22+
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" />
23+
</ItemGroup>
2424

2525
<ItemGroup>
2626
<ProjectReference Include="..\Highbyte.DotNet6502.App.Avalonia.Core\Highbyte.DotNet6502.App.Avalonia.Core.csproj" />

src/apps/Avalonia/Highbyte.DotNet6502.App.Avalonia.Android/MainActivity.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Android.App;
22
using Android.Content.PM;
33
using Android.Runtime;
4-
using Avalonia;
54
using Avalonia.Android;
65
using Highbyte.DotNet6502.App.Avalonia.Core;
76

@@ -24,7 +23,4 @@ protected AndroidApp(IntPtr javaReference, JniHandleOwnership transfer)
2423
: base(javaReference, transfer)
2524
{
2625
}
27-
28-
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
29-
=> base.CustomizeAppBuilder(builder).WithInterFont();
3026
}

src/apps/Avalonia/Highbyte.DotNet6502.App.Avalonia.Browser/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,9 @@ await AutomatedStartupHandler.ExecuteAsync(
535535
// Start Avalonia app
536536
try
537537
{
538-
WriteBootstrapLog("Starting Avalonia Browser app...");
539-
await BuildAvaloniaApp(configuration, emulatorConfig, logStore, logConfig, loggerFactory, avaloniaLoggerBridge, browserGamepad, scriptingEngine, LoadScript, SaveScript, DeleteScript, LoadExamplesAsync, automatedStartupRunner: automatedStartupRunner)
540-
.WithInterFont()
541-
.StartBrowserAppAsync("out");
538+
WriteBootstrapLog("Starting Avalonia Browser app...");
539+
await BuildAvaloniaApp(configuration, emulatorConfig, logStore, logConfig, loggerFactory, avaloniaLoggerBridge, browserGamepad, scriptingEngine, LoadScript, SaveScript, DeleteScript, LoadExamplesAsync, automatedStartupRunner: automatedStartupRunner)
540+
.StartBrowserAppAsync("out");
542541

543542
WriteBootstrapLog("Avalonia Browser app exiting.");
544543
}

0 commit comments

Comments
 (0)