Skip to content

Refine genre title typography and layout logic in the search screen t…#1684

Merged
theovilardo merged 1 commit into
masterfrom
fix/genre-font-style
Apr 9, 2026
Merged

Refine genre title typography and layout logic in the search screen t…#1684
theovilardo merged 1 commit into
masterfrom
fix/genre-font-style

Conversation

@theovilardo

Copy link
Copy Markdown
Collaborator

…o improve readability and visual consistency across different card sizes.

Typography & Layout Engine

  • GenreTypography: Replaced the basic randomized style generator with a sophisticated resolveTitlePresentation engine.
    • Dynamic Line Breaking: Implemented findBestBreak and a scoring algorithm to intelligently split genre names into two lines based on word count, character density, and orphan prevention.
    • Variable Font Optimization: Fine-tuned Google Sans Flex variable font axes (Weight, Width, Slant, Grade, Roundness) using a jittered hashing strategy for deterministic yet expressive text styles.
    • Constraint-Aware Styling: Added TextMeasurer integration to select the best-fitting style candidate (from Expressive to Compact) based on the available pixel width of the card.
    • Genre Profiling: Introduced GenreTitleProfile to categorize titles (Compact, Dense, Very Dense) and apply specialized font scaling and width constraints.

UI Components

  • GenreCategoriesGrid: Updated GenreCard to use BoxWithConstraints and rememberTextMeasurer for responsive text rendering.
  • Layout Refinement: Replaced the single Text element with a Column layout to support the new multi-line presentation logic, ensuring titles respect card boundaries while maintaining high visual impact.
  • Density Awareness: Integrated LocalDensity to ensure typography scales correctly across different screen densities and font scale settings.

…o improve readability and visual consistency across different card sizes.

### Typography & Layout Engine
- **GenreTypography**: Replaced the basic randomized style generator with a sophisticated `resolveTitlePresentation` engine.
    - **Dynamic Line Breaking**: Implemented `findBestBreak` and a scoring algorithm to intelligently split genre names into two lines based on word count, character density, and orphan prevention.
    - **Variable Font Optimization**: Fine-tuned `Google Sans Flex` variable font axes (Weight, Width, Slant, Grade, Roundness) using a jittered hashing strategy for deterministic yet expressive text styles.
    - **Constraint-Aware Styling**: Added `TextMeasurer` integration to select the best-fitting style candidate (from Expressive to Compact) based on the available pixel width of the card.
    - **Genre Profiling**: Introduced `GenreTitleProfile` to categorize titles (Compact, Dense, Very Dense) and apply specialized font scaling and width constraints.

### UI Components
- **GenreCategoriesGrid**: Updated `GenreCard` to use `BoxWithConstraints` and `rememberTextMeasurer` for responsive text rendering.
- **Layout Refinement**: Replaced the single `Text` element with a `Column` layout to support the new multi-line presentation logic, ensuring titles respect card boundaries while maintaining high visual impact.
- **Density Awareness**: Integrated `LocalDensity` to ensure typography scales correctly across different screen densities and font scale settings.
@theovilardo theovilardo merged commit fcab163 into master Apr 9, 2026
3 checks passed
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