7d2c3412a1
Adds the Paper design and generalises design tokens (transcript, composer, selected-row styles, reading type, panel fill, chat colour saturation). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
import '../text/terminal_symbols_font.dart';
|
|
import 'app_font.dart';
|
|
import 'paper_fonts.dart';
|
|
|
|
bool _registered = false;
|
|
|
|
/// Adds each bundled interface font's SIL Open Font License, Paper's reading
|
|
/// serif's, and the
|
|
/// terminal symbols font's MIT licence, to the
|
|
/// [LicenseRegistry]. The texts are read from the bundle only when a licence
|
|
/// page asks for them.
|
|
void registerAppFontLicenses() {
|
|
if (_registered) return;
|
|
_registered = true;
|
|
LicenseRegistry.addLicense(() async* {
|
|
for (final font in AppFont.values) {
|
|
final asset = font.licenseAsset;
|
|
if (asset == null) continue;
|
|
yield LicenseEntryWithLineBreaks(<String>[
|
|
font.label,
|
|
], await rootBundle.loadString(asset));
|
|
}
|
|
yield LicenseEntryWithLineBreaks(<String>[
|
|
paperSerifFamily,
|
|
], await rootBundle.loadString(paperSerifLicenseAsset));
|
|
yield LicenseEntryWithLineBreaks(<String>[
|
|
'Symbols Nerd Font Mono',
|
|
], await rootBundle.loadString(terminalSymbolsLicenseAsset));
|
|
});
|
|
}
|