From 7e7854427ca5cddb997f809a33de7204d4a13bd2 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 22 Jun 2026 07:51:58 +0800 Subject: [PATCH] =?UTF-8?q?docs(client):=20=E4=BF=AE=E8=AE=A2=20pangolin?= =?UTF-8?q?=5Ftheme=20=E5=AD=97=E4=BD=93=E6=B3=A8=E9=87=8A(=E6=94=B9?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=89=93=E5=8C=85=E5=90=8E=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- client/lib/pangolin_theme.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client/lib/pangolin_theme.dart b/client/lib/pangolin_theme.dart index 03b3693..62051af 100644 --- a/client/lib/pangolin_theme.dart +++ b/client/lib/pangolin_theme.dart @@ -6,7 +6,7 @@ // · PangolinScheme — ThemeExtension(语义色映射 + light/dark 实例) // · PangolinContext — BuildContext 扩展 // · PangolinFonts — 字族标签常量 -// · PangolinText — google_fonts 运行时字型 +// · PangolinText — 本地打包字型(生产 useBundled,离线;测试经 FontLoader) // · PangolinTheme — ThemeData 组装 // // Usage: @@ -144,9 +144,10 @@ extension PangolinContext on BuildContext { } /// ── Font families ─────────────────────────────────────────────────── -/// 生产用 google_fonts 运行时加载;测试态设 [useBundled]=true,改用本地 -/// FontLoader 注册的同名 family(避免 google_fonts 在无网/禁拉取时抛异常, -/// 让 golden 截图回归可跑)。封装函数是 PangolinText/_build 的唯一字体入口。 +/// 生产用本地打包字体([useBundled]=true,pubspec fonts: 段,离线);保留的 +/// [useBundled]=false 分支走 google_fonts 运行时加载,仅作回退/对照。测试态由 +/// flutter_test_config 经 FontLoader 注册同名 family。封装函数是 PangolinText/ +/// _build 的唯一字体入口。 class PangolinFonts { PangolinFonts._(); static const display = 'Sora'; @@ -188,9 +189,9 @@ class PangolinFonts { } /// ── Type scale ────────────────────────────────────────────────────── -/// Uses google_fonts for runtime font loading (no local ttf required). -/// All PangolinText members are static getters (not const) so they can -/// reference google_fonts, which registers fonts dynamically. +/// Uses locally-bundled fonts via [PangolinFonts] (production `useBundled=true`, +/// offline; tests register fonts via FontLoader). Members are static getters +/// (not const) so they route through the [PangolinFonts] wrapper functions. class PangolinText { PangolinText._();