-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rich text not rendering when deserialised #159
Comments
Hi @alelordelo Can you try this with the |
hi @danielsaidi, just tried now but didn't work also... RichTextEditor render rich text fine when editing, but not when read from database. Any idea why this read the rich text attributes, but RichTextEditor not? |
I found a bug in the theming, and disabled applying the theme if the string's not empty...but perhaps something else needs to be fixed as well. Just to clarify, how do you serialize? If you only serialize the raw string, the format will be thrown away. Have a look at the demo, and see how it persists to file. |
hey @danielsaidi So, this is basically my workflow: Editing works fine
Serialize
Deserialize
A- Read deserializeRichText into RichTextEditor, renders without complete rich text (underscript works)
Print this
B- Read deserializeRichText into Text(AttributedString( )) for debug purposes. Render correctly
Print this
|
@alelordelo Thank you for the detailed bug report! 🙏 In that case, I think it may be the font bug, since underline works. @DominikBucher12 We should look into this. |
@danielsaidi and @DominikBucher12 , Updates on the debug... I added some prints to RichTextEditor ViewRepresentable:
And found that: Initially the font is read correctly: But when updated, it defaults to AppleSystemUIFont: Probably something is causing the view to be refreshed, and it defaults to apple font? |
I tested the demo app in the main branch, and opening a saved text document still works. It restores fonts, colors, styles, etc. |
This renders rich text deserialised from Realm:
This render text and I can style it fine, but does NOT render rich text .rtf deserialised from Realm:
I tried to manually refresh the view, but that didn't work. Really lost here on what could be wrong...
Any inputs are supper appreciated!
The text was updated successfully, but these errors were encountered: