Skip to content

Conversation

@PeteHaughie
Copy link
Owner

@PeteHaughie PeteHaughie commented Oct 9, 2025

Summary

  • Improve font rendering preserve alpha and make strokes outline-only
  • Simple API font face loading
  • System fonts are listed first but custom TTF and OTF will load from the data folder
  • Render text with RGB then apply per-surface alpha when an RGBA color is provided, ensuring transparent fills/strokes composite correctly.
  • Build stroke outlines via masks (subtract fill mask) so strokes don't appear inside glyph interiors when fill is transparent.
  • Mirror behavior for OffscreenSurface, add/adjust type annotations, and fix indentation/flow issues.
  • Tests & typing: all tests pass (110 passed, 2 skipped); mypy clean.

Related issues

N/A

Checklist

  • I added tests covering the new behavior (or gave a clear reason why not).
  • I ran mypy src/ locally and fixed type issues.
  • I ran ruff check src/ tests/ and addressed any findings.
  • I ran the test suite locally: pytest -q.
  • I updated docs/ where user-visible behavior changed.
  • If this is a migration from a monolithic module into a package, a compatibility shim that re-exports the public API is included and noted here.

For contribution guidance, see CONTRIBUTING.md and docs/package-style.md.

Additional notes for reviewers:

  • Design decisions:
  • Potential follow-ups:

- Simple API font face loading
- System fonts are listed first but custom TTF and OTF will load from the data folder
- Render text with RGB then apply per-surface alpha when an RGBA color is provided,
  ensuring transparent fills/strokes composite correctly.
- Build stroke outlines via masks (subtract fill mask) so strokes don't appear
  inside glyph interiors when fill is transparent.
- Mirror behavior for OffscreenSurface, add/adjust type annotations, and fix
  indentation/flow issues.
- Tests & typing: all tests pass (110 passed, 2 skipped); mypy clean.
@PeteHaughie PeteHaughie merged commit 0cdd15d into main Oct 9, 2025
1 check passed
@PeteHaughie PeteHaughie deleted the feat/text_font branch November 6, 2025 22:41
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