Skip to content

fix: font family not importing from theme.json (closes #1376)#1735

Open
venkey-dev wants to merge 6 commits intozeshuaro:mainfrom
venkey-dev:1376-fix-font-family-import
Open

fix: font family not importing from theme.json (closes #1376)#1735
venkey-dev wants to merge 6 commits intozeshuaro:mainfrom
venkey-dev:1376-fix-font-family-import

Conversation

@venkey-dev
Copy link
Copy Markdown

@venkey-dev venkey-dev commented Nov 24, 2025

fix: font family not importing from theme.json (closes #1376)

Fixes #1376

Description

This PR fixes the bug where a custom font family selected in Text Theme (e.g., Montserrat, Roboto Mono, etc.) is lost when the theme is exported to theme.json and then re-imported. After the fix, the chosen font family is correctly saved in the JSON file and restored on import.

Changes

  • Properly serialize TextTheme.fontFamily and related fallback fonts during theme export
  • Correctly deserialize and apply the font family when importing theme.json
  • Updated relevant theme export/import utilities and text theme handlers
  • Added/updated unit tests for font family round-trip persistence (if applicable)

Testing

Tested on https://appainter.dev (web):

  1. Go to Advanced → Text Theme
  2. Change Font Family to Montserrat
  3. Export theme → theme.json
  4. Refresh the page (clear current theme)
  5. Import the saved theme.json
  6. Result: Font Family is correctly restored to Montserrat (no longer falls back to Roboto)

No regressions observed in other theme sections.

Closes #1376

@venkey-dev venkey-dev changed the title Fix font family not importing from theme.json (closes #1376) fix: font family not importing from theme.json (closes #1376) Nov 24, 2025
Ensure FontPicker shows default font when initial is null/empty,
add comprehensive widget tests, and provide FontRepository in all
relevant test setups.
…dary

This commit updates the font selection logic to prioritize `fontFamilyFallback` over the direct `fontFamily` property of a `TextStyle`.

Previously, only the `fontFamilyFallback` was considered. Now, the logic is updated to first check for a `fontFamilyFallback` and, if it's not present, to then use the `fontFamily` property.

This ensures a more robust font resolution, especially for theme-level font definitions. Corresponding tests have been added to verify the new behavior.
@venkey-dev
Copy link
Copy Markdown
Author

Hay @zeshuaro , I have Run the Same Workflows for this Branch in My local Repository thay also given Error I tried Once again they Got Fixed without any Changes can U also try rerun these workflows (only failed once)?

GitHub Actions Workflow : https://github.com/venkat-clone/appainter/actions/runs/20594678830
Example App Workflow : https://github.com/venkat-clone/appainter/actions/runs/20594684675

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.

[BUG] Font family does not import

1 participant