General questions

Importing formatted text into Text Document

I am working on an iOS iPadOS project which will take in existing text if it exists and import into a MyScript view as formatted text. There I want to be able to add emphasis such as bold underline and italics as well as adding more notes. What is the best way to get an NSAttributedString into a “Text Document”?

Dear James,


thank you for contacting us.


Currently, it is not possible to import pre-formatted text. You can only import text adding a Text block (see the addBlock function: https://developer.myscript.com/refguides/interactive-ink/android/1.3/com/myscript/iink/Editor.html#addBlock-float-float-java.lang.String-com.myscript.iink.MimeType-java.lang.String-).


Best regars,


Olivier

Would it be possible to import the text and then format it using?

Dear James,


Currently, without knowing what you want to achieve, it is difficult to provide with an accurate answer.


Indeed, the API by itself is rather limited, but you can play with the Styling references, and see if it matches your expectation: https://developer.myscript.com/docs/interactive-ink/1.3/reference/styling/#text


Best regards,


Olivier

To answer the question of what I hope to achieve I want to take in a paragraph or more, with bold, italic, underline formatting. The. I want to be able to highlight it and add other emphasis and export it back to a rich text View

Hello James,


Thank you for your update.


What do you mean by importing formatted text?  What would be the source of your formatted text?


Best regards,


Gwenaëlle




I am speaking of NSAttributedString or Rich Text. I am hoping I can figure a way to keep at least some of the formatting and import it or style it. But I haven't figured out quite how to style the text I have imported. Since opening this thread I have been reading your documentation but not doing any specific work on solving the problem. The main things I want to be able to keep as I import text would be bold, italic, underline.

example:

This some text with an emphasis in bold, italic, underline

If you import raw Text  in a Text part, you might apply some styling on your editor by setting a theme on it before importing the text, such as changing the color or font-style like for instance ".text {font-family:courier ; font-style: italic;  color: #009900; }"
This would be quite limited, though.



Best regards,


Gwenaëlle




Login or Signup to post a comment