iOS 界面字体回退系统原生 + iPad 适配 + 登录列宽
- 移除自定义 UI 字体,界面统一系统原生:删 BrandFonts.swift(Orbit/Maple woff2 运行期 CTFontManager 注册 + UIKit 外观代理)+ AppDelegate 的 register 调用 + CDropApp 全局 .environment(\.font, .oBody);9 视图 .font(.o语义) → .font(.语义) 系统语义(日志 LogView 消息行本就 .caption.monospaced() 原生等宽);删 Sources/Fonts/(Orbit/Maple woff2 ~20MB)。仅留品牌字标 Fredoka(logo Wordmark),Justfile ios-fonts 改 Fredoka-only、.gitignore 收窄、新增 Shared/Fonts/README.md - iPad 适配:RootView TabView 加 .tabViewStyle(.sidebarAdaptable)(iPad 常规宽度侧边栏 / iPhone 底部标签栏)+ ConversationView 消息线程 maxWidth 680 居中;project.yml 补方向键 UISupportedInterfaceOrientations(iPhone 竖 + 横)/ ~ipad(全 4 向),消除 iPad 多任务方向构建告警 - 登录页内容约束 maxWidth 420 居中,避免 iPad 宽屏主登录按钮 / 二维码区横向拉满(iPhone 不受影响) - 文档:ios/PLAN.md §11.2 改系统原生字体 + 新增 §13 iPad;ios/PARITY.md 字体分叉条目回退 + 导航条目加 iPad + 2026-07-07 漂移行 - 已装 iPhone 15 Pro C + iPad Pro 13" M4 双端、用户确认
This commit is contained in:
+20
-8
@@ -272,22 +272,24 @@ Share Extension 落法(据上):**抓文件 → 写 App Group 容器 →
|
||||
|
||||
---
|
||||
|
||||
## 11. 品牌与字体系统(2026-06-28,对齐 web)
|
||||
## 11. 品牌 logo 与界面字体(2026-06-28 引入 logo;字体 2026-07-07 改系统原生)
|
||||
|
||||
iOS 界面引入与 web 一致的品牌资产与字体栈——这是强约束③(§5,品牌资产 + 主色单一源)在视觉层的延伸。
|
||||
iOS 引入与 web 一致的**品牌资产(吉祥物 mark + Fredoka 字标)**作共享源(强约束③,§5);**界面字体则用系统原生**(见 §11.2,归允许分叉)。
|
||||
|
||||
### 11.1 品牌 logo
|
||||
|
||||
- `Shared/Brand.swift`:`BrandMark`(吉祥物,资产 `Shared/Brand.xcassets/LogoMark`,源 `web/public/logo-mark.png`)、`Wordmark`(“Commilitia” 主色 + “Drop” `cdropAmber`,Fredoka SemiBold)、`BrandLockup`、`BrandHero(tagline:)`。
|
||||
- 接入点:登录页(`BrandMark` + `Wordmark` 取代纯文字标题)、传输空态(`BrandHero`)、设置页顶部横向品牌头、控制中心控件重设计(吉祥物 + 品牌渐变 + 全宽按钮,最大化空间)。`Theme.swift` 加 `Color.cdropAmber`(#DB9410 / #F8C637)。
|
||||
|
||||
### 11.2 字体栈(Orbit Gothic + Maple Mono + Fredoka)
|
||||
### 11.2 界面字体=系统原生(2026-07-07 定案,撤下自定义字体栈)
|
||||
|
||||
- 与 web `fonts.css` 同源:Sans = **Orbit Gothic CJK SC**(Regular + SemiBold)、Mono = **Maple Mono**、字标 = **Fredoka SemiBold**。
|
||||
- **woff2 运行期注册**:Orbit / Maple 以 woff2 内嵌(约 TTF 的 1/3 体积),`UIAppFonts` 历史只认 ttf/otf,故经 `CTFontManagerRegisterFontsForURL` 运行期注册(iOS 13+ Core Text 原生支持 woff2,实测 register→true)——见 `Sources/BrandFonts.swift` 的 `BrandFonts.register()`(`AppDelegate` 启动调)。Fredoka 是 ttf,走 `UIAppFonts`。
|
||||
- **助手 + sweep**:`BrandFonts` 暴露 `Font.oBody/.oHeadline/…`(Orbit,对位 SF 语义样式)、`Font.maple(…)`(Maple Mono);导航 / 标签栏标题经 UIKit appearance 代理换 Orbit;7 个视图的 `.font(.语义)` → `.font(.o语义)` sweep。
|
||||
- **仅主 app**:CJK 字体大,不进 Share / 控件扩展(它们保持系统字 + 仅 Fredoka 字标);生僻字超 Orbit 字汇时 iOS 字体级联自动回退苹方,不出豆腐块。
|
||||
- **字体不入库**:Orbit Gothic 为专有 / 定制字体(公开仓库不分发),Maple / Fredoka 虽开源也统一不入库保持精简;经 `.gitignore` 排除,构建前 `just ios-fonts`(已 chain 进 `ios-device` / `ios-sim-build`)从私有 CDN / Google Fonts 幂等拉取。详见 `Sources/Fonts/README.md`。
|
||||
> **决策更新(2026-07-07)**:移除早先(2026-06-28)引入的 Orbit Gothic(Sans)+ Maple Mono(Mono)自定义 UI 字体栈,**界面统一回退系统原生字体**。**唯一保留的自定义字体是品牌字标 Fredoka**(仅 logo 的 `Wordmark`,见 §11.1)。
|
||||
|
||||
- **系统语义样式**:UI 用 `.font(.body)` / `.headline` / `.caption` / … SF 语义样式(随 Dynamic Type 缩放);日志等宽处用 `.system(…, design: .monospaced)` **原生等宽字体**(`LogView` 消息行)。
|
||||
- **缘由**:CJK 自定义字体体积大(Orbit 两变体 woff2 合计 ~20MB)、须运行期注册,收益不抵成本;系统字体免维护,且 Dynamic Type / 无障碍对比 / 生僻字级联回退最稳。
|
||||
- **落地**:删 `Sources/BrandFonts.swift`(含 woff2 运行期 `CTFontManagerRegisterFontsForURL` 注册 + UIKit 导航 / 标签栏外观代理)+ `AppDelegate` 的 `BrandFonts.register()` 调用 + `CDropApp` 全局 `.environment(\.font, .oBody)`;9 个视图的 `.font(.o语义)` → `.font(.语义)` 回退系统;删 `Sources/Fonts/`(Orbit / Maple woff2)。
|
||||
- **Fredoka 字标(保留)**:`Shared/Fonts/Fredoka-SemiBold.ttf`(ttf,经各 target `UIAppFonts` 注册),`Wordmark` 用 `.font(.custom("Fredoka-SemiBold", size:))`;不入库、`just ios-fonts` 构建前从 Google Fonts 拉。详见 `Shared/Fonts/README.md`。
|
||||
- **对 PARITY 的影响**:字体从「两端同用 Orbit / Maple」回退为「iOS 系统原生 vs web Orbit Gothic」的**允许分叉**;仅品牌 logo(mark + Fredoka 字标)仍是共享源(强约束③)。
|
||||
|
||||
### 11.3 分享引导界面
|
||||
|
||||
@@ -301,6 +303,16 @@ iOS 界面引入与 web 一致的品牌资产与字体栈——这是强约束
|
||||
|
||||
---
|
||||
|
||||
## 13. iPad 适配(2026-07-07)
|
||||
|
||||
iOS 目标本就 `TARGETED_DEVICE_FAMILY = 1,2`(iPhone + iPad 通用),本轮补齐 iPad 的 UI 适配。
|
||||
|
||||
- **导航:`TabView` 经 `.tabViewStyle(.sidebarAdaptable)` 双形态**(`RootView`)——iPad 常规宽度自适应为**侧边栏**(Files / Music 式,左标签栏 + 右内容区),iPhone 紧凑宽度仍**底部标签栏**(浮动液态玻璃)。同一 TabView、同一 5 标签,无需为 iPad 另写导航壳;各标签页的 `NavigationStack` 在右侧内容区内推详情。未读红点 `.badge()` 在侧边栏同样呈现。
|
||||
- **可读宽度**:消息线程(`ConversationView`)气泡列约束 `maxWidth: 680` 并居中,避免在宽内容区横向拉满(呼应 iMessage)。列表类(传输 / 文件 / 设备 / 设置)保留内容区满宽,符合 iPad 原生列表观感(Settings / Mail 式)。sheet(发送预览 / 扫码 / 预览)在 iPad 自动呈 form sheet 居中。
|
||||
- **验证**:`just ios-sim-build`(iphonesimulator,通用二进制)编译过(BUILD SUCCEEDED)。iPad 模拟器 / 真机观感待肉眼验。
|
||||
|
||||
---
|
||||
|
||||
## 附:与桌面端策略对照(修订)
|
||||
|
||||
| 维度 | 桌面(Wails) | iOS(arch A) |
|
||||
|
||||
Reference in New Issue
Block a user