Text

Answered

turn on text.guides.enable will cause the content to zoom and move to the left side of the screen

First I write some on a content part with the text guide line off.

image

And this works fine, but when I open the guide line use this code:


editor?.configuration?.setBoolean("text.guides.enable", true)

all the content are zoomed and moved to the left of the view:

image


I want to know why this content changes and how can I keep the content, just do not make the content change?


Best Answer

Finally I found the point is that the "renderer.draw-guides" property works on engine's configuration, not the editor's configuration.

Thanks a lot.


Hello,


In order to provide you better support, can you please, give some further details:


  • Which content part are you using?
  • Are you sending the strokes incrementally or in batch mode?
  • Are you modifying the text guidelines at application start up or later?


Best regards,


Gwenaëlle

1. The content part is Text

2. I send the strokes increamentally, in the method onTouchEvent

3. I turn on or off the guidelines when the application is running. I created a button to let the user decide whether to show the guides. Turn off the guildeline is ok, but turn on will zoom and move the content just as the picture shows.

Hello,


Thank you for the update.


Modifying the text.guides.enable property means that you enable or disable the guides of a Text part, (not only display or hide the guide lines). This has an impact on the recognition, conversion and  possibly triggers a reflow. 

This is the reason why when, you enable the guides, the text is reflowed to match the start of the 1st guide line.


In your case, if you want to display or hide  the guidelines on the screen, you should probaly rather use the "renderer.draw-guides" property.

By default its value is true.

Once it is modified, you should update your UI.


Best regards,


Gwenaëlle

I tried the "renderer.draw-guides" property, but this property can not take effect dynamically in the runtime.

Dear Cheng Kong,


in order to update the renderer, the easier is that you call the "invalidate" function:

Configuration conf = engine.getConfiguration();
conf.setBoolean("renderer.draw-guides", false);
editorView.invalidate();


Best regards,


Olivier

Answer

Finally I found the point is that the "renderer.draw-guides" property works on engine's configuration, not the editor's configuration.

Thanks a lot.

Dear Cheng Kong,


I am glad it is working.


Feel free to contact us if you have any other question.


Best regards,


Olivier

  • Support
  • Forums
  • Text
  • turn on text.guides.enable will cause the content to zoom and move to the left side of the screen