Rich Text Support
John-Val Rose
johnvalrose at gmail.com
Mon Oct 8 18:46:14 UTC 2018
Tom,
I think I must have missed a part of this thread.
Who is Robert? And which post are you extracting those quoted passages from to which you respond?
I look forward to your rebuilt editor BTW :-)
> On 9 Oct 2018, at 04:54, Tom Schindl <tom.schindl at bestsolution.at> wrote:
>
> Hi,
>
> as someone who has written a Code-Editor-Control (I don't talk about
> RichText) I can say that what Robert says is wrong and other examples
> like all Web-Based code editors (Monaco, Orion) show us it is perfectly
> possible implement well performing Code editor using a Scene-Graph.
>
> The trick is as always you need to be virtual (ideally in both
> directions but as a minimum vertically). For code-editors an
> optimization you can use is that often you have monospaced fonts so you
> can very easily interpolate stuff.
>
> Some more comments inline
>
>> On 08.10.18 18:28, Pedro Duque Vieira wrote:
>> I'm not sure, but I think Robert might have only replied to me (probably by
>> mistake) and not the whole openjfx list as well. It has happened to me
>> before :)
>> He makes some points that are probably of interest to this discussion. If
>> his email didn't get to the openjfx mailing list, it is below.
>>
>> I'd like to make some comments to the points he raised:
>>
>> When I mentioned TextFlow I was mentioning it for the rich text display
>> part only. As I mentioned, for the editing, I think it would be good to
>> have more API in the JavaFX SDK to facilitate developing a Rich text
>> editor. Like I said, FontMetrics would be a nice addition, not just for
>> rich text editing but for anything that involves laying out text and other
>> things. So this would be very good to have. Right now you have to resort to
>> hacks when laying out text, and for some things you simply don't have the
>> API.
>> Other good additions to the API, which are also relevant to this
>> discussion, would be to be able to know which character has been clicked on
>> in a text node, either via mouse or touch. FontMetrics could also help with
>> this.
>
> Text-Node has hit-testing so you get the character position as public API.
>
>>
>> When creating a Rich Text editor with a scene graph approach and retained
>> mode (vs using an approach like using Canvas), we'd have to use a technic
>> that doesn't use a Node for every character or word. Otherwise we will
>
> This is correct. We are currently working on new version of our
> Code-Editor control and there we render 1 line with at most 4 Nodes (no
> matter how many colored sections you have) in case we have a mono-spaced
> font (something we simply defined as a pre-requisit for the moment)
>
>> eventually have thousands of nodes in the scene which will kill performance
>> and memory. One of those techniques is to use virtualization, via the use
>> of a ListView for example. Each cell can be a TextFlow representing a line
>> that would automatically be re-used by the ListView. So I don't think we
>> must resort to using Canvas. Personally I prefer using a scene graph based
>> approach.
>
> As I said above ListView like support at minimum but ideally you are
> virtual in both directions - something our rebuild code-editor control
> is going to support.
>
> Tom
>
> --
> Tom Schindl, CTO
> BestSolution.at EDV Systemhaus GmbH
> Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
> Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
More information about the openjfx-discuss
mailing list