fix(store): render feature-graphic wordmark with real font (Titan One, OFL)

The flutter_test default font draws every glyph as a box, so the wordmark was
unreadable. Load the OFL Titan One TTF via FontLoader in the generator and
render 'Block Seasons' + tagline with it; fit the text within the 1024 width.
Font used only by the asset generator, not bundled in the app.
This commit is contained in:
2026-06-13 18:20:11 +09:00
parent 7fe2bc2776
commit b0839aba2a
5 changed files with 116 additions and 7 deletions
@@ -4,6 +4,7 @@ import 'dart:ui';
import 'package:block_seasons/ui/branding/app_icon_painter.dart';
import 'package:block_seasons/ui/branding/feature_graphic_painter.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> _writePng(String path, int size, void Function(Canvas) draw) async {
@@ -45,6 +46,14 @@ void main() {
testWidgets('generate feature graphic', (tester) async {
await tester.runAsync(() async {
// Load the real display font (OFL Titan One) so the wordmark renders as
// glyphs — the flutter_test default font draws every char as a box.
final fontBytes =
File('tool/fonts/TitanOne-Regular.ttf').readAsBytesSync();
final loader = FontLoader('TitanOne')
..addFont(Future.value(ByteData.view(fontBytes.buffer)));
await loader.load();
const w = 1024, h = 500;
final recorder = PictureRecorder();
final canvas = Canvas(recorder);