Skip to content

feat: custom font loading pipeline + Mac Retina fix (v0.1.23)#100

Merged
kolkov merged 1 commit into
mainfrom
feat/font-loading-pipeline
May 13, 2026
Merged

feat: custom font loading pipeline + Mac Retina fix (v0.1.23)#100
kolkov merged 1 commit into
mainfrom
feat/font-loading-pipeline

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 13, 2026

Summary

  • Custom font loading pipeline (TASK-UI-CJK-001, gg#304) — plugins load CJK/custom fonts via LoadFont(), auto-registered in global FontRegistry
  • FontRegistry — process-global singleton, thread-safe (RWMutex), CSS weight matching, Inter fallback, *text.FontSource caching
  • StyledTextDrawer optional interface — DrawStyledText + MeasureStyledText on Canvas and SceneCanvas
  • TextWidget.FontFamily() — builder method routes to custom font when available
  • Plugin → Registry wiringMemoryAssetLoader.LoadFont() auto-registers in GlobalFontRegistry()
  • Mac Retina fix — gg v0.46.9, MarkDirty() logical→physical pixel dimensions (gg#308, @sverrehu)
  • CJK IsCJK propagation — gg v0.46.8, ShapedGlyph.IsCJK through scene/shaper paths (gg#304)
  • 47 new tests, ARCHITECTURE.md + ROADMAP.md updated

Architecture

Follows universal pattern from Flutter (FontCollection), Qt6 (QFontDatabase), Iced (FontSystem):

  1. Global font registry (process-singleton, RWMutex)
  2. Resolution chain: widget font → CSS weight match → Inter fallback
  3. Widgets hold family name string, not font data
  4. FontSource created once at registration, cached

Test plan

  • go build ./...
  • go test ./... -count=1 (56 packages, 0 failures)
  • golangci-lint run --timeout=5m (0 issues)
  • Visual verification: IDE example renders correctly, no regressions
  • CI green on all platforms

FontRegistry (global singleton, CSS weight matching, Inter fallback),
StyledTextDrawer optional interface on Canvas + SceneCanvas,
Plugin LoadFont auto-registers in GlobalFontRegistry,
TextWidget.FontFamily() builder routes to StyledTextDrawer.
Mac Retina fix via gg v0.46.9 (gg#308, @sverrehu).
CJK IsCJK propagation via gg v0.46.8 (gg#304).

47 new tests. ARCHITECTURE.md + ROADMAP.md updated.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

@kolkov kolkov merged commit 127a9b4 into main May 13, 2026
9 checks passed
@kolkov kolkov deleted the feat/font-loading-pipeline branch May 13, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant