iink SDK on Device

Answered

Styling of Text blocks added with Editor.addBlock in a TextDocument

I am trying to apply color to new Text blocks added to a Text Document part.

The blocks are added with code similar to this: 

editor.addBlock(x, y, "Text", MimeType.TEXT, textValue);

  I tried setting the color for Text blocks to green as follows:

editor.setTheme(".text { color: #00FF00FF; }");

However, the text in the blocks I add is the default black so it looks like setting the theme has no impact on addBlock. The color of handwritten stuff however is changed to green so it looks like setTheme() was indeed applied.

Is it possible to set a color to newly created Text blocks?

Thank you!


Best Answer

Dear Nicolas,


currently, the color will apply to all the objects of the editor. Therefore, you cannot set a color only to a specific block.


Best regards,


Olivier


Just to clarify, I set the theme above once, when the app starts. So before editor.addBlock() is called.

Answer

Dear Nicolas,


currently, the color will apply to all the objects of the editor. Therefore, you cannot set a color only to a specific block.


Best regards,


Olivier